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
370
UltraGrid export to PDF
posted

I use Windows Forms Pack 12.1 and am attempting to export wingrid to PDF, with some more details in the PDF, along with the grid

Here is the code that I found on some of your help docs + forums, but it wont work

It exports the grid, but does not add any header, footer, paging sections

What am I missing?

All help appreciated

var exportedFilePath="c:\report.pdf";

var report = new Report();

ISection gridSection = this.ultraGridDocumentExporter1.Export(dgReport, report);
gridSection.PageOrientation = PageOrientation.Landscape;
gridSection.PageNumbering.Template = "Page [Page #] of [TotalPages]";
//gridSection.PageNumbering.OffsetY = -18;

ISectionHeader headerSection = gridSection.AddHeader();
headerSection.Repeat = true;

IText headerText = headerSection.AddText(0, 0);
headerText.AddContent("TEST REPORT HEADER");

report.Publish(exportedFilePath, FileFormat.PDF);

//the pdf file is created, but there is no header, footer, the grid prints well to the PDF

Parents Reply Children