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

Hidden subreport being Export to Excel

Status
Not open for further replies.

LinPro

Programmer
Jun 25, 2003
120
US
Hi

I am using CR8.5 with Oracle 8i.

I have created a subreport that used a shared variable.
In the main report the shared variable uses the value that is pass from the subreport and does a calculation on group header 2. And of course the hidden subreport(which the color of the value is changed to white) is on the row of the group header 1. This is all a typical process in Crystal.

This report is exported to Excel.

However, it has been discovered that the hidden subreport get to be displayed in Excel if you changed the color of group header 1 (with the hidden subreport) into a different color.

I would like to know if there is solution to this, where the user will not be able to see the subreport.

Lin
 
I am not sure if colors get exported to Excel. If not, of course, white of not white, the field would go to the spreadsheet. Wouldn't it be better to create additional section above the header, to place subreport there, and to hide the section?
 
That is what I did.

The point is that the subreport should not be showing in the export to Excel. - If you changed the colors in the Excel spreadwheet after the report gets export - you will see the hidden subreport (whether or not you put it on the same section or upper section.) The location is not the important factor but the invisible subreport.

Lin
 
I mean hiding not by making color white, but by right clicking section in the report designer and selecting hiding option from the menu. If you did THAT, is subreport still getting exported to the spreadsheet?
 
If I hide the subreport, then I will not get the calculation to work. The data is in a shared variable from the subreport and being passed to the shared variables in the main report.
 
I did that too. It still get exported to Excel and it still will get displayed if the user changes the font colors.

Lind
 
How complex are the calculations done in the subreport? May it be possible to replace the subreport with a formula?
 
The calculation is not complex at all. In fact it is just a group by and summary.

However the group by is the opposite of the group by from the main report, therefore a formula can not be created in the main report. I tried all this.
 
What about getting the result you need right in the SQL? If you think this is not possible, could you please give more information about the report to look into options?
 
It is not necessary. The only options I have is to create a view to handle the report.

Thanks anyway.

Lin
 
Sounds like you are using the color 'white' to prevent the subreport details from display on the report.
However, when you export, it shows in Excel.
Right?

What you need to do is have the sections in the subreport suppressed. (The calcs will still work and the shared variable will be passed to the main report)
Then as you have done, keep the sub report size very small(thin) in a section by itself.
That way the calcs will still work, but when you export you will not have any values been exported from the subreport.

Try that.

P.S.
I have found a issue when viewing report with a subreport that has a null value in it, it displays a zero, but when exporting it will have the previous record value.
You will need to do some extra coding to avoid this.
I was using 8.5, sql server 2000 and exporting to Excel.
The problem was on Enterprise, but I think it also hapended in CR8.5
 
Thanks, Fred

But I have already convinced the management that to solve this I will be creating a view to deal with the subreport. It is a much cleaner way than to use subreports and faster.

Lin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top