This is a migrated thread and some comments may be shown as answers.

How to set page orientaion for PDF and Word file when exporting? Is it possible to convert directly from ExcelML to PDF or Word?

3 Answers 407 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LamKhoa
Top achievements
Rank 1
LamKhoa asked on 29 Jun 2011, 10:38 PM
I tried following to export to pdf in Landscape page orientation:

 

RadGridResult.ExportSettings.Pdf.PageHeight = Unit.Parse("215mm")

 

RadGridResult.ExportSettings.Pdf.PageWidth = Unit.Parse("260mm");

But it didn't work, and I have no idea on how to export to Word in Landscape orientation.
But I can do it with Excel just fine. Is there anyway to "convert" Excel to PDF or Word format on the fly?

THanks

LamK.

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Jul 2011, 09:56 AM
Hello LamK,

You can set the page orientation as demonstrated in the attached sample project.
As to the second question - I'm afraid it is not possible to convert the files from one format to another - this is out of the scope of RadGrid.

Best regards,
Daniel
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
LamKhoa
Top achievements
Rank 1
answered on 08 Jul 2011, 11:03 PM
Thanks,

Now I'm able to make it to be in Landscape orientation when exporting to word.

However, it's still not enough to show up all the columns in my grid. By default, the Word exporting is set to 1 inches margin. Is there anyway that I can programmatically change that (like to .5 inch margin)?

Thanks

LamK.
0
Daniel
Telerik team
answered on 11 Jul 2011, 09:19 PM
Hello Lamkhoa,

Yes, it is possible. Here is an example:
e.Styles.Append("<!-- @page WordSection1 { size: 297mm 210mm; margin:1.0in 2.0in 1.0in 2.0in; }" +
                "div.WordSection1 {page:WordSection1;} -->");

Best regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
LamKhoa
Top achievements
Rank 1
Answers by
Daniel
Telerik team
LamKhoa
Top achievements
Rank 1
Share this question
or