Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Add Title to pdf
posted

Hi,

 

I have webgrid that I populate with a csla data source  and export to pdf using UltraWebGridDocumentExporter. I try to add a title to the pdf through the BeginExport event of the UltraWebGridDocumentExporter. This event doesnlt seem to be firing. following is the code. Not sure what I am missing:

The End Export event fires but doesnlt seem to add the title as well

BtnRunReport_Click

{

UltraWebGridDocumentExporter1.DownloadName = "Best Scores";

UltraWebGridDocumentExporter1.ExportMode = Infragistics.WebUI.UltraWebGrid.Exporter.ExportMode.InBrowser;

UltraWebGridDocumentExporter1.Format = FileFormat.PDF;

UltraWebGridDocumentExporter1.Export(this.uwgReportGrid);

} 

protected void UltraWebGridDocumentExporter1_BeginExport(object sender, Infragistics.WebUI.UltraWebGrid.DocumentExport.DocumentExportEventArgs e)

{

e.Report.Info.Title = "Best Scores";

}

protected void UltraWebGridDocumentExporter1_EndExport(object sender, Infragistics.WebUI.UltraWebGrid.DocumentExport.EndExportEventArgs e)

{

e.Report.Info.Title = "Best Scores";

}

 I alterbatively tried this code in the BeginExport event:

Infragistics.Documents.Report.Section.ISectionHeader _Header = e.Section.AddHeader();

Infragistics.Documents.Report.Text.IText _Title = _Header.AddText(0, 0);

_Title.Caption = "Best Scores";

 Thanks, 

Himgauri