Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subreports
Message
De
21/04/2003 13:10:13
 
 
À
21/04/2003 12:52:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Crystal Reports
Titre:
Divers
Thread ID:
00779750
Message ID:
00779891
Vues:
13
That's what she was trying and it was not working.

>Can't you just have the main report pass the parameter to the sub reports?
>
>>Do something like this:
>>
>>
>>** get a reference to the sections collection of the main report
>>loSections = loReport.Sections
>>
>>** Go through each section in the main report...
>>FOR EACH loSection IN loSections
>>   ** Get all the objects in this section...
>>   loReportObjects = loSection.ReportObjects
>>
>>   ** Go through each object in the reportobjects for this section...
>>   FOR EACH loReportObject IN loReportObjects
>>      ** Find the object which is the SubreportObject
>>      IF loReportObject.Kind = 5 && crSubreportObject
>>         ** Found a subreport, now get a hold of it
>>         loSubReportObj = loReportObject
>>         ** Open the subreport and treat it as any other report
>>         loSubReport = loSubReportObj.OpenSubreport
>>
>>         **************************************************
>>         ** set the parameter in the sub-report here     **
>>         **************************************************
>>
>>      ENDIF
>>
>>   NEXT
>>
>>NEXT
>>
>>>Hi Dan,
>>>
>>>Thanks for the reply.
>>>
>>>I am very new to Crystal. Can you provide a bit more detail please? I am not sure what you mean by "scan through." At design time, I am setting the parameter in the Select Expert for all of the reports. At runtime, I create the variable, then pass it when I call the main report. I call the report as follows:
>>>
>>>lcCID = V_CASE.cID
>>>
>>>If ! .OpenReport('Jacket.rpt')
>>> Messagebox(.cErrorMessage,MB_ICONSTOP,'Report Error')
>>>ELSE
>>> .SetReportParameter('vp_ccase_cid', lcCID)
>>> .Preview()
>>>ENDIF
>>>
>>>Thanks,
>>>
>>>>You can scan through the report objects looking for a "sub-report" object, then set the parmeters in the sub-report just like you do in the main report.
>>>>
>>>>>Hello,
>>>>>
>>>>>I am trying to duplicate a report "jacket." When finished, the 8 1/2 X 11 report jacket, which is in landscape mode, will be tri-folded.
>>>>>
>>>>>There are three sections to the report. Each section is very different, so I have created three sub-reports -- one for each section. There is a left sub-report, a middle sub-report and a right sub-report. Each sub-report only contains data in that part of the report
>>>>>
>>>>>I have a main report and in that main report, I have shrunk every section except the Report Footer so that only the Report Footer will print.
>>>>>
>>>>>In the Report Footer, I have placed all three sub-reports -- one on top of each other.
>>>>>
>>>>>All of the reports use the same parameter field which is named: vp_ccase_cid.
>>>>>
>>>>>In the Select Expert, I have set the table field, ccases_cid to equal the parameter field, vp_ccase_cid. I have done this on all four reports - the main report, the left sub-report, the middle sub-report and the right sub-report.
>>>>>
>>>>>In design mode, I can go to the Select Expert and actually specify a ccases_cid field for each of the reports and the report prints out beautifully -- exactly like I want it!
>>>>>
>>>>>In runtime mode, the reports are not picking up the parameter, vp_ccase_cid, and a dialog appears asking for the parameter.
>>>>>
>>>>>I am not sure why this problem is occurring. I have another report (a single report with no sub-reports) where I call the parameter exactly as I have said above, and it works beautifully at runtime.
>>>>>
>>>>>Any idea where I have gone wrong on my report "jacket?"
>>>>>
>>>>>Thanks,
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform