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
690
UltraGridDocumentExporter ArgumentException: Invalid Parameter
posted

on a form, I have a

        private UltraGridDocumentExporter ultraGridDocumentExporter;

and a button to initiate a pdf export. in the button click there is

Report report = new Report()
ISection section = report.AddSection();
 
ISectionHeader header = section.AddHeader();
header.Height = 30;

IText headerText = header.AddText(0, 0);
headerText.Style.Font.Underline = true;
headerText.AddContent(exportHeaderText);

IText headerDate = header.AddText(0, 0);
headerDate.AddDateTime("dd.MM.yyyy");
headerDate.Alignment = TextAlignment.Right;

ISectionFooter footer = section.AddFooter();
footer.Height = 30;
 
IText footerText = footer.AddText(0, 0);
footerText.AddPageNumber(PageNumberFormat.Decimal);
footerText.Alignment = TextAlignment.Right;
 
ultraGridDocumentExporter = new UltraGridDocumentExporter();
ultraGridDocumentExporter.ExportEnded += ultraGridDocumentExporter_ExportEnded;
 
ultraGridDocumentExporter.TargetPaperOrientation = PageOrientation.Landscape;
ultraGridDocumentExporter.ExportAsync(ug_report, section);

when I click the pdf-button, the event is executing the the report is collection some data. Now I click Cancel and close the form.

If I now reenter the form (which was closed, also disposed), and do the same (fill a grid, click on pdf button),

I get an argument exception "invalid parameter" in the line

ultraGridDocumentExporter.ExportAsync(ug_report, section);

ug_report is the grid, section the ISection.