Friday, February 24, 2012

Custom code executed when user exports to PDF

Hi,

Is there a way to execute custom code when a user exports a report to PDF? I have an assembly that writes the pages numbers to a database table in order to create a Table of contents. This works great except that the code is called when the report is initially created so the page numbers are written to the database. Then when the user clicks to export to PDF, the PDF page numbers (the ones I want to keep) are written to the database and conflict with the first set of page numbers. Is there any way that I can only call the custom assembly with the export to pdf option is chosen? Or execute code that will truncate the table before exporting to PDF?

Any suggestions?

Thanks in advance,

Amy Bolden

Chosen from where? If this is a custom application and use the ReportViewer controls, you could sink the ReportExport event. You can always call a stored procedure that preps the database too.

No comments:

Post a Comment