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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

No filtering in grid exporting

Thread ID:

Created:

Updated:

Platform:

Replies:

142723 Feb 16,2019 03:26 PM UTC Feb 18,2019 05:18 PM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Toni
Asked On February 16, 2019 03:26 PM UTC

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


Vignesh Natarajan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon