reportserver

1.       Report Viewer常用属性

a.       SizeToReportContent: 设置在报表呈现时,报表显示区域是否会随着报表内容改变大小。区别就是在报表高宽超过ReprotViewer和浏览器的高宽,TRUE会在浏览器上出现滚动条,FALSE仅在报表区域出现报表。

测试发现,只有width和height设置为100%时,才起作用。若设置为固定宽度则不管用。

 若异步模式设置为true,发现滚动条管用,但是高度只是页面的1/4.解决方法:Remove the xhtml doctype from the page.(将.aspx中的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">删除)

是否可以不删除,更改为html4.0?没测试。(dtd的用处:http://www.chinahtml.com/0710/119258363516578.html

若异步模式设置为false,能全部显示,但是报表很窄,只占页面的部分,有点挤。

When you try to assign the web reportviewer control to a height of 100%, it displays as a very short (height wise) format.  For me, adding the style attributes to the form did the trick.

The solution to this problem was found on this page: http://msdn2.microsoft.com/en-us/library/ms252090.aspx.

Considerations for XHTML and ReportViewer Web Server Control

If you configure the ReportViewer Web server control to run in asynchronous mode in an application that is written in XHTML, you must follow specific steps to display the ReportViewer control properly. If the ReportViewer control uses relative height (for example, if the height is specified as a percentage of available space), the control collapses to a height of 0 pixels as a result of how frames and DIV tags render in containing tables in XHTML. You can avoid this problem by using one of the following workarounds:

  • Explicitly set the height on the on the ReportViewer control to an actual value rather than a percentage.

  • Add the following style setting to the head tag:

    <style>html,body,form {height:100%}</style>.

    By forcing the html, body and form tags to maximum height, the frame used in the ReportViewer control will also grow to maximum height, making it visible on the page.

  • 使用上面的方法,高度能显示全了,但是带有两个滚动条SizeToReportContent:不起作用。

     

  • Remove the xhtml doctype from the page.

b.      ProcessingMode: 设置ReportService是在本地还是远程。可选枚举值为:RemoteLocal

c.       AsyncRendering True / False,设置是否需要异步呈现。最好设为True,否则加载时会有卡的感觉。

2.       连接Report Service

ServerReprot属性用以设置远程ReportServerUrlReportPath。例:
rvReporting.ServerReport.ReportServerUrl = new Uri(“http://server/reportserver”);
rvReporting.ServerReport.ReportPath = “/Report/
消费分析”;

3.       连接凭据

a.       理论上可以配置IIS使用同名用户访问远程ReportServer,没有配成功。

b.      实现Microsoft.Reporting.WebForms. IReportServerCredentials,用以设置ServerReport. ReportServerCredentials。(代码附于文档最后)

4.       传入参数

a.       使用ServerReport.SetParameters方法设置报表参数。

b.      参数可以传入数组,但只能是字符串类型。即使Reprot中定义了非字符串的参数,这里也只能以String类型传入。引用报表是基于Soap的。

c.       参数区分大小写,必须和报表中设计的参数大小写一致,否则会抛出异常。

5.       问题汇总

a.       滚动条问题
设置SizeToReportContent会同时影响XY两个方向,如果只希望限制向一个方向扩展(即在报表内容超大时只出现某一个方向的滚动条,另一个方向自适应)无法通过设置完成。目前解决办法是使用JS轮询报表的状态,一旦状态改变,则重新设置报表内容的高度或宽度,以实现自适应效果。(代码附于文档最后)

b.      报表参数区分大小写,给报表传入参数时需要注意。

c.       在程序运行中出现异常{报表参数“[xx]”为只读,无法修改。 (rsReadOnlyReportParameter)},是由于在Report中指定了该参数为隐藏。

d.      异常{提供给报表参数“xx”的值对其类型无效。 (rsReportParameterTypeMismatch)},是由于给参数xx传入的值无法转换为xx定义的类型。比如int类型的数据传入了”abc”

### 使用 DevExpress Report Server 进行报表创建和管理 #### 1. 安装与配置 为了使用 DevExpress Report Server 创建和管理报表,首先需要安装并配置该服务。确保已下载适用于 Windows 或 Linux 的最新版本的 Report Server 并按照官方文档完成安装过程[^3]。 #### 2. 访问 Web 应用程序门户 一旦成功部署了 Report Server 实例,在浏览器中输入指定 URL 即可访问基于 Web 的应用程序门户。此界面允许用户浏览现有资源、上传新文件以及执行其他操作来管理和共享报告内容。 #### 3. 设计报表模板 通过集成到 Visual Studio 中的设计工具可以轻松地设计复杂的多层结构化 (Master-Detail) 报表。利用内置的数据绑定特性快速关联各种数据源,并应用样式设置使最终输出更加美观易读[^1]。 ```csharp // C# 示例:定义主从关系的数据源 var masterDataSource = new XRBindingSource(); masterDataSource.DataSource = GetMasterData(); var detailDataSource = new XRBindingSource(); detailDataSource.DataSource = GetDetailData(masterRecordId); report.MainReport.DataMember = "MainTable"; report.SubReports["SubReport"].DataMember = "Details"; ``` #### 4. 发布至服务器 当完成了本地环境下的开发工作之后,可以通过简单的拖放方式将 `.repx` 文件直接发布到远程位置;或者借助 API 接口实现自动化流程控制,从而简化日常运维任务。 #### 5. 设置权限与安全策略 管理员可以根据实际需求灵活调整不同角色对于特定目录内对象的操作权限(如查看、编辑),同时支持 SAML/OAuth 等多种身份验证机制以保障系统的安全性。 #### 6. 调度计划任务 除了即时生成 PDF/Excel 文档外,还可以安排定时作业定期运行选定脚本并将结果发送给订阅者邮箱列表成员,提高工作效率的同时减少了人工干预的可能性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值