Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Export to Multiple sheets in Excel from SQL Report

Author  Topic 

ashy_16in
Starting Member

16 Posts

Posted - 2005-10-19 : 07:51:30
I need to export a report to different sheets in a Excel file
based on the time zones. Any help in this regard would be appreciated.

jhermiz

3564 Posts

Posted - 2005-10-19 : 08:52:21
No problem,

First let me give you an example. I'll give you a simple one...

[Code]
USE NORTHWIND
GO
SELECT CustomerID FROM Customer GROUP BY CustomerID
GO
[/Code]

Basically I want a specific report displaying all customers in the northwind database and I make sure I use the group by clause. In your case, you want to GROUP BY your timezone, this is critical in getting the report the way you want it.

Okay now that you have your query lets do the report. Drag the table object into your report and set the "DataSetName" to your abouve query, whatever you called this dataset name. Once you have that in place right click the details section of the report and create a "New Group".
Set this group to Fields!CustomerID.Value. Make certain you set the property to:
"Page break at end". What this means that every time a Customer is listed in the group, a new page is inserted into the report so that the next customer is displayed. In your case, you will set the group by to your timezone, and you set it also to page break after each time zone. Now view the report, notice that each customer / time zone is on its own page. Simply export the report to excel and you will see that each sheet is it's own customer / time zone.

Sound good ?

Jon



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page
   

- Advertisement -