You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

jqGrid导出Excel时如何排除summaryType生成的汇总内容显示

jqGrid导出Excel排除指定列summaryType生成内容的解决方案

你使用的jqGrid JS v5.3.0版本支持两种常用实现方案,按需选择即可:

方案1:仅移除Action列的汇总内容,保留其他列汇总

给ACTION列新增exportFormatter配置,判断为汇总行时返回空值即可,修改后的列配置如下:

{
  label: 'Action', 
  name: 'ACTION', 
  width: 60,
  summaryType: function (val, name, record) {
    return "Grand Total Printed:<br /> Grand Total Void:<br /> Grand Total Remaining :"                 
  },
  // 新增导出格式化逻辑
  exportFormatter: function (cellValue, options, rowObject) {
    // 汇总行的rowId固定为footer,匹配到就返回空
    if (options.rowId === 'footer') {
      return '';
    }
    return cellValue;
  }
},

方案2:不需要导出所有列的汇总内容

直接修改导出配置,关闭footer导出即可,修改后的导出代码如下:

$("#headerJqGrid").jqGrid("exportToExcel", {
  title: 'Bl Print Control Header',
  includeLabels: true,
  includeGroupHeader: true,
  includeFooter: false, // 原true改为false,关闭汇总行导出
  fileName: "HeaderSearchRecords.xlsx",
  maxlength: 40,
});

内容的提问来源于stack exchange,提问作者Benazir

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.14 22:24:08