locked
RDLC exporting to excel retain data type like Currency. RRS feed

Answers

  • User1711366110 posted


    I want to show Currency or Date in number format, while exporting RDLC report to Excel. The column data type always shows General.
    When I use particular format like "C" for currency in RDLC report. It shows correct currency format($40,00.00) but it shows custom in number format in Excel sheet

      As per this case, MSDN explains that
      When the Textbox element is rendered in Excel, the data type may be converted to one of the data types available in Excel. Numeric values convert to the value of the number with full precision, and a period as a decimal separator. Boolean values of 0 and 1 convert to the strings "true" or "false".

    I think its not possible to achieve exactly what you are looking for.
    you can use the Format property to format the text box with C2 for currency (C for Currency and 2 for the number of digits after the decimal).

    for more information , refer the following links :

    1. https://msdn.microsoft.com/en-us/library/aa178950(v=sql.80).aspx

    2. https://msdn.microsoft.com/en-us/library/dd255234.aspx#ExcelRenderer

    --
    with regards,
    Edwin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 17, 2015 3:11 AM

All replies

  • User1711366110 posted


    I want to show Currency or Date in number format, while exporting RDLC report to Excel. The column data type always shows General.
    When I use particular format like "C" for currency in RDLC report. It shows correct currency format($40,00.00) but it shows custom in number format in Excel sheet

      As per this case, MSDN explains that
      When the Textbox element is rendered in Excel, the data type may be converted to one of the data types available in Excel. Numeric values convert to the value of the number with full precision, and a period as a decimal separator. Boolean values of 0 and 1 convert to the strings "true" or "false".

    I think its not possible to achieve exactly what you are looking for.
    you can use the Format property to format the text box with C2 for currency (C for Currency and 2 for the number of digits after the decimal).

    for more information , refer the following links :

    1. https://msdn.microsoft.com/en-us/library/aa178950(v=sql.80).aspx

    2. https://msdn.microsoft.com/en-us/library/dd255234.aspx#ExcelRenderer

    --
    with regards,
    Edwin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 17, 2015 3:11 AM
  • User1007957230 posted

    I had the same issue and I was able to figure it out.

    You have to remove the method call to FormatCurrency() in your expression. You just want the data value. To format the value to currency, you can set it in the Placeholder Properties Dialog by double clicking on the cell in the report viewer. The Placeholder Properties dialog will pop up and you then select Number and set the Category to Currency.

    Now your export to excel will be Currency for that cell.

    Hope that helps.

    Wednesday, May 6, 2015 12:56 AM