Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports XI- Sub report Display on Conditionally

Status
Not open for further replies.

karnd

Programmer
Feb 1, 2003
190
US
Hi,

I have the following task-

I have the DeptName field in the Main Report but my task here is "Detail line item in Main report that summarizes the data found in the Sub report".

ie. Sub Report Summarised data has to be displayed in the Main Report.

And also,on the Main Report the users has to view the link for the DeptName ="Accounting" but all along with the other DeptName.

Could you please provide me some tips.

Thanks for your kind help.
Regards,





and it has grouped by and displaying under the Group Header in the Main Report. And i have created a SubReport but my task is that the Sub Report has to be displayed only when it falls under the following condition (i.e. DeptName ="Accounting") but all other DeptNames has to be displayed in the main report after i run the Main Report
 
I'm not sure what you're asking. A subreport can be put in a section that will print conditionally, depending on some record value. You could have two similar but distinct subreports in different detail section, one or other suppressed dendinging on DeptName ="Accounting".

Alternatively, a value may be passed back for use in the main report, though only the next section. This is done using Shared Variables.

For a date, put a formula field in the subreport like
Code:
Shared dateVar 
V_Today := {LoadStatus.LastDLoad}
To access it in the main report, create another formula field with
Code:
Shared dateVar 
V_Today := V_Today
If it was a currency value, you'd do it differently, e.g.
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved:={#TotSaved};
SumSaved
And to access it in the main report, create another formula field with
Code:
whileprintingrecords;
shared currencyvar SumSaved;
SumSaved
Note that the shared variable is only available in the section after the section which contains the subreport.


[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi Williams,

Appreciates of your help but let me put you my question once again.

The scenario is-

DeptName field in the main report has grouped by sothat it displays all the grouped records in the main report but one of the record which is DeptName="Accouting" has to be linked to the subreport(i.e.Accounting Subreport) which has its own details(in the subreport) so the report has to be displayed in such a way that it is a link(only DeptName="Accounting" record) in the main report along with all other DeptName records.

Note:the Sub report summarisation footer values has to be bring on the main report along with the DeptName="Accouting" record.
I am not using of Sections in this report. If your solution works for my aspect please reply back.

Please let me know if it is not clear.

Thanks for your kind help.
Regards,
 
You can't write Crystal without sections. Look at the left-hand margin; it says RF, PF, D etc.

Right-click and you get given the option [Insert Section Below]. This can be done for all types of section, and is the main method for getting Crystal to produce a complex report.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi Williams,

Thanks for your kind infor. Basically i am new to the Crystal so i might not aware of it but thanks for the update.

Could you please tell me in that case should i go with your solution with my aspect.

Regards,
 
In Crystal, you need to experiment and see what works.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top