Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: subreports, procedures, links Post Reply Post New Topic
Author Message
computermike
Newbie
Newbie


Joined: 02 Sep 2008
Location: United States
Online Status: Offline
Posts: 14
Quote computermike Replybullet Topic: subreports, procedures, links
    Posted: 02 Sep 2008 at 1:23pm
My goal is to have a Main report that excepts three parameters.  One is a dynamic parameter tied to a table in my database, it can except multiple values.  It passes these parameters to subreports. 
 
My main report's only datasource is used to fill a dynamic parameter list of values.  it fills the dropdown for the end user to select from.  Here is the command datasource
 
select distinct Diversion_Program_Name from DIVERSION_PROGRAM order by 1
 
Because one of my parameters allows multiple values.  I use the following formula to turn parameter array into CSV list.  For example if user picks "A" and "B" and "C", i want "A,B,C" returned.  This will be used in SQL statement, in where clause.
 
formula NameList =
..............................................................................
Local StringVar PDNString := "";
   Local NumberVar i;
   For i := 1 To Ubound({?DivName}) Do
   (
      if i= 1 then PDNString := PDNString +  {?DivName}
        else PDNString := PDNString + ", " + {?DivName}
   );
   PDNString
....................................................................
 
My subreport, that uses a store procedures (expects same 3 parameters, but example only includes 1) it should get parameters from the Main report. 
 
example:NameList linked to @Diversion_Program_Name
 
datasource procedure something like
.......................................................
CREATE PROCEDURE ProgramReport
(@Diversion_Program_Name varchar(500))
AS
select * from ProgramTable
where Diversion_Program_Name in (@Diversion_Program_Name)
 
 
Intead of linking Parameter to parameter, I would like to link to my formula to parameter.
 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
I have tried linking parameters but subreport will not appear.  I have tried sending parameter to shared variable, I can pass values in shared variables between main report and subreport, but subreport does not appear.  Or parameter can not be linked to formula.
 
Anyone with any suggestions would be appreciated.
 
Just trying to link parameters, one being CSV list.
 
 
 
 
 
 
 
 
 
 
 
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 02 Sep 2008 at 1:51pm
First off, re your formula, you can use the Join() function to convert an array into a CSV list.
 
Re using the stored procedure with parameters, that gets tricky. You have to link CR parameters to the stored procedure b/c this happens at the data acquisition level prior to any formulas being generated. Thus, you can't link a formula to a stored proecedure b/c the formula's value is null.
 
You also say that you linked parameters but still get no data, we would need more info to look into that further.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.