Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula field as subreport link Post Reply Post New Topic
Page  of 2 Next >>
Author Message
timsoundy
Newbie
Newbie


Joined: 21 Jan 2009
Online Status: Offline
Posts: 4
Quote timsoundy Replybullet Topic: Formula field as subreport link
     Posted: 21 Jan 2009 at 9:24am

I've successfully got subreports functioning with a parameter field acting as the link (a business service name value entered by the user at runtime). However, I need to automate the report so the link runs from a formula field rather than a parameter field. I've changed the link in the 'Change subreport links' dialogue box and i've altered the subreport to run off the formula field.

When previewing the subreport only this works fine. However, when I preview the main/parent report the subreport appears blank. Double clicking on the blank subreport previews it in a new pane and the data is shown as expected again. Resetting the subreport link back to the parameter field results in the data showing as expected.
 
I'm using exactly the same data value for the parameter and formula field so why the different results? Is this a bug in Crystal??
 
Any assistance would be very gratefully received.
 
thanks, Tim
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2009 at 10:39am
I thought it would handle a formula before it tries to pass info to a subreport so this seems a little odd.
What is the formula you are using?
IP IP Logged
timsoundy
Newbie
Newbie


Joined: 21 Jan 2009
Online Status: Offline
Posts: 4
Quote timsoundy Replybullet Posted: 21 Jan 2009 at 10:48am
At present the formula is just a text string ("service1") so there should be no complications because of that...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Jan 2009 at 10:51am
Go into your sub report and verify your select statements are all good.
I have had problems with it leaving incorrect data in there when using teh Change sub Report Links menus.
Do those still look good based on your new parameters and links?
IP IP Logged
timsoundy
Newbie
Newbie


Joined: 21 Jan 2009
Online Status: Offline
Posts: 4
Quote timsoundy Replybullet Posted: 22 Jan 2009 at 2:14am
Yes I verified the select statements in the subreport were updated to reflect the new field name.
 
When dragging and dropping the new field into the subreport (to display the value passed from the parent report) it is presented entirely as expected...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 22 Jan 2009 at 10:18am
I would try testing a few variations.
Is your ultimate goal to have a dynamic formula field in the main report that is used to link or are you sticking with a static string as you have now?
If just using the static string I would try removing it as the Subreport link, not linking on any field or a different one if it is appropriate and then and just add it to the select statement in the subreport, Field="string", to see if that runs correctly and does what you want.
If you are going to make this a dynamic string I would go ahead and set it up to see how it is impacting at run time.
IP IP Logged
timsoundy
Newbie
Newbie


Joined: 21 Jan 2009
Online Status: Offline
Posts: 4
Quote timsoundy Replybullet Posted: 26 Jan 2009 at 8:26am
Will try this - thanks a lot for your help dblank.
IP IP Logged
Kman
Newbie
Newbie


Joined: 09 Jul 2010
Online Status: Offline
Posts: 3
Quote Kman Replybullet Posted: 09 Jul 2010 at 1:44am
I'm having the same issue. Have anyone figured this one out?

In my main report I have a formula field {@FromDate} with the following formula:

IIF (Len({@NumberOfMonth}) = 2,ToText({@NumberOfYear} & "-" & {@NumberOfMonth} & "-01"),ToText({@NumberOfYear} & "-0" & {@NumberOfMonth} & "-01") );

Which should give me a string which like this : 2010-05-01 (depending on the year/month variable).

This should be passed on as an parameter to a subreport.

I've set the SubreportLinks (and tried them with all possible settings), but I can't the subreport to show while running the main report.

If running the subreport only with manual setting of the parameter, everything works fine.

If I doubleclick the subreport in the mainreport (though it's blank) the subreports shows with success.

Changing the subreport to not using the parameter in it's data selection, the result is just the same.

The subreport has a border and this is not showing either

If I just remove the SubReport Link then everything is ok. Put it back on, and both the content and the border are blank (and now the parameter is only passed to the subreport, ..not being in use).

Going CRAAAZY over this!!
IP IP Logged
Kman
Newbie
Newbie


Joined: 09 Jul 2010
Online Status: Offline
Posts: 3
Quote Kman Replybullet Posted: 09 Jul 2010 at 2:29am
I've now set both parameter and formula field as Date, but still the sub-report is "blank" in the main report.

Again, double-clicking the "empty" report opens the subreport and the values shown are a direct result of the parameters.

In the main report:


Double click and it opens the sub report with the value:

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jul 2010 at 3:50am

If yo run both in report footer rather than page footer do you get the same results?

IP IP Logged
Page  of 2 Next >>
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