Applying Format using Style for Textbox

Posted by: tejas.mer on 13 November 2018, 5:27 pm EST

    • Post Options:
    • Link

    Posted 13 November 2018, 5:27 pm EST

    Hi All Members,

    In Active Reports for text box we have an option to apply the numeric format using the “Format” property.

    Where we can give “f”, “f2”, “f3” etc for decimal places.

    I would like to set the “Format” property using the Active Report Styles.

    Courier New 8pt Normal 700 [b] "f2"[/b] Left HEADER Solid

    Will above style work ?

  • Posted 13 November 2018, 8:29 pm EST

    Hello,

    Please use the following syntax to use the format property to use in style

    <Format>f2</Format>
    

    Hope it helps.

    Thanks,

  • Posted 13 November 2018, 9:07 pm EST

    Hi Mohit,

    Nope this didn’t work.

  • Posted 13 November 2018, 10:11 pm EST

    HEllo,

    It is working at my end. Please refer to the attached file. Please let me know If I am missing something?

    Thanks,

    Untitled.zip

  • Posted 13 November 2018, 10:38 pm EST

    Hi Mohit,

    It is not working in your case as well. :slight_smile:

    We have downloaded your sample report and style sheet.

    When we have loaded your report in the report viewer and we have found in the property window of the text box that format was set already set as “f2” !! Then we have removed that format by setting it to general kept the format as “” in the property window in the designer.

    Because format needs to be applied through style.We have also make sure style path is correct in the report.

    Try it your end, Let us know if we are doing something wrong.

  • Posted 13 November 2018, 11:43 pm EST

    Hello,

    Please use the following steps:

    1: Create a new rdl report

    2: Add the stylesheet(Attached in the previous reply) in the report

    3: Drag and Drop the TextBox

    4: Select “Testt” in the “Style” property of the “TextBox”

    You can observe that Format property is changed to “F2”.

    If the result is different at your end, could you please tell the exact version of the AR that you are using?

    Thanks,

  • Posted 14 November 2018, 6:04 pm EST

    Hi Mohit,

    Your observation is correct if you drag and drop the textbox and set the style to “Testt” it will automatically change the format to “F2” in the property on the designer but did you also preview it?

    In mycase in preview it doesn’t apply.

    I did additional thing to stylesheet to work we have to give expression like

    =ToDouble(24.12345) and then in the preview it is working.

    if we give value to text box like =24 then in preview it does not work.

  • Posted 14 November 2018, 6:25 pm EST

    Hello,

    Please refer to the attached video. I am not able to replicate the issue at my end at preview time also.

    Am I missing something? Also, Could you please share the exact version of AR that you are using?

    Thanks

    vid_Format.zip

  • Posted 14 November 2018, 7:05 pm EST

    Hi Mohit,

    Thanks for sharing the video.

    Please find the attached zip files. In report I have two text boxes.

    1. First text box has 11.154
    2. Second text box has =ToDouble(24.1234)

      In style sheet has format f2.

    Now please verify and let us know.

  • Posted 14 November 2018, 7:05 pm EST

  • Posted 14 November 2018, 7:17 pm EST

    Hello,

    Please use “=11.154” instead of “11.154” as a value. Report engine considers “11.154” as a text that’s why format property does not apply to it.

    Hope it clarifies.

    Thanks,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels