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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Send report breakdown by name

Author  Topic 

andros30
Yak Posting Veteran

80 Posts

Posted - 2008-05-12 : 18:01:04
I need to send a report in excel format that will breakdown the report by managers per sheet. I have a table that contains the following:

Manager OfficeName Note
Cindy Exxon Text here
Cindy Chevron Text here
John BP Text

I found this sample on another site but I'm do not want to follow the fetch syntax...

SET @SQL = @SQL + 'select OrderID,ShippedDate, Freight,ShipName from northwind..orders where EmployeeID=' + cast(@EmployeeID as varchar(10)) + '/ *<title>' + @Name + '</title><comments>Orders for ' + @Name + '</comments>*/;'

Thank you for any suggestions...

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2008-05-12 : 18:37:11
You could create views that have the data you need and then create an excel spreadsheet that uses the views as an external data source. Then the users will have up to date information whenever they want it from their excel spreadsheet.

An infinite universe is the ultimate cartesian product.
Go to Top of Page

andros30
Yak Posting Veteran

80 Posts

Posted - 2008-05-13 : 08:54:48
quote:
Originally posted by cat_jesus

You could create views that have the data you need and then create an excel spreadsheet that uses the views as an external data source. Then the users will have up to date information whenever they want it from their excel spreadsheet.

An infinite universe is the ultimate cartesian product.



At the moment I have a stored procedure that gather the overall data. I was planning to create another stored procedure (main) that would call the other one as well as sending the results.

I'll look into the views approach. Would you be able to point me to some sources where I can tell Excel to pull this data from the view... Thanks
Go to Top of Page

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 2008-05-13 : 14:08:10
Create the view, make sure you have read permissions on it.

Create a system odbc connection on the client machine to the server, database, view

Create a new Excel Spreadsheet, From the menu select Data, Import external data, import data, select the system odbc object you created in the previosu step.

Enjoy user adoration.

An infinite universe is the ultimate cartesian product.
Go to Top of Page
   

- Advertisement -