visual-studio 动态创建 RDLC xml 作为 VS2005 报告查看器输入的最佳方法?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/150335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:41:08  来源:igfitidea点击:

Best way to dynamically create RDLC xml as input to VS2005 Report Viewer?

visual-studioreportviewerrdlc

提问by Kerry Jenkins

What is the best way to dynamically create RDLC xml as input to VS2005 Report Viewer?

动态创建 RDLC xml 作为 VS2005 报告查看器的输入的最佳方法是什么?

I would like to autosize columns based on the data sizes. I would also like to programmatically control what columns are displayed.

我想根据数据大小自动调整列的大小。我还想以编程方式控制显示哪些列。

回答by hurcane

Lisa Nichollsgives a complete answer in this threadabout dynamically defining a report. You'll want to scroll down some before you get to a useful answer. This thread most directly answers your question about controlling which columns are displayed.

Lisa Nicholls在此线程中给出了有关动态定义报告的完整答案。在得到有用的答案之前,您需要向下滚动一些内容。该线程最直接地回答了您关于控制显示哪些列的问题。

These same techniques can be used to size the columns programmatically, but your code will have to figure out the appropriate column widths.

这些相同的技术可用于以编程方式调整列的大小,但您的代码必须确定适当的列宽。

回答by Brian Hinchey

Dan Smith also has a good solution at: http://csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html

Dan Smith 也有一个很好的解决方案:http: //csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html

Majid also has a refinement of Dan's solution in the comments to that blog entry that doesn't need to write any files to the file system.

Majid 在对该博客条目的评论中还对 Dan 的解决方案进行了改进,无需将任何文件写入文件系统。