append datetime to file name with SpreadExporter

2 Answers 81 Views
Spreadsheet
Brian
Top achievements
Rank 1
Iron
Iron
Brian asked on 28 Oct 2022, 06:14 PM

How can I add a Datetime to the exported file name

spreadExporter.RunExport(@"C:\#support\Reports\AlarmsRpt\AlarmsReport.xlsx", renderer);

Does not allow for overloads, so, how can I do it?

Thanks,

Brian
Top achievements
Rank 1
Iron
Iron
commented on 28 Oct 2022, 06:43 PM

Disregard. figured it out myself.

 

                spreadExporter.RunExport(@"C:\#support\Reports\AlarmsRpt\AlarmsReport" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx", renderer);

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Oct 2022, 05:31 AM

Hello, Brian,

If I understand your requirement correctly, you need to append the DateTime value to the file name when exporting. It seems that you have found a suitable approach. Calling the RunExport method passing the desired file name as an argument is the proper way to do it. It is just necessary to concatenate the strings: "AlarmsReport" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx".

If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Brian
Top achievements
Rank 1
Iron
Iron
commented on 31 Oct 2022, 12:20 PM

Thanks Dess. I figured it out right after I asked the question.

 

Appreciate your response.

0
Brian
Top achievements
Rank 1
Iron
Iron
answered on 28 Oct 2022, 06:43 PM

                spreadExporter.RunExport(@"C:\#support\Reports\AlarmsRpt\AlarmsReport" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx", renderer);

 

Tags
Spreadsheet
Asked by
Brian
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Brian
Top achievements
Rank 1
Iron
Iron
Share this question
or