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 2000 Forums
 SQL Server Development (2000)
 Advice needed

Author  Topic 

miranwar
Posting Yak Master

125 Posts

Posted - 2003-03-26 : 06:50:02
Hi,

I have been asked to create a weekly sales report for our user community. Using Sql server and Excel....

Now i have written the Sp that returns all the weeks sales figures. Can anyone advise me the best way of populating the Excel Spreadsheet.
Should i use VBA from within Excel. Or can i create some Kind of file that i can import into Excel ?

Any Advice would be Appreciated


Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-03-26 : 06:58:17
See this: (duplicate)

[url]http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=24883[/url]

Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2003-03-26 : 07:57:06
Excel will take a html table nicely. Here's a thread where I worked out some bugs doing just that.

[url]http://sqlteam.com/Forums/topic.asp?TOPIC_ID=24638[/url]

Sam

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2003-03-26 : 09:01:54
As always, consider the easiest most direct solution before complicating things by adding steps like DTS, HTML, ASP, etc.

Use a LINKED TABLE or a PIVOT TABLE in Excel, and just link to the SQL view or table you need. You can use good old ODBC. read Excel help for how to do this if you never have. A VERY useful feature. And you refresh anytime you need by right-clicking in Excel and choosing refresh.

If the data is extremely complex (i.e., a stored proc is needed), create a table in SQL for excel to link to and periodcially update that table. Then, in Excel, just link to that table as a pivot table. From there you can format, slice and dice, do whatever you like.

Finally, I recommend using MS Access to do this as it is a much better reporting tool than Excel.


- Jeff

Edited by - jsmith8858 on 03/26/2003 09:20:23
Go to Top of Page
   

- Advertisement -