We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

No filtering in grid exporting

Hello.

My application has several list pages where a Grid control is used.
Sorting, filtering and column choose are working with no problem (I set the EnablePersistence property to true).
Only one of these forms are filtering also when exporting to Excel or Pdf, the other, not (I have to say that column choosing is working).
Any idea on what can be happening and how to fix it??

This is the code on my Page_Load method;
            this.Title = ResourceReader.GetWebResourcesString("Almacenes");
            grid.Locale = CultureInfo.CurrentCulture.Name;
            if (grid.FilterSettings.FilteredColumns.Count == 0)
            {
                grid.FilterSettings.FilteredColumns.Add(new FilteredColumn { Field = "IsActive", Operator = FilterOperatorType.Equals, Value = true });
            }
            warehouseList = Mapper.Map<List<WarehouseListViewModel>>(RepositoryFactory.WarehousesRepository.Get());
            grid.DataSource = warehouseList;
            grid.DataBind();

This is the code on my ServerExcelExporting (for Pdf is almost the same)
            GridProperties gridModel = grdWarehouses.Model;
            IEnumerable dataSource = (IEnumerable)grdWarehouses.DataSource;
            string fileName = $"{ResourceReader.GetWebResourcesString("Almacenes")}.pdf";
            doExportToPdf(gridModel, dataSource, fileName);

And, finally, this is the code for my doExportToPdf method (which is located on the base page where my pages inherits from):
        protected void doExportToExcel(GridProperties gridModel, IEnumerable dataSource, string sheetName, bool printHiddenColumns=false, bool printTemplateColumns = true)
        {
            bool multipleExport = false;
            string fileName = $"{sheetName}.xlsx";
            ExcelExport exp = new ExcelExport();
            IWorkbook workbook = exp.Export(gridModel, dataSource, fileName, ExcelVersion.Excel2013, printHiddenColumns, printTemplateColumns, theme, multipleExport);
        }

Thanks in advance


1 Reply

VN Vignesh Natarajan Syncfusion Team February 18, 2019 05:18 PM UTC

Hi Toni, 
 
Thanks for contacting Syncfusion support.  
 
Query: “Only one of these forms are filtering also when exporting to Excel or Pdf, the other, not (I have to say that column choosing is working).” 
 
As we quite unclear about your requirement, Kindy share the following details regarding your requirement 
 
  1. Share the Full Grid rendering code(client side and server side).
  2. You have mentioned that only one forms have filtered data. Are facing the issue while exporting the multiple exporting?.
  3.  Is there any exception or script error while exporting(if yes, share the screenshot with full stack trace).
  4. Share the video demonstration of the reported issue.
  5. If possible try to share the issue reproducible sample.
 
Requested details will be helpful for us to validate the reported issue at out end. 
 
Regards, 
Vignesh Natarajan 


Loader.
Live Chat Icon For mobile
Up arrow icon