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!

Main Report and Unlinked Subreport parameter the same

Status
Not open for further replies.

trwebster

Technical User
Jan 23, 2004
18
US
I inserted an unlinked subreport into a main report in Crystal XI. For some reason my subreport takes on the same date parameter prompts as my main report even though it is not linked.

I tried changing the name of the subreport parameters so they weren't the same, but that doesn't help.

Here's the steps I took to add the subreport:

Inserted report footer section RFa;
Insert Subreport>choose existing report (did not link reports);
Placed subreport in RFa.

When I run the report it only prompts me for the date once and it shows the names of each report like this in the parameter box: Start Date/First Date (Apps Process YTD)

I don't know if you need the select statement, so I'm including it anyways:

{cases.office} = "Le" and
{cases.close_date} in {?Begin Date} to {?End Date} and
not ({cases.disposition_status} in ["017", "020"])

And the SQL of the main report:

SELECT `cases`.`office`, `cases`.`close_date`, `cases`.`disposition_status`, `cases`.`number`, `cases`.`problem`, `cases`.`no_callback`, `cases`.`case_county`, `cases`.`case_id`, `users`.`first_name`, `users`.`last_name`
FROM {oj `ablelawo`.`cases` `cases` LEFT OUTER JOIN `ablelawo`.`users` `users` ON `cases`.`user_id`=`users`.`user_id`}
WHERE `cases`.`office`='Le' AND (`cases`.`close_date`>={d '2007-08-01'} AND `cases`.`close_date`<={d '2007-08-31'}) AND NOT (`cases`.`disposition_status`='017' OR `cases`.`disposition_status`='020')

I've had problems with unlinked subreports before, but the last time I sent my report to someone else and they fixed it. I don't know if it's something I'm doing wrong when I'm setting up the reports or when inserting the subreport or if there's a Crystal setting that isn't set right.

Any help will be most appreciated.
 
If you go to edit->subreport links, do you see any links set up? If so, remove the linking fields from the top right part of the screen.

If you go into the subreport->report->selection formula->record, what do you see? Please copy into the thread.

-LB
 
There are no links set up.

This is what I have in the subreport>report>selection formula>record:

{cases.office} = "Le" and
{cases.close_date} in {?First Date} to {?End Date} and
not ({cases.disposition_status} in ["020", "017"])
 
I just tested this and was unable to get separate prompts no matter what I tried--saving the report under another name and then importing it into the original report. Surprising.

If you want to use a different date range in the sub, you could change the sub's record selection formula based on the fact that the sub's parm will take on the same value as that of the main report, e.g., use something like:

{table.date} >= dateserial(year({?date}), month({?date})-3,1)

-LB
 
Thanks for trying. It's kind of weird that it doesn't work.

Since the begin date of the subreport is 1/1/2007 and won't change until 2008 I decided to just keep the end date parameter and hard code the begin date in the subreport.
 
If it's always the first of the year, why not use:

{table.date} >= date(year({?enddate}),1,1)

This would make it dynamic.

-LB
 
I liked that idea and used it in my YTD report, but when I inserted it as a subreport and linked using the {?enddate} the YTD subreport only pulls records for that end date. So, I went back to the YTD report and modified the date parameter to be {cases.close_date} in Date(2007,01,01) to {?Enddate} and it did the same thing.

Is it possible that a subreport cannot have a greater range than the main report?

Or, could it be that my Crystal isn't set up properly?
 
No, you can have a greater range. After linking, did you go into the subreport and change the operator from "=" to "<=" ?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top