Page 1 of 1

Custom number format from report variable

Posted: Fri Aug 10, 2018 3:49 pm
by mrapi
Hi,in .NET version I could control the number format setting it to Custom and Format Mask= {myVariableFormat} then from the code I could set report variable myVariableFormat to desired values like #0.0000 or #0.00...

Code: Select all

     Dim wRp As New StiReport 
        wRp("myVariableFormat") = "#0.00" 
        ...
the same I've tried in Js version
....

Code: Select all

   report.loadFile('reports/myreport.mrt');
   report.dictionary.variables.getByName("myVariableFormat").valueObject = "#0.00";
but in preview instead of formated value I see the text: {myVariableFormat}
any clue?
thanks

Re: Custom number format from report variable

Posted: Mon Aug 13, 2018 1:08 pm
by Lech Kulikowski
Hello,

Please send us your report for analysis.

Thank you.

Re: Custom number format from report variable

Posted: Mon Aug 13, 2018 3:20 pm
by mrapi
Hi.
I've attached a sample report

Re: Custom number format from report variable

Posted: Wed Aug 15, 2018 9:11 pm
by Lech Kulikowski
Hello,

Unfortunately, in the JS version, it is not possible to use the variable as the custom format.

Thank you.

Re: Custom number format from report variable

Posted: Thu Aug 16, 2018 6:49 am
by mrapi
Hi.it is possible to set the format from the code outside the report?
some like this:
report.GetComponent...Format=...
thanks

Re: Custom number format from report variable

Posted: Thu Aug 16, 2018 9:47 pm
by Lech Kulikowski
Hello,

You can use the following code:

Code: Select all

var txt = report.getComponentByName('Text1');
txt.textFormat = new Stimulsoft.Report.Components.TextFormats.StiCustomFormatService("#.00");
Thank you.

Re: Custom number format from report variable

Posted: Fri Aug 17, 2018 5:53 am
by mrapi
it works.thanks

Re: Custom number format from report variable

Posted: Fri Aug 17, 2018 6:38 am
by Lech Kulikowski
Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.