• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set Page Orientation and Print settings for generated Excel file using xsl

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

We are using xmldata and xsl file and using processor we are creating Excel file. xml is simple data embeded in tags. in Xsl file we are using



Now I want to set the print settings for created Excel file . It's Page Orientation to 'Landscape' and want to add scaling as 'Fit-all-Columns'. I am trying but not getting much information on setting Print options. Can anybody help me out, it's urgent.

Thanks
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the absence of any documentation, here's what I suggest:

Generate the Excel XML file without the print settings and save it. Load it into XML. Apply the print settings which you want, and save it in the XML format. Then look at the file you just saved and see what's different about it.

Documentation for this format does exist, by the way. It was produced by Microsoft at the time they applied for the standards authority approval from, I forget where. Maybe ECMA? Anyway there was a 6000-page PDF document produced at that time which documented the Office XML formats (which are your search keywords on Microsoft's site by the way), so you could try to track that down.
 
Ranch Hand
Posts: 734
7
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@vedika ashtekar
This may help, in particular, check out the use of <x:FitWidth>1</x:FitWidth> on page 3.
http://www2.sas.com/proceedings/sugi30/092-30.pdf
 
vedika ashtekar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks @g tsuji. I checked your reply just now and yes whatever you have suggested is the perfect solution. Last eve I was trying to find the solution and I came across the same link you had posted here.
And I could solve my problem. still thanks for mentioning the link.

I added <style>@page {mso-page-orientation:landscape;}</style> in my .xsl file to set the page Orientation to Landscape.
and print settings to FIT ALL COLUMNS of generated Excel file on one page i have added following code
<x:WorksheetOptions>
<x:FitToPage/>
<x:Print>
<x:FitWidth>1</x:FitWidth>
<x:FitHeight>1000</x:FitHeight>
<x:ValidPrinterInfo/>
</x:Print>
</x:WorksheetOptions>

Finally could able to make it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic