How to use the format string passed from VB in Crystal Report?
Hi All,
I am working on VB 6.0 with Crystal Report 7.0.
I'm passing data from VB to crystal report for generating reports.
I have numeric field in crystal report. For seting the No. of decimals for that field, I am passing the format string like "1.00" or "1.000" from VB. But, I don't know how to format that field in crystal report using the format string received from VB.
Can any one please help me on this?
Thanks in Advance,
Soundar
Re: How to use the format string passed from VB in Crystal Report?
We are working on VB 6.0 and using crystal report 7 as reporting tool.
In report, some clients are asking 3 decimal places(Eg. 2000.500) while other clients are asking 2 decimal places(Eg. 2000.50).
I want to pass the amount of decimal places for numeric fields to crystal report from VB.
How should I implement this using VB.
This is an urgent requirement.
Pls any one can help me ASAP?
Thanks in Advance,
Soundar
Re: How to use the format string passed from VB in Crystal Report?
Welcome Soundar
I haven't seen cr7 as I use CR9. But I believe it should be same.
Try right clicking the field in the report you should see Format field click it, there should be Number tab. click it, now you should see a button Cutomize click it. There are lots of options for decimals, rounding etc. choose the ones you want.
Quote:
some clients are asking 3 decimal places(Eg. 2000.500) while other clients are asking 2 decimal places(Eg. 2000.50).
who is going to decide the no. of decimals you or clients. If it is you simply follow the above steps else you may have more work to do.
Hope I could help you soundar.
How did you celebrate Pongal. Did you also take part in Jallikattu?
Re: How to use the format string passed from VB in Crystal Report?
Quote:
Originally Posted by VBFnewcomer
Welcome Soundar
I haven't seen cr7 as I use CR9. But I believe it should be same.
Try right clicking the field in the report you should see Format field click it, there should be Number tab. click it, now you should see a button Cutomize click it. There are lots of options for decimals, rounding etc. choose the ones you want.
who is going to decide the no. of decimals you or clients. If it is you simply follow the above steps else you may have more work to do.
Hope I could help you soundar.
How did you celebrate Pongal. Did you also take part in Jallikattu?
Hi Guys,
Thank you for your valuable support. I got the solution for this.
What I did is, I'm passing the number of decimals(2,3,4 ect., for formatting like 1000.00,1000.000,1000.0000 ect.,) as a formula(For Eg. Formula Name NoOfDecimals) to the crystal report.
In crystal report, I selected the "[numeric] Report field -->Format Field --> Number"
And then I entered Val({@NumberOfDecimals}) in Decimals And Rounding Options' Formula Editor.
Now it is working fine in both crystal report 7 as well as Crystal Report XI
Regards,
Soundar
Re: How to use the format string passed from VB in Crystal Report?
Glad to show you the way. But what about
Quote:
some clients are asking 3 decimal places(Eg. 2000.500) while other clients are asking 2 decimal places(Eg. 2000.50).
and
Quote:
who is going to decide the no. of decimals you or clients.