Print Page | Close Window

accessing records from database in select case

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=11196
Printed Date: 02 May 2024 at 12:22am


Topic: accessing records from database in select case
Posted By: kathuriap
Subject: accessing records from database in select case
Date Posted: 24 Sep 2010 at 1:19am
Hi , I am stuck with this issue in my reports. I would be very grateful if someone could suggest me where am doing it wrong .
I have a cross tab object in my report where I have multiple rows for Currency and Date and and Amount as the column. There are summarized field for the amount fields.

So its something like this-
                                               Amount                 Total

BHD       22/07/2009              12345.65                12345.65
             23/07/2009               6444.55                  6444.55
JPY       18/08/2010                145212.66             145212.66
              20/08/2010                2212545.55           2212545.55
AUD       18/08/2010                145212.66             145212.66
              20/08/2010                2212545.55           2212545.55
and so on...
Now I want to display these currency amounts with their own precision ie. 3 decimal places for BHD, 0 for JPy and 2 for AUD etc. I tried to use conditional formatting in display string function. In the display string I used select case like this-

select gridrowcolumn("currencycode")
case {IFX_CCY.ISO_CODE}  : cstr(currentfieldvalue,{IFX_CCY.DP});
default : cstr(currentfieldvalue);

But this isnt working.for the first record it always goes to case clause and then too not showing the correct decimal places and rest of the cases, it goes to default.
Please note am using Crystal reports in eclipse. 

Thanks a lot.



Print Page | Close Window