Free Support Forum - aspose.com

Problem with Excel in asp.net

Sir,

I have a project done in asp.net.In this i use reporting using EXCEL sheets.For that i use previously formated excel templates.So i want only writing to the excel sheet.But now I want to delete some extra datas (previously formated).That is I want to delete a range of values(eg. delete D4 to H14).

I use .net2000 and OS 2000 and Excel also 2000.

So plz give me the code for solving above mentioned problem.

It is very URGENT .so plz reply as soon as possible

Thanks

Justin

You can use Cells.ClearRange method to delete data and formattings of this range.

cells.ClearRange(CellsHelper.ColumnNameToIndex("D"), 3, CellsHelper.ColumnNameToIndex("H"), 13);

If you just want to delete data but preserving the formattings, you can use Cells.ClearContent method:

cells.ClearContent(CellsHelper.ColumnNameToIndex("D"), 3, CellsHelper.ColumnNameToIndex("H"), 13);

Sir,

Thanks for your advice. But sir, still there is a problem.I cann't use that function cells.clearrange().Hear only get cells.clearformat ,cells.clearcontent etc.

When these fuctions are used the whole sheet's content will formated or cleared.

I want clear only a particular range.

To use cells.clearrange(),i need to using any of the header files.

So sir plz give me the detailed discriction about this problem including header file and other requirements.

thank you

justin

Which version of Aspose.Cells are you using? Please check http://www.aspose.com/Products/Aspose.Cells/Api/Aspose.Cells.Cells.ClearRange.html .