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

[Solved] Customize Export PDF

3 Answers 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 27 May 2009, 04:37 PM
I am trying to customize my PDF when I export.  I was wondering how to

1.  Add a title to my PDF file.
2. Make it landscape.
3. How to set a certain width to each column.

Thanks for your help.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 May 2009, 03:59 AM
Hi Robert,

For adding extra information to the exported file you may either make use of the CommandItemTemplate as mentioned in the following help article.
Exporting tips and tricks



Or else you can set the title for the PDF document as shown below.

ASPX:
   
           <ExportSettings> 
             <Pdf  Title="PDf Title"  PageHeight="500px" /> 
            </ExportSettings> 

Go through the following  forum link which explains how to set the width of column while exporting.
Export PDF Column Width

Shinu
0
Robert
Top achievements
Rank 1
answered on 28 May 2009, 12:01 PM
Thank you for your reply and help.  It helped me w/ 2 of the 3 questions and I really appreciate it but the articles does not tell me how to set it to landscape.
0
Princy
Top achievements
Rank 2
answered on 28 May 2009, 12:06 PM
Hello Robert,

You can get a lanscsape orientation on exporting your grid to pdf  by setting the PageHeight and PageWidth properties as shown below:
c#:
 
  protected void Button1_Click(object sender, EventArgs e)  
    {         
        RadGrid1.ExportSettings.ExportOnlyData = true;  
        RadGrid1.ExportSettings.OpenInNewWindow = true;  
        RadGrid1.ExportSettings.IgnorePaging = true;  
         
        RadGrid1.ExportSettings.Pdf.PageHeight = Unit.Parse("162mm");  
        RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Parse("600mm");  
        RadGrid1.MasterTableView.ExportToPdf();  
    }  
 

Thanks
Princy.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Robert
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or