【问题标题】:Cannot apply filter on whole columns in Excel of exported DevExpress grid无法对导出的 DevExpress 网格的 Excel 中的整个列应用过滤器
【发布时间】:2016-04-29 07:57:31
【问题描述】:

我在 Excel 中导出了 DevExpress 网格。我希望能够在导出的 Excel 工作表上应用 Excel 过滤器。现在,Excel 导出只允许我对深灰色行(其中已经有总和的行)之间的值应用过滤器。见图片。 (这可能是因为格式中发生了单元格合并吗?) 我正在使用以下方法导出:

Using link As New PrintableComponentLink(New PrintingSystem())

                Dim options As New XlsxExportOptionsEx
                options.ExportType = DevExpress.Export.ExportType.DataAware
                options.TextExportMode = TextExportMode.Value 'Should set to Value to be able to have the numbers displayed as numbers instead of text.
                options.AllowCellMerge = DefaultBoolean.False

                link.Component = gcInvisibleDetail
                link.CreateDocument(link.PrintingSystem)
                link.ExportToXlsx(tbRepertoire.Text & "\Charges.xlsx", options)

End Using

【问题讨论】:

    标签: excel gridview devexpress


    【解决方案1】:

    过滤器不能应用于整个列,因为在您的示例中,组页脚行 7、9、15 和 17 的顶部和底部有一个小缩进,Excel 中的空行模拟这些缩进。

    添加这些行是为了支持网格导出的所见即所得原则。

    您可以查看此主题:

    Problem with XtraGrid Group Footer rending when exporting to excel

    【讨论】:

    • 您的链接为我指明了正确的方向。最后只使用以下行解决了我的所有问题:gridview.ExportToXlsx(file) 谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-16
    • 2012-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多