Joined: 06 Jun 2011
Location: United States
Online Status: Offline
Posts: 2
Topic: specify different set of code to run via parameter Posted: 06 Jun 2011 at 5:12pm
Hi, I'd like to do something like this in Crystal Reports in my command object:
declare RecDisplay INT:= {?RecordDisplay};
IF RecDisplay= 1 THEN ..code to run rpt with columns having aggregrates ELSE ..code to run rpt with columns (very same columns) without aggregates END IF
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 07 Jun 2011 at 3:19am
I am going to say yes.
Potentially it is a lot work, but I don't see why you couldn't accomplish the task. I am guessing that running totals and/or shared variables will become close friends.
Joined: 06 Jun 2011
Location: United States
Online Status: Offline
Posts: 2
Posted: 07 Jun 2011 at 5:30pm
ok, here's what worked: I used two SELECTS in the
one command object, one with the GROUP BY and
one without, and did the parameter differently in the WHERE for each,
so that only one of the SELECT's actually produces any rows. For the
SELECT with the GROUP BY, I added {?RecordDisplay} = 1 to the WHERE. For
the other SELECT, I added {?RecordDisplay} <> 1 to the WHERE. I
used UNION between the two SELECTs and rows returned for whichever
SELECT's WHERE clause happened to meet the criteria for the parameter
input.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum