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

Can I hide the link to a subreport

Status
Not open for further replies.

chiarak

Programmer
Nov 26, 2001
23
0
0
AU
Hi,

I have an initial report that lists dates, amounts,dealtypes and dealIds. In the case of certain dealtypes I need to be able to click on them and pass their dealId through as a parameter to a subreport.
Currently I am using an on-demand subreport linked on dealId. If I click on the subreport link it opens it with the appropiate dealId.
The problem is that I only want the link to the subreport to appear for certain dealTypes. Can I hide the sub report link for certain dealTypes or is there a better ay of doing this?
Thanks for your help..
Chiara
 
perhaps you can create a formula in the main report that accepts only the dealTypes that you want

for example

@LinkSubreport

WhilePrintingRecords;
stringVar dealType ;

if {table.Dealtype} in [ a list of acceptable values] then
dealtype := {table.Dealtype}
else
dealtype := " ";

dealtype;

now then link on this formula instead of {table.Dealtype}

something like this might work Jim
JimBroadbent@Hotmail.com
 
Hi

Thanks for replying, however, I don't think I can create a formula on the main report as I am just using Crystal linked to a sybase stored procedure, not invoking it from VB or anything.

Would I be right in thinking this or where were you advising I add the above code??

Thanks again..
Chiara
 
Your SYBase Stored procedure is returning a record set isn't it?...if DealType is a field in that set...and it must be if you are linking on it...then there should be no problem creating a formula in crystal, such as I suggested Jim
JimBroadbent@Hotmail.com
 
Hi

I am unable to manipulate the recordset as I attach the crystal report directly to the stored proc at design time.
Also I do not want to limit the dealtypes that appear but only have the link to the subreport appear on certain dealtype lines. I want all dealtypes on the report with a link beside dealtype when dealtypes value is 'A'.

Thanks
Chiara
 
Create a second detail section and put your on-demand subreport icon there. Suppress this section when {dealtype} <> &quot;A&quot;.

Possibly you can conditionally suppress the icon itself - right click on the subreport in design and see what's in the &quot;Format&quot; dialog. If you can, you won't need the separate section.
 
Hi

Thanks for this - I supressed the link based on Dealtype - works nicely. Just one thing...even when the link isn't visible you can still activate the report by clicking where it should appear - any way of avoiding this????

Thanks a million
Chiara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top