Microsoft报表视图出现问题 [英] problem with Microsoft report view

查看:78
本文介绍了Microsoft报表视图出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Microsoft报表查看器时遇到问题
我有一个通过Sqlserver 2005托管在本地主机中的数据库,我想通过VS 2008使用报表查看器来生成有关该数据库的报表.
当我尝试此操作并将报表表单作为主要的启动表单时,它可以正常工作,并且报表可以显示正确的数据
当我尝试制作具有按钮的普通启动表单时,此按钮的功能是显示报告表单并以该表单显示报告
当我尝试执行此操作时,程序在尝试打开报告表单时关闭
当我调试它时,我发现当它到达刷新报告的代码行时,程序将终止
启动表单中按钮的代码为:

 Displayreport Ldisplay =  Displayreport(); //  Displayreport是////报表的形式
Ldisplay.Show(); // 显示表格 



表单承包商中的代码为:

  .DataTable1TableAdapter.Fill( .DataSet1.DataTable1,client_ID) ;
 .reportViewer1.RefreshReport(); // 此处程序已终止 



[edit]添加了代码块-OriginalGriff [/edit]

解决方案

从那开始?我们不能做很多.
我能提出的最好建议是,您通过调试器运行此代码,并将其设置为捕获所有异常.
希望报表查看器抛出一个未经处理的程序,这就是终止该应用程序的原因.
如果您查看VS菜单栏,则在调试"下的异常"下,勾选对话框中的每个框,然后按确定",然后运行调试器,看看是否有任何效果.


I have a problem with Microsoft report viewer
I have a database hosted in localhost through Sqlserver 2005 and I want to make a report about it using report viewer through VS 2008
When I tried this and make the report form as a main startup form it works fine and the report displayed with the right data fine
When I tried to make a normal start up form that has a button, this button''s function is to show a report form and display the report in this form
When I tried this the program is closed when it tries to open the report form
When I debug it I found that when it reach the code line that refresh the report the program is terminated
The code of the button in the startup form is:

Displayreport  Ldisplay = new Displayreport ();//Displayreport is the form //of the report
Ldisplay.Show();//show the form



And the code in the constractor of the form is:

this.DataTable1TableAdapter.Fill(this.DataSet1.DataTable1, client_ID);
this.reportViewer1.RefreshReport(); //here the program is terminated



[edit]Code blocks added - OriginalGriff[/edit]

解决方案

From that? Not a lot we can do.
The best suggestion I can come up with is that you run this through the debugger, and set it to catch all exceptions.
Hopefully, the report viewer is throwing one that is no handled, and that is what is terminating the app.

If you look on the VS menu bar, under "Debug" is "Exceptions" Tick every box in the dialog, and press OK, then run through the debugger and see if you get anything.


这篇关于Microsoft报表视图出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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