V 2008 - 回发时晶体参数丢失(报告刷新) [英] V 2008 - Crystal parameters get lost on postback (Report Refresh)

查看:61
本文介绍了V 2008 - 回发时晶体参数丢失(报告刷新)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用Visual Studio 2008和内置的Crystal Reports 2008 Basic。我有一个asp.net网页,其中包含一个自定义表单来收集我的报告参数。表单还包含"提交"按钮。在表单下面我放置了一个空的CrystalReportViewer对象。当用户提供参数并单击提交时,我在服务器端捕获提交事件,加载ReportDocument对象,将其传递给我的表单参数并将其分配给我的CrystalReportViewer。该报告显示正确并显示在我的参数表单下方。

I'm using Visual Studio 2008 with the built in Crystal Reports 2008 Basic. I have an asp.net web page that contains a custom form to collect parameters for my report. The form also contains a Submit button. Below the form I placed an empty CrystalReportViewer object. When the user provides parameters and clicks submit, I catch the submit event on the server side, load ReportDocument object, pass it my form parameters and assign it to my CrystalReportViewer. The report than displays correctly and appears below my parameter form.


问题是,当我点击任何按钮时我的报告工具栏,页面刷新,报告变为空白,并显示缺少参数的错误消息。这是否意味着ReportObject或参数未存储在视图状态中,我必须在每个页面上重新加载ReportDocument对象?我还尝试设置 ReuseParameterValuesOnRefresh =" True",但它没有任何区别。

The problem is, that when I click any of the buttons on my report toolbar, the page refreshes and the report becomes blank with an error message that parameters are missing. Does this mean that the ReportObject or the parameters are not stored in the viewstate and I have to reload the ReportDocument object on every page post back? I have also tried to set the ReuseParameterValuesOnRefresh="True", but it didn't make any difference.


我还注意到,如果我在我的代码隐藏文件中设置CrystalReportViewer对象的任何属性,则所有属性值都会在回发时重置为默认值。我确实在页面和CrystalReportViewer控件上启用了viewstate。如果我在HTML代码中设置属性,它们会在回发后保留。

I have also noticed that if I set any of the properties of CrystalReportViewer object in my codebehind file, all property values get reset to default on post back. I do have viewstate enabled on the page and on the CrystalReportViewer control. If I set the properties in the HTML code, they do get retained on post back.


这是一个示例单击提交时执行的代码:

Here's a sample of the code that executes when I click submit:


Dim oRpt As New ReportDocument()
Dim oRpt As New ReportDocument()

推荐答案


遇到同样的问题,到目前为止还没有真正看过很多关于它的帖子。

在zip文件中查看相同的代码安装目录,看起来它们大大改变了crystal报告处理参数的方式。您现在需要将参数保存为会话变量,以便在进行回发时调用它们。

running into this same problem, and have not really seen many posting so far about it.

Looking at the same code install directory in a zip file, it looks like they massivly changed the way crystal reports handle parameters.  You now need to save the parameters as session variables so you can recall them when you do a postback.


这篇关于V 2008 - 回发时晶体参数丢失(报告刷新)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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