string format "P" with any any number (ex: P1, P2, P2, etc.) is adding one extra decimal when exported to Excel
In most of our reports, we use the the format "P" to format numbers as percentage.
ex: 0.123456 with
If you add a number to the format (ex: P1, P2, P3, etc.), the number of decimals matches the number next to P when exported to all document types except Excel. In Excel, there is always one more decimal.
ex: 0.123456 with
I was able tor reproduce the issue in the sample project.
I can't reproduce the behavior in a sample project. Changing Price column format specifier to P1 produces properly formatted percentage with one decimal digit - both in PDF, XLS and XLSX.
Please provide modified report.rdlc that renders with incorrect number of decimal digits.
Use a different value (ex: Price = 0.111111m).
The value in the demo ( Price = 1.0499m) doesn't have enough decimals when converted to percentage
Right - adding decimal places to the Price triggers the behavior. However, the same problem occurs in original Report Viewer when exporting to Excel. It is caused by Microsoft.ReportingServices.Rendering.ExcelRenderer.SPBIF.ExcelCallbacks.Convert.FormatHandler.GetLongNumberFormat, which converts "P1" to "#,##0.0#%", with extra "#" before percent sign.
To keep bug-for-bug compatibility with original Report Viewer, I won't be fixing it in this project. Feel free to fork it and modify the GetLongNumberFormat method as you need.