Change Date Format when export excel

Stimulsoft Reports.NET discussion
Post Reply
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Change Date Format when export excel

Post by jserret »

Hi, I need the format date dd-mm-yy (not only need this format in the text i need the format of the cell are Date) when i export one report to xlsx but i don't see this format in Date format text (attach the image).

Can you help me?
Attachments
DateFormatStimulsoft.png
DateFormatStimulsoft.png (22.61 KiB) Viewed 2218 times
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Change Date Format when export excel

Post by Lech Kulikowski »

Hello,

Please try to set the Custom format.

Thank you.
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Re: Change Date Format when export excel

Post by jserret »

Lech Kulikowski wrote: Mon Apr 27, 2020 10:42 am Hello,

Please try to set the Custom format.

Thank you.
The custom format is the format i select in the last image?

In this case i show me the date in the format dd/MM/yyyy not in dd-MM-yy. I see is possible to change the culture but any culture use my format.
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Change Date Format when export excel

Post by Lech Kulikowski »

Hello,

As a way, you can use the ToString() method:
{datasource.column.ToString("dd-MM-yy")}

Thank you.
jserret
Posts: 23
Joined: Mon May 09, 2016 10:51 am

Re: Change Date Format when export excel

Post by jserret »

Lech Kulikowski wrote: Fri May 01, 2020 12:00 pm Hello,

As a way, you can use the ToString() method:
{datasource.column.ToString("dd-MM-yy")}

Thank you.
In this case the result text is in format "dd-MM-yy" but when i export the cell in excel as text and i need this cell are in the format date.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Change Date Format when export excel

Post by HighAley »

Hello,

Please, try to

- set the Text Format to Date
- set the Excel Value with the necessary value
- set the next static option:

Code: Select all

StiOptions.Export.Excel.AllowExportDateTime = true;
Thank you.
Post Reply