How can we pass a parameter from main report to subreport in crystal reports XI

前端 未结 7 1676
我寻月下人不归
我寻月下人不归 2020-12-03 07:00

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

相关标签:
7条回答
  • 2020-12-03 07:13

    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

    0 讨论(0)
  • 2020-12-03 07:15

    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

    0 讨论(0)
  • 2020-12-03 07:19

    Perform following easy steps:

    1. Create New Parameter lets say "StartDate" in Parameter Fields in Field Explorer in Crystal Report
    2. Create New Parameter lets say "StartDateSubReport" in Parameter Fields in Field Explorer in your Subreport
    3. Now in Main report file, Right Click Subreport lets say "EmployeesList.rpt" and click Change Subreport Links menu
    4. Select "StartDate" from Available Fields from Available Fields Tab and click on ">" button to make it vailable to link in subreport
    5. Now bind your "StartDate" which you have made available by selecting it with "StartDateSubReport" in dropdown available in "Subreport Parameter Field to use"
    0 讨论(0)
  • 2020-12-03 07:19

    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.

    0 讨论(0)
  • 2020-12-03 07:28

    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;
    
    0 讨论(0)
  • 2020-12-03 07:30

    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

    0 讨论(0)
提交回复
热议问题