When I export the gird I try to set the name of the file to be exported.
As such:
<GridExport>
<GridExcelExport FileName="@msExportFileName" AllPages="@Revenue_ExportAllPages" OnBeforeExport="@Revenue_OnBeforeExcelExport" />
</GridExport>
string msExportFileName = "Rpt_";
public void Revenue_OnBeforeExcelExport(GridBeforeExcelExportEventArgs args)
{
msExportFileName = "Rpt_ProductsCarriers_" + "Revenue";
)
When it goes into the Revenue_OnBeforeExcelExport the file name works out to be: "Rpt_" only.
If I then click export again the file name = "Rpt_ProductsCarriers_Revenue"
How can I get the name the first time around to work?
Note! the "ProductsCarriers" is hardcode above but actually comes from a DDL object the user has already chosen before it gets to this point.
It can be different values depending on what the user chooses.
Even hardcoded , the first time in ignores that above code. msExportFileName = "Rpt_ProductsCarriers_" + "Revenue";
Stepping thru it the code above seems to be working, but then the file name is "Rpt_" on first attempt.
Strange.
Thanks
Deasun.