Save Changes

Hi

I want to use Aspose.Excel as web tool to update database.

I can run SP to create dataset --> populate Excel --> make changes in Excel.
So far so good.

Is possible to create dataset or datatable from client side and send to server side to update
database?

The problem is create dataset ( or datatable ) from client side.

When I run demo I can see message ‘This document has been modified. Do you want
to save changes?.. Yes.No.Cancel’.

If I click ‘Yes’ I can save as new Excel file, but I need dataset.

I read the API documentation but i could’n find the way to do that.

Thank You.

vicmol

Dear Vicmol,

Thanks for your consideration.

In asp.net, Aspose.Excel runs on server side to create an excel file as your requirement.
When you write winform programs, Aspose.Excel can run on client side or server side.

However, Aspose.Excel can create datatable on server side to update database in asp.net.

Following is the sample code:


Excel excel = new Excel();
string designerFile = MapPath(“Designer”) + “\DataSource.xls”;
excel.Open(designerFile);

Worksheet sheet = excel.Worksheets.GetAt(0);

DataTable dt = sheet.Cells.ExportDataTable(6, 1, 69, 4);

this.DataGrid1.DataSource = dt;
this.DataGrid1.DataBind();

OK.

If I click ‘Yes’ on message ‘This document has been modified. Do you want
to save changes?.. Yes.No.Cancel’ then Excel could be saved on server side.

Can I save Excel file as Server_side_Path+‘XYZ123.xls’ by default without ‘Save as’ dialog box.

And then Excel could be open as code:


Excel excel = new Excel();
string designerFile = MapPath(“Designer”) + “\XYZ123.xls”;
excel.Open(designerFile);

Worksheet sheet = excel.Worksheets.GetAt(0);

DataTable dt = sheet.Cells.ExportDataTable(6, 1, 69, 4);


and then compare dt with original Dataset.

Thanks,

vicmol



Dear vicmol,

You can use the following method to save excel file on server side.

public void Save(string resultSpreadsheet, FileFormatType fileFormatType)

//samle code
excel.Save(@“D:\test.xls”, FileFormatType.Default);

Hi Laurence,

In this method Excel.Save the Excel exist on SERVER side as well.

I need the Excel from CLIENT side.

I expect some Javascript from you.

Regards,

Victor


dear Victor,

Please talk to me at aspose@hotmail.com via MSN Messenger for detailed discussion.