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

Subreport issue

Status
Not open for further replies.

Bruni007

Technical User
Joined
May 29, 2006
Messages
20
Location
CA
Hi,

I'm working with Crystal Reports 9..
I have a subreport in a main report. The subreport is not on-demand because I need it to process data and exchange a shared variable to the main report. But I don't want to see the subreport in the main one, I just want to see the subreport when I double-click on it..

In the main report, I've created another detail section for the subreport that overlays the following detail section..It appears like I only have the details of the main report

In my subreport, I have suppressed all the sections in the section expert. So, in my main report I don't see any subreport displayed...That's what I want for the main report and it works fine!

But in the section expert of the subreport, I'd like to add a condition for the suppress because I don't want the sections to be suppressed when I double-click on the subreport from the main report

I don't know what would be the formula I should write to avoid the sections of the subreport to be suppressed when I double-click only...any idea?

Thanks,
Michael
 
Hi,
Can you place the sub in a group,then hide the group?
Drilling-down ( dbl-clicking) should then show it..



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
The subreport must be in the details section becaue I need the subreport to process each record of the main report...

If there were a way to hide the detail A section without hiding detail B, it would work also
 
If you leave the report header of the subreport blank and unsuppressed, and then select the subreport->format subreport and uncheck "Can Grow", then only white space will display in the main report if you size the subreport correctly, but if you double click, the subreport detail will display.

-LB
 
lb, it works pretty well
Thank you so much!

 
Unfortunately, I don't know why but the shared variable of the subreport do not give the right value to the main report when I remove the Can Grow checkmark....
 
I see what you mean. You might need to add two subreports, one with the drilldown capability as I suggested earlier, and another one in an obscure section of detail_a where people are unlikely to click and where you suppress all sections of the subreport, but leave "can grow" checked in order to pass the shared variable.

-LB
 
Thanks for your help!


Do you think that there would be a way to display only the group header and group footer instead of the detail section??

Because I need another report with the summary only, without the details...Each time I suppress the detail section, my shared variable are not evaluated anymore
 
Depending upon what the subreport is calculating, you could potentially move it to the group header, and link only on the group field, and then share the results in the group footer or an inserted group header_b section.

-LB
 
The subreport evaluates data for each record. It needs to be in the detail section, I don't think that I can make it work otherwise.
 
A subreport in a group section can evaluate a set of details. I think you need to provide more specific information about what the subreport is intended to do. Describe the main report structure (groups, etc), the subreport structure, how it is linked to the main report, and provide some detail about the shared variable.

-LB
 
First, the report I am creating is to get the percentage of server availability on a monthly basis. Each server is defined in a category depending of when the server should be up and running (24h/24h, 8am-5pm), ...). There are Bronze, Silver and Gold servers.

In the main report, each record is an event where a server has been down. For each record, there is a field which is the category. There are also events each time one of the above categories gets active and inactive, but these events are filtered and do not appear in the main report.

Example:
4:28 server#1 28min silver
(the server#1 has been down 28min at 4:28, it is a silver server)

To know if an event where a server has been down is in an active period, I need to check if the event has occured during the active category he is assigned to in the subreport

7am silver active
8am bronze active
5pm bronze inactive
9pm silver inactive

A shared variable gives me a result for each record and another shared variable gives the total of unavailability for a server during the month. With it, I display the percentage of availability in the group footer section of the main report

I hope I was clear enough
 
You didn't really respond to my last request for "main report structure (groups, etc), the subreport structure, how it is linked to the main report, and provide some detail about the shared variable." Please also show the content of the shared variables.

-LB
 
main report

group header: by hostname
reinitialize the shared variable total_time:=0

detail A: subreport

detail B: db field
date_reception category date_closed
shared variable unavailable

group footer:
total_time (amount of seconds of unavailability)

subreport

details:
date_reception sla_level
shared variable unavailable

report footer:
shared variable total_time


date_reception is linked with date_reception
date_closed is linked with date_closed
category is linked with category


shared variable unavailable:
in the detail section of the subreport, it evaluates each record to find from when to when the server has been down

shared variable total_time:
calculate the amount of seconds of unavailability for a server in the report footer of the subreport
 
What I need to do is: for each record of the main report, evaluate other records in a subreport. A shared variable is then returned to the main report...

It works fine when my subreport is in the detail section, but would it be possible to have it in a group section of the main report?
 
It is just to let you know that I found the way to make it work

In the section expert of the subreport section I've added a checkmark to "Suppress blank section"

...and in the subreport format, under the subreport tab, I've added a checker to "Suppress blank section" also !

thx anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top