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

RadGrid PDF Export/Dynamic Header text

1 Answer 188 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Karen
Top achievements
Rank 1
Karen asked on 23 May 2017, 09:15 PM

I have a RadGrid using export settings for a PDF.  I need to have the PDF PageHeader take a dynamic value based on some input data.

EX:

<ExportSettings>
     <Pdf PageHeight="11in" PageWidth="8.5in" >
          <PageHeader>
                  <MiddleCell Text =  <dynamic data here>  />
          </PageHeader>
     </Pdf>
</ExportSettings>

 

Any help would be appreciated.

Thank you

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 26 May 2017, 12:04 PM
Hi Karen,

The cells Text property does not support server-tag values, but you can set the text content of each cell inside the PDF page header programmatically on the server by passing the needed dynamic value to the corresponding property:
RadGrid1.ExportSettings.Pdf.PageHeader.MiddleCell.Text = "dynamic data here";

This approach is also used in the following demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/pdf-export/defaultcs.aspx

Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Karen
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or