on 11-03-2015 9:04 AM
Hi
Im trying to pass a parameter to a subreport however it hasnt got a field to link directly link to
I thought about creating a StringVar for it as -
whileprintingrecords;
stringvar SortBy;
SortBy := {?SortBy};
However as the value could contain multiple values Im getting an error -
This array must be subscripted. For example: Array [i].
Any ideas how to get round my problem ?
Hi Allan,
You can create a comma delimited string and pass this to the Subreport as a parameter:
stringvar SortBy;
SortBy := Join({?SortBy},',');
What do you wish to do with this unlinked field though?
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
It passes -
RESORT
PACKAGE
GRADE
PROMOTION
VACATION DATE
SEASON CODE
BOOKING SOURCE
which is then used in a formula that is used for grouping.
So if I use your above code as a formula in the main report and create a corresponding formula in the sub report -
WhilePrintingRecords;
stringvar SortBy;
what is the best way to set up the subreport links ?
Hi
I havent written this report so Im not completely sure what its doing.
The formula that is using it is being used as a group -
[@GroupByParameters]
stringvar sortString;
sortString:='';
if {@SuppressGraphic}=true
then
(
numbervar counter:=1;
numbervar positionCount:=count({?SortBy});
stringvar ShipCode=' ';
stringvar Package=' ';
stringvar Grade=' ';
stringvar VacationDate=' ';
stringvar SeasonCode=' ';
stringvar Promotion=' ';
stringvar BookingSource=' ';
if not isNull({Vx_Command.SHIP_CODE})
then ShipCode:={Vx_Command.SHIP_CODE};
if not isNull({Vx_Command.GROUP_BY_PACKAGE})
then Package:=ToText({Vx_Command.GROUP_BY_PACKAGE},0,'');
if not isNull({Vx_Command.GROUP_BY_CABIN_CAT})
then Grade:={Vx_Command.GROUP_BY_CABIN_CAT};
if not isNull({Vx_Command.SAIL_DATE_FROM})
then VacationDate:=ToText({Vx_Command.SAIL_DATE_FROM},'ddMMyyyy');
if not isNull({Vx_Command.SEASON_CODE})
then SeasonCode:={Vx_Command.SEASON_CODE};
if not isNull({Vx_Command.IS_PROMO})
then Promotion:={Vx_Command.IS_PROMO};
if not isNull({Vx_Command.SOURCE_CODE})
then BookingSource:={Vx_Command.SOURCE_CODE};
while positionCount >= counter do
(
if trim({?SortBy}[counter])='RESORT' then sortString:=sortString + '_' + ShipCode;
if trim({?SortBy}[counter])='PACKAGE' then sortString:=sortString + '_' + Package;
if trim({?SortBy}[counter])='GRADE' then sortString:=sortString + '_' + Grade;
if trim({?SortBy}[counter])='VACATION DATE' then sortString:=sortString + '_' + VacationDate;
if trim({?SortBy}[counter])='SEASON CODE' then sortString:=sortString + '_' + SeasonCode;
if trim({?SortBy}[counter])='PROMOTION' then sortString:=sortString + '_' + Promotion;
if trim({?SortBy}[counter])='BOOKING SOURCE' then sortString:=sortString + '_' + BookingSource;
counter:=counter +1;
);
sortString;
)
else sortString:='A';
sortString;
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.