As described in documentation: "To perform any actions with an already exported report, the OnExportReportResponse event is used. This event will be called immediately before the file is saved. In this event, you can get the export format, the type of the Web content and the name of the file to save. You can also get, and, if necessary, change the byte stream of the final export file."
I tried to change byte stream and it doesn't work for me (old stream saves).
My code is:
Code: Select all
protected void Report_OnExportResponse(object sender, StiExportReportResponseEventArgs e)
{
Stream stream = e.Stream;
var text = stream.ReadAll().Replace("A", "B");
e.Stream = new MemoryStream(Encoding.UTF8.GetBytes(text ?? ""));
}