Print Page | Close Window

Launch Sub-Report as Field Hyperlink

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6895
Printed Date: 03 May 2024 at 11:16am


Topic: Launch Sub-Report as Field Hyperlink
Posted By: Takesen
Subject: Launch Sub-Report as Field Hyperlink
Date Posted: 29 Jun 2009 at 11:34am
Does anyone know if it's possible to launch a sub report off of a hyperlink like option?
 
I have an On Demand subreport. That i would like to be able to have it so
if the field value = "SEE NOTE" then the field has a hyper link. allowing the user to click on "SEE NOTE" and it will generate the sub report.
 
...I'm not even really sure if this is possible...
 
-Takesen



Replies:
Posted By: DBlank
Date Posted: 29 Jun 2009 at 12:59pm
Hey Takesen,
When you say if the field value = "SEE NOTE" are you referencing a field in the mainreport or the subreport? If it is in the mainreport you can conditinally suppress the sub-report on that field or you can use it to conditionally alter the linking field to sever the subreport link (link via a formula field that is altered from original value to a non-linkable value).
If it is a field in the sub-report I think it gets dicier. If possible in the sub-report you can suppress all the field when field value <> "SEE NOTE" then you can suppress the sub-report when it is empty.
IS this where you were headed?


Posted By: Takesen
Date Posted: 29 Jun 2009 at 1:08pm
Hey Dblank
It's a field in the main-report.
But it's a crosstab report. I was hopeing to be able to launch something more on demand like so it wouldn't disrupt the crosstab report itself.
Ya know?
 
 


Posted By: DBlank
Date Posted: 29 Jun 2009 at 1:17pm
So you want the link inside a cell in the crosstab?


Posted By: Takesen
Date Posted: 29 Jun 2009 at 1:44pm

exactly....

Any ideas? I can't figure it out....



Posted By: DBlank
Date Posted: 29 Jun 2009 at 1:51pm
interesting...
I don't have access to crystal today but maybe setting this up in the rest of the report and then creating it as a MIN or MAX value in the cell. I have never tried it before so I am really guessing at it right now. If you don't have a solution by tomorrow I should be back in the office and can take a look for myself.


Posted By: Takesen
Date Posted: 29 Jun 2009 at 1:57pm
Alright. See...
I only want it based off where currentfieldvalue = "SEE NOTE" right?
I was thinking about trying some of these hyperlink "Another Report Object" thing.... But.... i can't seem to figure out how the whole object links work....


Posted By: Takesen
Date Posted: 30 Jun 2009 at 11:35am
Alright... Well i wasn't able to figure out how, but my boss decided to go in a different direction anyway (although if you did figure out a way i would like to know, cuz i've found myself wanting to do something like this for awhile.... on many different situations).
 
But at any rate... I'm just curious, do any of you know how i could supress a section if the subreport is null?
 
I have a report footer b with the subreport in it, and it has a page break before so the sub report will come in on a new, and last page.
 
Does anyone know if i can suppress my RF-b if my subreport is blank?


Posted By: DBlank
Date Posted: 30 Jun 2009 at 11:49am

The sub-report can be set to suppress if blank and then Section RFb can be set to suppress if blank.

Is that what you wanted?


Posted By: Takesen
Date Posted: 30 Jun 2009 at 12:59pm
Well.... i don't think it'll work.... because there's the page break. there's a new page header and page footer.....
 
So it's the header with a blank sheet where data would normally go.
I want this page gone, but i'm not really sure how else i could get rid of it


Posted By: DBlank
Date Posted: 30 Jun 2009 at 1:04pm
Having a little trouble visualizing but I think you would need a shared variable from the subreport and then use that to suppress or also conditionally have new page after instead of always doing the new page.


Posted By: Takesen
Date Posted: 30 Jun 2009 at 1:34pm
Hmmmm I tried the shared variable set up.... it didn't seem to work.... but then again i probably set it up wrong....
 
basically what i'm trying to set up is.
 
Xtab report (RF-a) if within this xtab a SEE NOTE result appears then
Sub-Report (RF-b) will show the results on the note. I have the SEE NOTE part set up for the sub-report. so if there is no see note the sub-report's blank.


Posted By: DBlank
Date Posted: 30 Jun 2009 at 1:43pm
BUt you always are getting the page break and hence a blank page when no sub report, correct?
Do a conditional page break the same way you have the RFB conditionally suppred. It should only break if "SEE NOTE" exists.
If you ever have an instance where there is SEE NOTE and no subreport then you would need the shared variable to know to do no page break if there is no SEE NOTE or NULL sub-report.
Is this more in line with what you needed?


Posted By: Takesen
Date Posted: 30 Jun 2009 at 1:46pm

Yeah.... I was trying something along these lines.... but

I probably screwed up somewhere in the process.... I'll re-attempt it in a bit.



Posted By: DBlank
Date Posted: 30 Jun 2009 at 1:52pm

I don't use variables too much but I think you will need to create a RFc and palce the shared variable there. It has to be done after the sub-report. Also make it a constant POSITIVE attribute instead of a negative or NULL. You can make the page break only on an AND statement. Easier to control that way...

SEE NOTE exists AND shared variable= "X"



Posted By: Takesen
Date Posted: 30 Jun 2009 at 4:46pm
Awesome. worked pretty well.
Thanks Dblank, you're always a life saver :)
 
-Takesen



Print Page | Close Window