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

Rad Grid Export to PDF

2 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nithya Rani
Top achievements
Rank 1
Nithya Rani asked on 20 Mar 2013, 09:32 AM
Hi,

I am adding the PageTitle to the pdf. I need my page title should be in muliple line. if i use <br/> or <p> tags but its not working.
If i add PageTitle it will look like below
    order : x order type:y
but i need like below
    order:x
    order type : y


Can any one help me in this.

Nithya

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 20 Mar 2013, 09:58 AM
Hello,

protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
   {
       string customHTML = "<div width=\"100%\" style=\"text-align:center;font-size:12px;font-family:Verdana;\">title1 : title1 </div>";
       customHTML += "<div width=\"100%\" style=\"text-align:center;font-size:12px;font-family:Verdana;\">title2 : title2 </div>";
 
       e.RawHTML = customHTML + e.RawHTML;
 
       string myClass = "th { text-align: left; }";
       string cssStyle = String.Format("<style type='text/css'>{0}</style>", myClass);
       e.RawHTML = e.RawHTML.Replace("<head>", "<head>" + cssStyle);
   }


Thanks,
Jayesh Goyani
0
Nithya Rani
Top achievements
Rank 1
answered on 20 Mar 2013, 11:40 AM
Thanks Jayesh its worked for me.
Tags
Grid
Asked by
Nithya Rani
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Nithya Rani
Top achievements
Rank 1
Share this question
or