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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking sub report to main report

Status
Not open for further replies.

ridhirao22

Programmer
Aug 27, 2010
140
US
Hi all,

Using CR2008 on oracle DB 11g.

I have a main report to report sales on a date and have a suppress logic for the report to print only for the current month when no date parameters are selected or print for the select date parameters.

Now I have to include a sub report to show available promotions on a date. How can I link to the main report and only show the promotions for the current month or selected date range?

How can I link the sub report to show only the dates main reports prints?


TIA,
RR
 
Hi RR

It appears from your post that you may just be suupressing records when there is no parameters entered, which will be extremely inefficient if you are working with a large dataset. If you are not already doing so you should be building the selection record to deal with null paramter date, eg:
(
(
HasValue({?DateParameter}) and
{table.field} = {?DateParameter}
)
or
(
Not HasValue({?DateParameter}) and
{table.field} = MonthTodate
)
)

Set up the same data selection in the sub report and pass the date parameter in the main report to the date parameter in the sub report using the "Edit" >> "Subreport links" from the main report.

Hope this helps
Pete
 
Thank you Pete for the quick response.

Yes, I forgot to mention.

In my record selection I am doing the following:

(
Not HasValue({?DateParameter}) or
{table.field} = {?dateparameter}
)

And my suppress logic is:
@suppresslogic

If Not HasValue({?DateParameter}) then true else flase

In section expert I use

IF @suppresslogic = true
Then
Current month= table.field

Got easier. Sub report need to be printed only for current month when no inputs were given and suppress when inputs are entered.

I am using suppress logic to suppress the sub report.

Thank you again.
RR
 
Hi RR

It is not clear to me whether you still need assistance or not. If you are still having problems, please explain in further detail.

Also, from your second post, it looks to me that where no date parameter has been entered, you are bring all data from the database and then simply suppressing it at the report level, whch is very inefficient. Much better to use Record Selection to limit the data set that the report needs to process.


Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top