locked
SSRS formula RRS feed

  • Question

  • Hi,

    How to convert below crystal report formula into SSRS expression

    ToText(truncate({p_prn_annual_statement.rate},0),0)+','+Mid(ToText({p_prn_annual_statement.rate}-truncate({p_prn_annual_statement.rate},0),3),3,3) 


    Aravinth

    Wednesday, August 29, 2018 6:13 AM

Answers

  • Hi Arav_ind,

    In crystal report, ToText is conver to string, you could use cstr in SSRS, Truncate(xx,0) is similar to cint。

    So I think you could try to modify like below

    =cstr(cint(Fields!p_prn_annual_statement.Value))+","+mid(cstr(Fields!p_prn_annual_statement.Value-cint(Fields!p_prn_annual_statement.Value)),3,3)

    OR 

    =cstr(cint(Fields!p_prn_annual_statement.Value))+","+mid(FormatNumber(cstr(Fields!p_prn_annual_statement.Value-cint(Fields!p_prn_annual_statement.Value)),3),3,3)

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, August 29, 2018 8:42 AM
  • Again you dont require to use any expression like this in SSRS

    You can achieve the same result by setting language of textbox to one like it-IT italian and then using regional formatting for the Numeric value with 3 decimal places

    The screenshots are shown below

    No need of any custom expression for this


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by Arav_ind Thursday, August 30, 2018 6:23 AM
    Wednesday, August 29, 2018 9:25 AM

All replies

  • Hi Arav_ind,

    In crystal report, ToText is conver to string, you could use cstr in SSRS, Truncate(xx,0) is similar to cint。

    So I think you could try to modify like below

    =cstr(cint(Fields!p_prn_annual_statement.Value))+","+mid(cstr(Fields!p_prn_annual_statement.Value-cint(Fields!p_prn_annual_statement.Value)),3,3)

    OR 

    =cstr(cint(Fields!p_prn_annual_statement.Value))+","+mid(FormatNumber(cstr(Fields!p_prn_annual_statement.Value-cint(Fields!p_prn_annual_statement.Value)),3),3,3)

    Best Regards,
    Zoe Zhi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, August 29, 2018 8:42 AM
  • Again you dont require to use any expression like this in SSRS

    You can achieve the same result by setting language of textbox to one like it-IT italian and then using regional formatting for the Numeric value with 3 decimal places

    The screenshots are shown below

    No need of any custom expression for this


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Marked as answer by Arav_ind Thursday, August 30, 2018 6:23 AM
    Wednesday, August 29, 2018 9:25 AM