I have a main Crystal report which consists of several sub-reports, I managed to link the parameter from main report to sub-report by following this simple steps:
create a parameter ParamOP in main report
insert a sub-report in the main report
right click on sub-report > Change sub report links
select the parameter ParamOP from the "Available fields" window and add to "Fields to link to"
you will notice it will be automatically populated in the "Subreport parameter fields to use" link it to the sub-report field, then click OK
Now, since my sub-report has a command field, how can I display the record in sub-report using the parameter?
Here's my SQL query inside the command, however no data was displayed.
SELECT *
FROM CONFORMEREPORTS
WHERE COVERAGEHEADER = '{Pm-?paramOP}'
ORDER BY [LINENO] ASC
Related
How can we pass a parameter from the main report to a subreport in Crystal Reports XI? I have a parameter in the main report. Now, I want to pass the same parameter to subreports. Please help me.
Right-click on the subreport object and choose Change SubReport Links, then select how the parameter is to be used by the subreport.
Using CodebyMoonlight's solution requires a relation between main report and subreport.
If there is no relation between both of them, you can use Shared Variables to pass values between both of them, as shared variable can be set and displayed anywhere in main report or sub report.
Shared NumberVar x := 5;
Perform following easy steps:
Create New Parameter lets say "StartDate" in Parameter Fields in Field Explorer in Crystal Report
Create New Parameter lets say "StartDateSubReport" in Parameter Fields in Field Explorer in your Subreport
Now in Main report file, Right Click Subreport lets say "EmployeesList.rpt" and click Change Subreport Links menu
Select "StartDate" from Available Fields from Available Fields Tab and click on ">" button to make it vailable to link in subreport
Now bind your "StartDate" which you have made available by selecting it with "StartDateSubReport" in dropdown available in "Subreport Parameter Field to use"
parameter sharing between main report and sub report "Right-click on the subreport object and choose Change SubReport Links, then select how the parameter is to be used by the subreport." works for me
I had the same problem. The main report loaded first and then the subreport. You have to load the subreport before you can use the variable.
I think that using
Right Click and Sub-report Links
or
Shared Var Between Report and Sub-report
Both using Selection formula so it is suitable for limited data only
Selection formula working after loading all records from Database table ... report loading bad performance
so i'm tring to limit rows by passing some parameter from C#/VB and send others from main to sub report
For example if you need the transaction of items in period and you can pass the period parameter from application (c# ..) and using Sub-report Links to send itemID
https://kb.blackbaud.com/articles/Article/52328
Create a parameter field in the main report.
From the main report, right click on the subreport, and select Change Subreport Links.
In the subreport linking window, select the parameter field from the window labeled "Available Fields", and click on the ">" button to move it to the window on the right labeled "Fields to link to"
Below, make sure you have a check next to Select data in subreport based on field.
Below the checkbox, if it is not already there, select the field from the subreport, to which you would like the parameter field linked.
Click OK
I have a main report in Crystal Reports XI that I am using which has fields ProjectNumber, DateOfEvent1, DateOfEvent2, ProjectCategory.
I would like to either have an additional detail field OR hyperlink one of the existing fields so that on click it will open a new table with other records specific to that row's ProjectNumber.
I've used a parameter field with a subreport but cannot get it to dynamically create reports specific to the clicked row. I can only create full reports with all the fields (i.e. for ALL ProjectNumber).
"Hyperlink to another report object" for an existing field seems like an option, but I can comprehend how that is supposed to work.
Any help would be greatly appreciated.
Add an "on demand" subreport:
insert a subreport; check "on demand subreport"; click "Report Wizard":
click "Link" tab; link main report to subreport:
place subreport in desired location; right click and format report; choose "subreport" tab:
add a formula for both captions
I need to "merge" 3 big reports.
Is it possible to just create a drop down menu that lets the user select which report to view?
Then just put all 3 reports into one as sub-reports?
Thanks
You could:
create a dummy main report
embed each of the 3 reports as a sub-report
create a pick-list parameter that allows a person to select one of the reports to be shown
suppress sub-reports that aren't in the parameter's chosen value
** edit **
In addition, create the necessary parameter fields in the main report, then link them to the corresponding parameter fields in each sub-report. This will eliminate the report from prompting repeated for each parameter.
It should be very simple and should employ multi-value parameters , but not able to figure out how ? This report takes parameters from the GridView I have a gridview in an asp.net web page which has print button for every row to print this report for that row.
Now, there are as many reports as there are rows in the grid.---[This part is done]
So,how about combining all these reports into one single report
You can add a subreport for each one of you reports.
You just create a new report and start inserting subreports in each row.
Check this documentation:
http://msdn.microsoft.com/en-us/library/dd220581.aspx
Here's an example for you:
1 - Create a new report. You can then add a tablix to it, in case you have more info, which is the case in my example. Just don't forget to add a dataset to that tablix if that's your case.
This is how it would look
Each gray line is a subreport.
2 - To insert a subreport just right-click a cell and go to Insert > Subreport
3 - Right-click your subreport, select Subreport Properties and choose your report from the drop-down menu:
4 - You can then set the parameters your subreport will receive:
Case 2: if you don't need a tablix for aditional info, just repeat the same process in a Rectangle.
UPDATE
As I said in my comment, here's one report in which I do exactly what you want:
As you can see the subreports are part of the main report's body that has other data.
I need to repeat these subreports for each record and that's how it is done.
Here you can see the Id being passed as parameter to my subreport:
From what I understood, that's what you want. That way for each record its current Id would be passed to the report. Generating a report with that "dynamic" parameter you mentioned.
I have a report for orders and I'd like to add an additional page at the end that states the orders' Terms & Conditions. Can someone help me?
In your report footer, set it to create a new page before it is printed (In 'Section Expert', select the Report Footer -> 'Paging' tab -> Check 'New Page Before' checkbox). Throw your Terms & Conditions into the Report Footer section.
If you already have a Report Footer that you want to keep, just split the footer into two sections (Right-click the Report Footer section -> 'Insert Section Below') and follow the same procedure for the newly created section.
If you want a complete new page to the end of your Crystal report just make 2 subreports inserted into one main report with Details a and b.
To do that:
Make the two subreports and save them;
Make a new main report and insert another Details section(Report->Section expert..., select Details - >Insert)
Onto Details a insert 1st subreport
Onto Details b insert 2nd subreport
Right click on 1st subreport -> Change Subreport links: select each Report fields and transfer them on the right side(Fields to
link to), click on the right side on each parameter (named like
?#Parameter1) and select the coresponding parameter.
Repeat the previous step for the 2nd subreport
Report->Section expert..., click on the Details b and check New page before.
That would be all.