.rdlc子报表出现问题 [英] Problem with .rdlc Sub Report

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

问题描述

大家好

我在我的项目中使用rdlc报告.工作正常.
但是我正在使用子报告,并且在我的本地服务器上工作正常.但是在服务器上给出了错误.

Hello All

I am using rdlc reports in my project. It was working fine.
But I am using sub report and it is working fine on my local server. But giving error on server.

An error has occurred during report processing.
    Exception has been thrown by the target of an invocation.
        A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)



我的子报表不包含任何参数,我正在使用以下代码为报表查看器找到子报表



My sub report don''t contain any parameter and i am using following code to find subreport for report viewer

protected void Page_Load(object sender, EventArgs e)
   {
       this.ReportViewer1.LocalReport.EnableExternalImages = true;
       ReportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource);
       this.ReportViewer1.LocalReport.Refresh();
   }
   public void SetSubDataSource(object sender, SubreportProcessingEventArgs e)
   {
       e.DataSources.Add(new ReportDataSource("TermsDataSet_TERMS", "ObjectDataSource3"));
   }




任何人都可以建议我该错误在哪里吗?

在此先感谢




Can anyone please suggest me where the bug is?

Thanks in advance

推荐答案

该子报表的数据未正确提供.
与SQL的连接可能有问题,这似乎就是这里的原因.验证以下两个设置:

1-检查reportdatasource对象是否配置正确(连接字符串等.)
2-子报表的数据源指向正确的数据源.

希望对您有帮助...
Data for the subreport is not supplied properly.
The connection with SQL may have issues and that''s what seems to be the reason here. Verify these two settings:

1- Check the reportdatasource object is configured properly (connection string etc..)
2- The datasource of the subreport is pointing to the right datasource.

Hope it helps...


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

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