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!

Exporting On Demand Subreport to Excel

Status
Not open for further replies.

jonav

Programmer
Nov 14, 2011
69
US
Hi,

I have a main report with a On Demand Subreport and would like to export to excel.

While trying I see only the main report data and Subreport as a link and not the data of the subreport.

Can you please shd some light if I'm missing anything?..

Thanks,
JN
 
Since an on-demand subreport opens in a different window, you won't be able to export it simultaneously with the main report. One option might be to add a parameter that checks whether the report is for export or not. Then you could add the sub twice (once as an on-demand sub and once not), and then conditionally suppress each using the parameter.

-LB
 
Can you explain in brief how can I achieve it pls?

Thanks,
JN
 
In what report section is the sub located? Do you need it to align with other fields?

-LB
 
this is user requirement:

Usre want a main report report with summary and link to another report in detail.

They may or may not click on the link to view the details but if they export the report it should export to excel in 1 sheet.

I have started designing yet. Pls advice accordingly.

Thanks,
JN
 
Instead of using a subreport, I would just create the report with the details, with summaries at the group level. Then create a parameter {?Show Details?} wtih options Yes and No. Conditionally suppress the detail section with a formula:

{?Show Details?}="No"

If they want to export, then they would run the report with details shown.

If they are insistent on the link approach, then add the linked on-demand subreport and also add another version of the same sub without 'on-demand' checked. If the details should show below group summaries (implying the sub is linked to the group field), then add it to a group header_b section. Then conditionally suppress the group header_b section with a parameter {?Export?} with yes and no options.

-LB
 
Thank you,

Tried this but what if they don't want to see the details of a subreport at all and only the link but still able to export the main & Subreport?.

Is there a possibility?.

Pls advice

Thanks,
JN
 
They would have to run the report twice, once for export, with the sub displayed, and once without.

-LB
 
how about keep the subreport data to export and just dont let the user see it. :(

I know it might be crazy but the designing decision depnds on the scenario

Pls help.

Thanks
JN
 
If you can't see it, you can't export it--AFAIK.

-LB
 
One approach could be to use my Export UFL so the report displays the main report, and subreport is not "On Demand", but has all it's sections hidden or suppressed.

Formulas in the subreport could build a CSV file with the values you want. You could also include fields from the main report and even create multiple CSV files from one report. The CSV file will open in Excel.

It's not really an export. The viewing of the report procesess the formulas in the report that call functions in the UFL that build a file (various formats supported) as you view the page.

Trial version available for download from my web site.

Bruce Ferguson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top