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

How to break the lines in PDF Export from RadGrid

3 Answers 248 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Radha
Top achievements
Rank 1
Radha asked on 11 Dec 2012, 01:46 PM
Please somebody help me how to break the lines and how to give space between words in PDF while exporting from Radgrid.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Dec 2012, 05:00 AM
Hi,

Try the following code to achieve your scenario.
C#:
protected void RadGrid1_PdfExporting(object sender, Telerik.Web.UI.GridPdfExportingArgs e)
   {
       e.RawHTML = e.RawHTML.Replace("<br/>", Environment.NewLine);
   }

Thanks,
Shinu.
0
Radha
Top achievements
Rank 1
answered on 12 Dec 2012, 02:12 PM
Hi,

Thanks for the reply but it didn't work.

Below is the code where e.RawHTML have <br/> tags and those tags are not able to read while exporting to PDF.
AS you suggested i tried the code but still the issue exists.

 

 

protected void grdReport_PdfExporting(object source, GridPdfExportingArgs e)

 {

e.RawHTML = "<left><img alt='test' style='height:20px;width:100px;' src='~/images/Volt.jpg'/></left><center style='font-family:Verdana;font-weight:bold'>" + exportPageTitle + "</center>" + e.RawHTML;

  

e.RawHTML = e.RawHTML.Replace("<br/>", Environment.NewLine);

}

Please help me how to solve the issue?

0
Kostadin
Telerik team
answered on 17 Dec 2012, 12:23 PM
Hello Radha,

If you want to add a new row you have to add a <br/> tag. On the other hand if you want to add an empty space you have to add a &nbsp;. I prepared a small sample and attached it to this forum post. In the example I demonstrated how you can add a new row and empty spaces at the RawHTML.

Regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Radha
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Radha
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or