I have a requirement where i need to dynamically add a date field to the filename at the time of export.
So the file name should look like "filename 202110". The dynamic part is the year + current month after filename.
The script language on the report is set to CSharp but I can switch that if required.
On the code page of the report i see the following,
Code: Select all
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;
namespace Reports
{
public class n10425859SL : Stimulsoft.Report.StiReport
{
public n10425859SL() {
this.InitializeComponent();
}
#region StiReport Designer generated code - do not modify
#endregion StiReport Designer generated code - do not modify
}
}
I have seen one post here where the solution suggested was,
Code: Select all
viewer.addEventListener(StiViewerEvent.START_EXPORT, onStaerExport);
...
private function onRetrieveColumns(event: StiViewerEvent): void
{
event.report.reportFile = event.report.reportName + StiDateTime.now.toString("YYYY-MM-dd");
}
Thank you