Export report data to excel in single sheet

Hi ,
I have a Report viewer In that i am having Report in 5 pages.

I want to export the data to excel for that i am using this script

format = event.source.parent.getComponent('Dropdown_Format').selectedStringValue
window = system.gui.getWindow("EMS/EMS_Dynamic_Report")
if format == "Excel":
	window.getComponentForPath("Root Container.Report Viewer").saveAsXlsx("Daily Report")

when I save it, i am getting data with 5 Sheets. but i want to export the data to excel in single sheet

i want to export the 5pages data in to single sheet in excel
@PGriffith
how to do that… can any one help

You can’t.
Excel and CSV report exports are translations of the primary purpose of reporting - a document format.

If you want a ‘single page’ output, you need to have a single page report - you can set a custom, extremely tall size to avoid wrapping. That then makes it impractical to use as a standard report, but that’s just the nature of reporting.

Think of it this way: If you had two tables in your report, how would they end up in an XML export? What if you have multiple defined pages, each with their own tables that can grow to multiple pages?
Exporting to Excel or CSV is by definition a lossy, fragile venture. I would recommend building a secondary function to query for the same data that you’re using a report to display, and just directly export is using system.dataset.toExcel, where you have greater control over the output.

2 Likes

thanks for your response. i will try it out