Exporting Numbers to Excel
Exporting Numbers to Excel
I have a report that has a number of numeric fields. Each has been formatted as a number with different quantity of decimal places (some have 0, one has 5). All the fields are displayed properly in PDF output. However, when exporting the report to Excel, all the numeric fields are reset to 2 decimal points. Any ideas on an easy fix? Thanks in advance!
Re: Exporting Numbers to Excel
Hi Roman,
Please try to use ExcelValue property, please check a sample in this topic:
viewtopic.php?&t=407
Thank you,
Edward
Please try to use ExcelValue property, please check a sample in this topic:
viewtopic.php?&t=407
Thank you,
Edward
Re: Exporting Numbers to Excel
Thanks Edward. I looked into it but I can't find much help on the Format function that I could use in that property.
Re: Exporting Numbers to Excel
Hi Roman,
Could you please try to get the 'string' representation of that number without any formatting and to pass it to the ExcelValue, similar as per that sample, i.e. :
Thank you,
Edward
Could you please try to get the 'string' representation of that number without any formatting and to pass it to the ExcelValue, similar as per that sample, i.e. :
Code: Select all
public void Text1_GetExcelValue(object sender, Stimulsoft.Report.Events.StiGetExcelValueEventArgs e)
{
e.Value = "123456.78901";
}
Edward
Re: Exporting Numbers to Excel
Thank you Edward. I'll try it but I do need to format the numbers in specific formats. So, first, it's weird as to why Stimulsoft doesn't keep the formatting as defined in the properties. Second, do you know where I can find information on the syntax of the Format function?
Re: Exporting Numbers to Excel
Hi Roman,
No problem!
Please check the following topic:
https://www.stimulsoft.com/en/documenta ... atting.htm
And for the format function if you require some extra functionality, please feel free to use the standard .Net formatting functions as follows:
https://docs.microsoft.com/en-us/dotnet ... at-strings
And some more techniques for you:
viewtopic.php?t=4354
Thank you,
Edward
No problem!
Please check the following topic:
https://www.stimulsoft.com/en/documenta ... atting.htm
And for the format function if you require some extra functionality, please feel free to use the standard .Net formatting functions as follows:
https://docs.microsoft.com/en-us/dotnet ... at-strings
And some more techniques for you:
viewtopic.php?t=4354
Thank you,
Edward