In FastReport 2020.1 we have added the ability to change export parameters. To do this, you must subscribe to the ExportParameters event in WebReport.Report.
Until now the FastReport.Net library did not provide access to the export parameters. Or rather, it did, but only to some of the parameters, and with the help of individual properties of the Web report. All these properties are piled up and working with them using intelisense is quite inconvenient, and they do not cover all the needs of users. So it was decided to give users access to all properties of the export object, using a special ExportParameters event. In the event handler you can get the export object and set all the properties you need. Thus, it is now possible to configure the export more precisely due to previously unavailable properties. This is how you can use the new event:
In this example, we only changed the header and the default page. Note that we are expecting a PDF export when processing, which means that this code will not work for another type of export. In one handler you can specify settings for several export types at once.
Now, let's take the example of PDF export as an example of how the available export properties have expanded. Previously WebReport offered us a set of export properties, which were essentially wrappers over the properties of the PDFExport export object:
I must say that this list of properties includes the main and most popular, but not all. Many users want more. And now, with the new event ExportParameters, they have the full set of properties available:
And this is without considering the properties common to all exports.
Let's summarize what benefits the new ExportParameters event brings us. By using an object for a specific export, we can only access the properties of that export. Previously, it was required to select from a common list of properties of all possible exports, which is not always convenient, because the names of some properties are not obvious to identify the export. You will see the full list of available properties using Intellisense or you can see the full list of available properties.