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 subr
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 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
Perform following easy steps:
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.
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;
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