Dear all,
I am doing a project where I heed to extract data from a table in a sql server and then automatically create a bar chart with this data preferrably in PowerPoint (or excel). I was thinking myself that it may be done in vba/macro added to a button in powerpoint. If anyone knows how to do this i would be very grateful or if anyone know a useful website could they post it up.
Thanks for your help
Laura
The Microsoft Office web site has a good overview of how to import data into Excel from SQL Server. That data could then be used to draw your chart. Check out http://office.microsoft.com/en-us/excel/HA010864661033.aspx for more information. Once you've set up the datasource connection, there is already a menu item/toolbar button to refresh the workbook's data from the server.|||There are several ways to export data into Excel1. Use Jet OLEDB Provider. You need to create INSERT SQL statements and call them to insert one row of data at a time. Jet works pretty fast, but has some limitations when data in a same column contains different types.
2. Use Microsoft Office Tools for .NET. This way is slower, but gives you more functionality and allows formatting of the data. It allows you to control your output, but could be very slow and you need to pay attention to releasing all the resources associated with it, because it is COM-based. You have to pay attention to memory releasing, especially in ASP.NET environment
3. Write code that stores data into CSV or HTML. Those formats recognized by Excel
4. Use third party components that could provide desired functionality
Following are some links wit the samples
http://support.microsoft.com/kb/306022/en-us
http://support.microsoft.com/kb/326548/en-us
http://support.microsoft.com/kb/307029/en-us
No comments:
Post a Comment