Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Subreport Parameters Post Reply Post New Topic
Author Message
avaj
Newbie
Newbie


Joined: 26 Sep 2007
Online Status: Offline
Posts: 30
Quote avaj Replybullet Topic: Subreport Parameters
    Posted: 15 Oct 2007 at 1:38pm
CR XI - I have a main report & a subreport.  The main report has about 8 different parameter options that user can enter for data selection.  Whatever data is selected is the data I need to use for the subreport.  I did Insert the Subreport & then I right clicked the subreport & selected Change the Link.  Then I selected the first parameter field (or several) & the bottom boxes pop up with the ?PM... field.  From what I read on other posts here I should be able to remove this ?PM field so that it uses the main reports parameter instead.  I cannot remove it.  I cannot overtype it or delete it.  What am I doing wrong? 
 
1)How do I make sure the subreport is based on the data from the main report?
 
2)Can I independently test the subreport without the passed parameters?
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 15 Oct 2007 at 3:50pm
Yes, this is a common problem I see on the forum so I wrote an additional section in my new book on how to handle this (page 362).

I think the problem you are having is that you set the link to the ?PM field and are now trying to remove it. If so, you went just a bit too far. What you need to do is when you are linking to the subreport and CR is 'suggesting' that you link to the ?PM field, then click on the drop-down box and link to the subreport field directly. DON'T use the ?PM field that CR is showing in the dialog box. Just click that drop-down arrow and pick the correct field instead. When you close the dialog box, the appropriate fields will be linked and the ?PM field will never get created.

Re testing the subreport, if you double-click on the subreport in design mode and open it in it's own tab, then you can click the preview button to test it independently. I haven't done this in while and I remember something quirky happening with it that caused a problem, but I don't remember the exact circumstances. Give it a shot and let us know it it worked.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
avaj
Newbie
Newbie


Joined: 26 Sep 2007
Online Status: Offline
Posts: 30
Quote avaj Replybullet Posted: 16 Oct 2007 at 6:11am
I wonder if my version is different.... 
 
1) When I click on the drop-down box where the ?PM.. field is listed(bottom left), there is nothing else there to select.  The ?PM field is the only option.  I tried it for all the available fields listed & none of them give me anything other than the ?PM.. field that Crystal creates. 
 
2) When I double-click the subreport in design mode, there is only one preview tab & it just previews the main report
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 16 Oct 2007 at 9:18am
Interesting. When fields aren't listed in the dropdown box, that means that their data type doesn't match the data type of the field being linked to in the main report. For example, if the main report is linking with a string field, then only existing string fields will be listed from the subreport. Otherwise, the fields should be shown there.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
avaj
Newbie
Newbie


Joined: 26 Sep 2007
Online Status: Offline
Posts: 30
Quote avaj Replybullet Posted: 17 Oct 2007 at 6:29am
I was finally able to get it to do most of what I wanted it to even though mine doesn't seem to work the same way yours does with the drop down box.  I also figured out the answer to my #2 question.  So thanks so much because you sent me in the right direction of thinking.
 
What I did:
Quest #1) In Design tab, right click subreport, select change links, I selected all of the Formula fields that I used in the main report for the selection criteria.  Crystal created the corresponding Parameter fields.
 
Quest #2) In Design tab, double click subreport, select Print Preview button from toolbar (little magnifying glass), subreport will run independently & prompt for parms.  A preview tab for the subreport is created.
 
This forum is fantastic!!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.