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

pdf export column resize

5 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lubna Ansari
Top achievements
Rank 1
Lubna Ansari asked on 19 Jul 2010, 02:58 PM
Hi,

I'm exporting telerik grid to pdf which is working fine. However resizing of columns on pdf file is not working. Below is the function I use to resize the columns.

public

 

void ConfigureExport()

 

{

RadGrid1.ExportSettings.ExportOnlyData =

true;

 

RadGrid1.ExportSettings.IgnorePaging =

true;

 

RadGrid1.ExportSettings.OpenInNewWindow =

true;

 

RadGrid1.Columns.FindByUniqueName(

"PageNo").Display = false;

 

RadGrid1.Columns.FindByUniqueName(

"Mandatory").Display = false;

 

 

 

RadGrid1.Columns.FindByUniqueName("Question").ItemStyle.Width = Unit.Percentage(90);

 

RadGrid1.MasterTableView.GetColumn(

"Question").ItemStyle.Width = Unit.Percentage(90);

 

 

RadGrid1.Columns.FindByUniqueName(

"Answer").ItemStyle.Width = Unit.Percentage(10);

 

 

foreach (GridDataItem item in RadGrid1.Items)

 

{

item.Style[

"font-size"] = "4px";

 

item.Style[

"font-family"] = "Courier New"; //Set UNICODE font

 

item.Style[

"text-align"] = "center";

 

}

}

Thanks.

5 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 22 Jul 2010, 09:33 PM
Hello Lubna,

You have to use HeaderStyle.Width instead of ItemStyle.Width.
PDF export help topic

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lubna Ansari
Top achievements
Rank 1
answered on 27 Jul 2010, 04:36 PM
Thanks Daniel.
There is another question.
I'm assigning pdf page title from code behind. I tried br,p and System.Environment.NewLine for the new line character. But in pdf file the title comes on single line. How can I add a new line character in pdf page title.

Regards,
Lubna.
0
Daniel
Telerik team
answered on 27 Jul 2010, 04:58 PM
Hello Lubna,

The PageTitle property will generate a standard HTML page title element which does not support newline characters nor any customization.

Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lubna Ansari
Top achievements
Rank 1
answered on 27 Jul 2010, 05:10 PM
Hi Daniel,

Thank you for the reply.
When I assign pdf file name from code behind, while opening the file it replaces space with + sign.
I've given file name as "Service Question for Unit" but in pdf the filename id "Service+Question+for+Unit".

Regards,
Lubna.
0
Daniel
Telerik team
answered on 27 Jul 2010, 10:19 PM
Hello Lubna,

Please examine the following thread:
ExportSettings.FileName replacing space with +

Let me know if you need more information.

Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Lubna Ansari
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Lubna Ansari
Top achievements
Rank 1
Share this question
or