p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Book: Wrox's Visual C# 2005 Express Edition Starter Kit (http://p2p.wrox.com/forumdisplay.php?f=243)
-   -   Charting in power point using C# (http://p2p.wrox.com/showthread.php?t=74378)

amitabha.chakraborty May 13th, 2009 02:17 AM

Charting in power point using C#
Can we export "Microsoft .net Chart Component" in Power point?

I have written a sample code using Microsoft .net Chart Component and i want to export it in power point without saving it as a jpg file. how to achieve it?

private void load_chart()
// The Access database
string fileNameString = "C:\\Amitabh Per\\C#\\Chart_Win Samples\\data\\ExcelData.xls";
// Initialize a connection string
//string fileNameString = "data\\ExcelData.xls";
// Create connection object by using the preceding connection string.
string sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
fileNameString +
";Extended Properties=\"Excel 8.0;HDR=YES\"";
OleDbConnection myConnection = newOleDbConnection( sConn );
// The code to follow uses a SQL SELECT command to display the data from the worksheet.
// Create new OleDbCommand to return data from worksheet.
OleDbCommand myCommand = newOleDbCommand( "Select * From [data1$A1:E25]", myConnection );
// create a database reader
OleDbDataReader myReader = myCommand.ExecuteReader (CommandBehavior.CloseConnection);
// Populate the chart with data in the file

// close the reader and the connection

All times are GMT -4. The time now is 02:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.