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.