在运行时动态生成 RDLC 报告定义的最佳方法是什么? [英] What is the best way to dynamically generate RDLC report definitions at runtime?

查看:22
本文介绍了在运行时动态生成 RDLC 报告定义的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有用户在运行时通过执行查询生成的数据.数据的形状未知,因为用户可以选择带回哪些字段.

I have data that will be generated by users at runtime by performing queries. The shape of the data is unknown because users can choose which fields to bring back.

该应用程序是一个 ASP.NET MVC Web 应用程序.数据将是 .NET POCO.但是,每个对象都可以具有作为其他对象集合的属性.

The application is an ASP.NET MVC web app. The data will be .NET POCOs. However, each object could have properties that are collections of other objects.

我想对报告使用 RDLC 格式,以便我可以利用 PDF、Excel、Word 等导出功能.

I want to use the RDLC format for the reports so that I can leverage the PDF, Excel, Word, etc export functionality.

我设想将数据显示在网格中,并为集合属性嵌套网格.

I envisage the data being displayed in a grid, with nested grids for the collection properties.

  1. 生成 RDLC 数据的选项有哪些?
  2. RDLC 能否根据我的集合属性要求处理嵌套表/网格?

推荐答案

我在一年前调查了这个主题,寻找一个对象模型来在内存中生成 RDL.没有,但有传闻.现在的快速调查:存在称为 RDLOM 的对象模型,但是 Microsoft 并不真正支持.

I investigated this theme a year ago, searching for an object model to generate RDLs in memory. There wasn’t one, but there are rumors about. A quick investigation nowadays: An object model called RDLOM exists, but isn’t really supported by Microsoft.

我的实际方法使用 自生成的对象模型构建基于 RDL 方案.

这是一个不太理想的解决方案,因为你需要详细了解生成的对象,而且对象创建代码真的很丑.但是我在调​​查中发现的其他解决方法直接使用 XML 或 XSLT 来生成 RDL,并且它们的方式很差.

This is a less-than-ideal solution, because you need to know the generated object in detail and because the object creation code is really ugly. But the other workarounds I found in my investigation use XML or XSLT directly to generate the RDL and they are poor in their own way.

这篇关于在运行时动态生成 RDLC 报告定义的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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