Hi !
When i merge a Table (2007/2010) with:
m_designer.SetDataSource(ds);
m_designer.Process();
In the merge document, my table don’t sort the column2 ! (see the file attachment)
The user is obliged to refresh himself sorting!
I tried to look into m_wb.Worksheets[0].ListObjects[0].?, but I have not found a method Sort.refresh
Thanks !
Hi,
I think you may get the AutoFilter’s DataSorter for the list object or table, e.g
DataSorter sorter = listObject.AutoFilter.Sorter;
Now use Aspose.Cells’ Data Sorting feature to accomplish your task. See the document for your reference:
Data Sorting
Thank you.
Hi Amjad Sahi !
I have a xlsx model with tab sorting (set manually through Excel)
when i merge this document, the column don’t sort (but the icon sorting appears in Excel… see my file attachment)
I try
var sort = m_wb.Worksheets[m.NomFeuille].ListObjects[i].AutoFilter.Sorter;
sort.Sort();
but not effect…
Hi,
Hi Amjad Sahi !
Thanks !
But your solution is manually solution.
Ideally, I want this to happen automatically from the model.
From the Excel interface, the user selects the columns to sort. And when i merge with Aspose.Cells:
m_designer.SetDataSource(ds);
m_designer.Process();
I wish the new document automatically refresh the sorted columns.
Thanks and Happy new year !
Hi,
Hi !
Workaround (but use Excel Interop), for refresh Sort and Filter :
foreach (Microsoft.Office.Interop.Excel._Worksheet s in Globals.ThisAddIn.Application.ActiveWorkbook.Worksheets)
{
foreach (Microsoft.Office.Interop.Excel.ListObject lo in s.ListObjects)
{
Microsoft.Office.Interop.Excel.Sort so = lo.Sort;
if (so != null) so.Apply();
Microsoft.Office.Interop.Excel.AutoFilter af = lo.AutoFilter;
if (af != null) af.ApplyFilter();
lo.Refresh();
}
}
Globals.ThisAddIn.Application.WindowState = XlWindowState.xlMinimized; // Hack
Globals.ThisAddIn.Application.WindowState = XlWindowState.xlNormal;
There is no equivalent of Aspose Cells I suppose?
Hi,
Amjad Sahi, Thanks for your reply !
Hi,
Thanks for your comments and using Aspose.Cells for .NET.
If you face any other issue, please feel free to post, we will like to help you further.
Besides if you are new to Aspose.Cells APIs, we will like to inform you that we have lately done some major enhancements and added new features in our product, so you should also download and give a try to latest offline demos of Aspose.Cells which you can find from theses links.
These demos can work with Visual Studio 2005 , 2008 or 2010 or 2012 or 2015or 2019. Please read the readme.txt file before running the demos.