Options

Format Currency in a Visual Studio Report

VotucVotuc Member Posts: 206
edited 2010-09-20 in NAV Three Tier
I redesigned a Sales Invoice report in Visual Studio. It seems to be functioning correctly but the totals and other textboxes that contain currency needs to be formatted with 2 decimal places. Right now it is all integer numbers. How do I do this? I have looked under properties everywhere but I do not see anything that changes the format of the number. :-k

Comments

  • Options
    Torben_Wind_Meyhoff[MSFT]Torben_Wind_Meyhoff[MSFT] Member, Microsoft Employee Posts: 22
    In the RDLC designer you should go to the text box you added. If you total field was called MyField and was of type decimal, then there will be an extra field in the data set called MyFieldFormat, that would contain the decimal information, so on the Format property of the text box you would add the value from the data set: =Fields!MyFieldFormat.Value

    BR
    Torben
    “This posting is provided "AS IS" with no warranties, and confers no rights.”
  • Options
    VotucVotuc Member Posts: 206
    I looked through the data sources (on left in Visual Studio) and I replaced

    Sales_Invoice_Line_Amount
    with
    Sales_Invoice_Line_AmountFormat AKA "=First(Fields!VATAmountLine__VAT_Amount__Control117Format.Value)"


    Now when the invoice prints, it shows this:

    #,##0.00

    I tried to expand the width of the table column but it still shows the same (#,##0.00).

    :(
  • Options
    Torben_Wind_Meyhoff[MSFT]Torben_Wind_Meyhoff[MSFT] Member, Microsoft Employee Posts: 22
    The properties on that particular text box should be following:
    Format: =Fields!Sales_Invoice_Line_AmountFormat
    Value: =Fields!Sales_Invoice_Line_Amount

    Format field Sales_Invoice_Line_AmountFormat contains the decimal information, like what you see: #,##0.00
    Value should then still be your decimal value: Sales_Invoice_Line_Amount

    BR
    Torben
    “This posting is provided "AS IS" with no warranties, and confers no rights.”
Sign In or Register to comment.