Report viewer export and print events

2019-07-26 08:12发布

问题:

I need to catch the exporting and printing activities of a report viewer because I need to log the username and the time/date of such activity. I have had a look at the telerik report viewer events and as well as at the standard asp report viewer but I do not see any of the events that may help me in these regards.

How can I catch the printing and export activity of the report viewer to embed my code:

 Utilities.Record_Transaction("Report_xxx-Exported to Excel " + cname, (string)Session["userName"]);

Any hint?

回答1:

For export you can hide Export control and implement your own adding code you need. Here is first example of doing this from google: http://dinesql.blogspot.co.uk/2010/05/report-viewer-control-exporting-reports.html

Same approach you can use for printing - How to call print from asp.net on a reportviewer control?