Crystal Report with 4 linked subreports not working

I have created 4 reports that return the required data. I am using version 8.5 because of older front end Crystal Enterprise 8.5 necessities.  All reports have parameters START DATE and END DATE that query dates in various date fields of SQL tables.  I have imported all reports into one and created links.  When I go to Design for the main report the Execute/Refresh icon is grayed out.  I notice that in the subreports there are ?START DATE and ?END DATE as well as Pm-?START DATE and Pm-?END DATE.  Does one of those sets need to be removed?

TIA,

Tim
gibneytAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
The ?pm parameters were added when you linked the subreports.

You probably want to change them and link directly to the subreport parameters from the main report.

Does the main report have a data source?  Does the main report have any parameters?

My though would be to use one of the subreports as the main report then link the other 3 in to it.

mlmcc
0
frankhelkCommented:
Do you call the report from a (.NET ?) program, or do you run it standalone in CR ?

If you call it in a program, you'll have to set the data source separately for each subreport. The most simple way to do that - if the main report uses the same data source as the subreports - is
ReportDocument objRpt;
objRpt.SetDataSource(your_dataset);
crystalReportViewer1.ReportSource = objRpt;
if (objRpt.Subreports.Count > 0)
{
    foreach (ReportDocument objSubRep in objRpt.Subreports)
    {
        objSubRep.SetDataSource(your_dataset);
    }
}

Open in new window

(this example is free written as guideline, it may not be syntactic perfect ...).

It might look weird on the first glance that subreports doesn't share the parent report's data source by default, but that behaviour offers extremely flexible ways of reporting.
0
mlmccCommented:
That method won't work with CR8.5.  The methods were changed in CR9.

mlmcc
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

gibneytAuthor Commented:
OK, I will make a copy of one of the reports and use it to import the other reports into minus the original as it will already be in there.  Is there an order of precedence?  Am I putting the imported reports into the Details or Footer section?
0
mlmccCommented:
I believe the subreports should go into the report header or the report footer depending on the order you want them.

I would use the report you want first as the main report then add the other 3 to the report footer.
You will need to create a report footer for each subreport
Right click the report footer in the left margin
Click INSERT SECTION BELOW
Repeat 2 more times so you have RF1A, RF1B, and RF1C
Put 1 subreport in each section

mlmcc
0
gibneytAuthor Commented:
I am down to two reports to add so added two report footers and imported the reports and placed in their respective footers.  At the Start Date and End Date prompts I have 3 sets of prompts to complete and when I do the reports come up empty.  Do I need to rework the Start Date and End Date parameters in the two subreports?  Do I get rid of their original Start Date and End Date and keep the Pm-* new parameters?

Tim
0
mlmccCommented:
In the subreports keep the parameters that were created with the report

In the main report choose the StartDate parameter for the link
In the subreport choose the StartDate parameter not the one that starts pm

Make all prompts for a STARTDATE are identical.  Same for the ENDDATE parameters

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gibneytAuthor Commented:
Yes, that works perfectly.  Thanks again.

Now the report headers don't play well.  The main report header is at the top of the page and every page thereafter and the subreport headers only print once at the top of their first page.  I would like a generic header on the first page and headers on each page that are specific to the current report displayed.  Should I open a new question for this latest hurtle and mark this one answered?

Tim
0
mlmccCommented:
That would be the way to go.

mlmcc
0
gibneytAuthor Commented:
mlmcc,

Thanks again for the little nuggets.  Works to spec!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.