on 06-03-2011 11:46 AM
how to pass all values to subreport in crystal reports. I have a parameter which has default value 'All', I want to pass to sub report. How to pass it?
I am passing through sub report link , I am getting zero value instead of showing all values in the report.
thanks
Hi Ian,
Your suggestion is working for 1 parameter;
I am passing two parameters {?p} and {?pl1} from main report to subreport. I have created two parameters {?p} and {?pl1} in sub report and I have written the below in record selection of sub report and linked two parameters of sub report to parameters of main report in sub report links in main report.
IF {?p}= 'ALL' AND {?pl1}='ALL' THEN
{pole_.polename} LIKE '' AND {pole_.pl1} LIKE ''
ELSE IF {?p}='ALL' AND COUNT({?pl1})=1 THEN
{pole_.polename} LIKE '*' AND {pole_.pl1}={?pl1}
ELSE IF COUNT({pole_.polename})=1 AND {?pl1}='ALL' THEN
{pole_.polename}={?p} AND {pole_.pl1} LIKE '*'
ELSE IF COUNT({pole_.polename})=1 AND COUNT({?pl1})=1 THEN
{pole_.polename}={?p} AND {pole_.pl1}={?pl1} ELSE
FALSE
I am getting this error: COUNT({?pl1}) : field can not be summarized
My requirement is to pass three parameters from main report to sub report. Parameters will have 'ALL' values or single value selection.
I am trying for 2 parameters, later I will work for 3 parameters.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If Parameter can only have value 'All' or another single value this should work
IF {?p}= 'ALL' AND {?pl1}='ALL' THEN
{pole_.polename} LIKE '' AND {pole_.pl1} LIKE ''
ELSE IF {?p}='ALL' AND {?pl1} <> 'ALL' THEN
{pole_.polename} LIKE '*' AND {pole_.pl1}={?pl1}
ELSE IF COUNT({pole_.polename})=1 AND {?pl1}='ALL' THEN
{pole_.polename}={?p} AND {pole_.pl1} LIKE '*'
ELSE IF COUNT({pole_.polename})=1 AND {?pl1} <> 'ALL' THEN
{pole_.polename}={?p} AND {pole_.pl1}={?pl1} ELSE
FALSE
Ian
Right Click on SubReport And Select "Change SubReport Links..."
1) Select all fields that you want to display in subreport and move from "Available Fieles" to "Fild(s) to link to:".
2) If you want to display all fields without any criteria, than do not assign any relationship between subreport and main report.
3) Click OK.
4) Open SubReport and you will find that field(s) under Parameter Fileds starting with "Pm-"
5) Put that field in Detail Section of your subreport.
Run Report......
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am passing 'ALL' parameter i.e. null value from main report to sub report.
But as you said what tshould be in record select of sub report?
please clarify.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not sure what you are trying to do?
You could try creating a parameter in Subreport which has same function as main report wilth an All option, and then use that in the SR record selection.
You can then link the Main report Param to the SR param
In SR links dialog box, drag main param into linking window, then in lower left hand drop down list, scroll down to find SR param and link them together.
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.