Scroll

Server Event: Add disclaimer to reports

You may wish to include some boilerplate text in the output of reports. Attach this server event to a report to add a standard disclaimer automatically. Optionally, make this a global event to automatically add a disclaimer to every report without requiring any user interaction.

Global Event (optional): OnReportExecuteStart

References:

  • WebReportsApi.dll

Namespaces:

  • WebReports.Api,
  • WebReports.Api.Reports,
  • WebReports.Api.Common

Code

// add a new row to the report footer; adds a report footer if none exists
Row newRow = new Row(sessionInfo.PageInfo);
newRow.SectionType = "Report Footer";
sessionInfo.Report.Rows.Add(newRow);

// add the disclaimer text to a new cell spanning the length of the row
Cell newCell = new Cell(sessionInfo.PageInfo, newRow.Index, 0);
newCell.SaveText = "This electronic report is confidential and is intended only for the use of the individual to whom it is addressed. If you have received this report in error, you are hereby notified that any use, dissemination, distribution or reproduction of this report is strictly prohibited.";
newCell.ColSpan = sessionInfo.Report.Columns.Count;
sessionInfo.Report.Cells.Add(newCell);

// apply the changes to the report
sessionInfo.Report.RecreateSections();

return null; // continue execution

Hidden Article Information

Article Author
Exago Development
created 2016-03-08 17:07:40 UTC
updated 2017-06-19 17:26:06 UTC

Labels
SAE, server event, events, example, disclaimer, boilerplate,
Have more questions? Submit a request