This project has moved and is read-only. For the latest updates, please go here.
1
Vote

Excel doesn't work with DataFormatString {0:N}

description

great project. I love it. Thank you very much.

Not sure if there are any issue with my computer or not but when I use DataFormatString {0:N} or {0:n}, there is an issue open up the excel. I get a notification from excel tell me that "Excel found unreadable content in the workbook." I can recover it but then the format does not work. I'm trying to add commas in for number.

I tried with currency, replacing the DataFormatString above to {0:c} and everything work fine, I get the currency DataFormatString but I don't want the currency format, just numeric with number.

Not sure if this is one of the feature that the project doesn't support or if I did something wrong. Please help.

Thank you very much in advance.

comments

RomeoQNgo wrote Sep 27, 2012 at 8:24 PM

I found the solution to this. using format "#,##0".
the easier way to find the right format is to open up excel and set up the format you want and then save as xml file and open up the xml file and find that column format.

now come to the part to set the alignment.

RomeoQNgo wrote Sep 27, 2012 at 8:31 PM

found it. report.DataFields["TotalD3HousingUnit"].DataStyle.HorizontalAlignment = HorizontalAlignment.Right;

pretty cool. thanks again.