Excel导出具有多个详细信息级别的Telerik Kendo Grid [英] Excel export of Telerik Kendo Grid with multiple detail levels

查看:57
本文介绍了Excel导出具有多个详细信息级别的Telerik Kendo Grid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有多个层次结构"的Kendo网格-两个详细信息级别,如下所示:

I have a Kendo Grid with "multiple hierarchy" - two detail levels, like this:

  • 主行
    • 详细信息
      • 详细信息
      • 更多细节细节
      • Main row
        • Details
          • Details of details
          • Some more details of details
          • 详细信息
          • 详细信息
            • 详细信息
            • Details
              • Detail of details

              使用此示例我能够将主行"与详细信息"行一起导出.但是我很难导出"Details of details"行.我知道可以使用示例中的方法,但是似乎无法正确方式"对代码进行洗牌.有人做过此事,可以提供示例吗?

              Using this example I am able to export the "Main row" along with the "Details" row. But I am having a hard time exporting the "Details of details" row. I know it is possible using the approach in the example, but cannot seem to shuffle the code "the right way". Has anyone done this before, and can provide an example?

              谢谢.

              推荐答案

              对于仍在寻找答案的任何人,我都可以实现3级导出. 它看起来并不是世界上最漂亮的东西,但是可以随时做出贡献并使其变得更好. 您可以在此链接中看到完整的实现. 我还解决了一个问题,即多个出口无法正常工作.

              for anyone who is still looking for an answer to this, I was able to do an implementation of a 3-level export. It doesn't look the most pretty thing in the world but feel free to contribute and make it better. You can see the full implementation in this link. I also solved an issue where the export wouldn't work correctly for multiple exports.

              基本上,每次您单击主网格中的expand时,都需要重新计算每个导出的主行索引,因为Kendo将重新计算主行索引.例如.展开第4行(将显示一个包含6行的网格),然后展开第1行(将显示一个包含12行的网格).当您执行此操作时,行4"的索引将更新为4 +12.因此,行4"的新索引实际上是16. 无论是否要导出页眉/页脚行,都还需要注意.

              Basically, you need to recalculate the master row indexes of each export every time you click expand in the master grid as the master row indexes are recalculated by Kendo. E.g. you expand row 4 (which will display a grid with 6 rows), then you expand row 1 (which will display a grid with 12 rows). When you do this, the index of "row 4" is updated with 4 + 12. So the new index of "row 4" is actually 16. You also need to be aware of header/footer rows if you want to export them or not.

              这篇关于Excel导出具有多个详细信息级别的Telerik Kendo Grid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆