Iam not able to export any thing(xsl,pdf,xml...)

Technical support for Spire.DataExport

Moderators: iceblue support, DataExport, Manager

Iam not able to export any thing(xsl,pdf,xml...)

Postby kmdshuaib » Tue Jul 11, 2006 9:19 am

hi every body...
i am using asp.net with c# and used sql server as my connection in form load event.. and binded my data to datagrid..
and i want to export my datagrid value to xsl file and i gave it in button click event as like this
{
cellExport1.SaveToFile();
}

here i am unable to save my file to xsl.. and it is displaying an errror "THE FILE NAME CANNOT BE EMPTY"
PLS give me some suggestion regarding this problem...
kmdshuaib
 
Posts: 3
Joined: Tue Jul 11, 2006 9:02 am
Location: Chennai

Postby DataExport » Tue Jul 11, 2006 1:35 pm

You need to set FileName property, Adding the following code:

cellExport1.FileName = "test.xls";


If you want to download excel result file.

cellExport1.SaveToHttpResponse("test.xls",Response);
Technical Support
Spire.DataExport Team

support@e-iceblue.com
DataExport
 
Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm

Postby kmdshuaib » Wed Jul 12, 2006 4:41 am

Dear Sir,

As u told i did giving the FileName and also to download the file i gave but i got the following error

"WorkSheet Sheet 1 with error: Data source (Command) property has not been initialized.. TextExport::SaveToStream,var:"

In the FormLoad event I have given the following code:

string connstring;
connstring ="server=192.168.1.200;DataBase=Northwind;uid=sa;pwd=;";
SqlConnection conn = new SqlConnection(connstring);
SqlDataAdapter da =new SqlDataAdapter("select * from shippers",conn);
DataSet ds =new DataSet();
da.Fill(ds);
DataGrid1.DataSource=ds;
DataGrid1.DataBind();


and in the button click event i gave....


cellExport1.FileName="test.xls";
cellExport1.SaveToHttpResponse("test.xls",Response);

Pls help me out sir i am getting the above error............
kmdshuaib
 
Posts: 3
Joined: Tue Jul 11, 2006 9:02 am
Location: Chennai

Postby DataExport » Wed Jul 12, 2006 6:57 am

Add the following code to set export data source.
cellExport1.DataSource = Spire.DataExport.Common.ExportSource.DataTable;
cellExport1.DataTable = ds.Tabls[0];
Technical Support
Spire.DataExport Team

support@e-iceblue.com
DataExport
 
Posts: 35
Joined: Thu Jun 29, 2006 2:29 pm


Return to Spire.DataExport

Who is online

Users browsing this forum: No registered users and 0 guests