We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Table : Convert to range + set subtotal

Hi !

I use v 7.0.0.0 Aspose Cells.

Because table don’t permit subtotal, I want:
1 / Convert a table to range like that:
http://www.fanhow.com/images/thumb/3/36/How_to_Convert_a_Table_back_to_a_Range_in_Excel-02.png/540px-How_to_Convert_a_Table_back_to_a_Range_in_Excel-02.png

2/ In this range, add subtotal, like that:
http://i.techrepublic.com.com/blogs/jan2008blog6fig3r.jpg

What is the best way ?

thanks

Hi,


1) See the sample code to remove Table’s filters to become normal range of cells as per your needs.

Sample code: (The template file has a table/list object in the first worksheet)

Workbook workbook = new Workbook(“e:\test2\BookTable.xlsx”);
//Get the first table/list object.
ListObject listObject = workbook.Worksheets[0].ListObjects[0];
//Set the AutoFilters Off to make it normal.
listObject.AutoFilter.Range = null;
workbook.Save(“e:\test2\outtorange.xlsx”);

2) See the document on how to add subtotals:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/creating-subtotals.html

Thank you.

Thanks, It’s perfect !

Now i have a “little problem”, i wish have a label in french “Total Général” instead of "Grand Total"

I use Excel 2010 French, and i try :
Aspose.Cells.LoadOptions lo = new Aspose.Cells.LoadOptions();

lo.Region = CountryCode.France;

lo.LanguageCode = CountryCode.France;

m_designer.Workbook.Settings.Region = CountryCode.France;
m_designer.Workbook.Settings.LanguageCode = CountryCode.France;

System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo(“fr-FR”);

m_designer.Workbook.Settings.CultureInfo = ci;

but it doesn’t work

Hi,


I am afraid this may not be possible by default, although you may try to insert the french text manually in the relevant cells. Aspose.Cells by default follows US - English Excel’s standards and language settings. Also, if you need to set formulas, you have to consider English Language.

Thank you.

OK, thank you for your response.
So it is not possible, the best solution is to replace the text