如何在 1 个水晶报表查看器中查看多个报表?

人气:267 发布:2022-10-16 标签: vb.net visual-studio-2010 crystal-reports reportviewer subreport

问题描述

如何在 1 个水晶报表查看器中一次打开 2 个单独的报表?

How can I open 2 seperate reports in 1 crystal reports viewer at a single time?

并且在预览报表的时候,我看到我的子报表没有填满它的父控件宽度,如何让子报表的宽度填满它的父控件宽度?

And when previewing the report, I see that my subreport doesn't filled its parent control width, how to Subreport width fill its parent width?

我在 Visual Studio 2010 中使用 Crystal Reports.

I use crystal reports for visual studio 2010.

推荐答案

据我所知,当报表绑定到查看器时,您不能在同一个查看器中显示多个报表.现在有一些方法可以解决这个问题,让您看起来好像在一个查看器中显示了多个报告:

As far as I know you can't have multiple reports show in the same viewer as the report gets bound to the viewer. Now there are some ways of getting around that and making it look like you have multiple reports showing in one viewer:

1) 您可以将多个查看器附加到您的页面并禁止所有工具栏.

1) You could append multiple viewers to your page and suppress all toolbars.

2) 您可以将每个报表制作成一个子报表并将它们放入一个报表中.

2) You could make each of the reports into a subreport and put them into one report.

3) 如果报表不是交互式的(即分页、链接、向下钻取等),您可以为每个报表生成 pdf 文件并将它们合并.

3) If the report is not going to be interactive(ie - paging, links, drill down, etc) you could just generate pdf's for each report and merge them.

关于您的子报表显示不正确:您需要单独格式化子报表以使其适合您的页面.只是格式化子报表容器没有帮助,您必须格式化子报表本身.

And about your subreport not showing correctly: you need to format the subreport seperately to make it fit your page. Just formatting the subreport container will not help, you have to format the subreport itself.

希望有帮助!

克里斯

888