Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在运行时连接到共享数据源_C#_Asp.net_Reporting Services_Ssrs 2008_Reportviewer - Fatal编程技术网

C# 在运行时连接到共享数据源

C# 在运行时连接到共享数据源,c#,asp.net,reporting-services,ssrs-2008,reportviewer,C#,Asp.net,Reporting Services,Ssrs 2008,Reportviewer,我正在编写一个报表生成器程序,该程序类似于Microsoft的,但要托管在现有的web应用程序上。它应该能够: 连接报表服务器SSRS2008和预配置的共享数据源; 让用户设计RDLCs;和 无需Visual Studio即可动态生成报告。 基本上,它是一个独立但专有的报告生成工具 用户不必是报表编写者,但他们是否了解数据库中数据的关联方式。表之间存在现有关系。出于某些原因,他们不能或不应该访问SSRS站点以从那里生成报告,即使用Microsoft的Report Builder工具。他们必须使用

我正在编写一个报表生成器程序,该程序类似于Microsoft的,但要托管在现有的web应用程序上。它应该能够:

连接报表服务器SSRS2008和预配置的共享数据源; 让用户设计RDLCs;和 无需Visual Studio即可动态生成报告。 基本上,它是一个独立但专有的报告生成工具

用户不必是报表编写者,但他们是否了解数据库中数据的关联方式。表之间存在现有关系。出于某些原因,他们不能或不应该访问SSRS站点以从那里生成报告,即使用Microsoft的Report Builder工具。他们必须使用我正在创建的工具

最后两颗子弹我已经用完了。第一个问题给了我一个问题:我对这一点比较陌生,可能这不是小事。如何在运行时连接到SSRS2008数据源

在我的web.config中,我向ConnectionString添加了一个条目,如下所示:

<add name="ReportingSDS" connectionString="Server=http://myReportingServer;datasource=http://myReportingServer/reportserver/models/myReportModel.smdl;Integrated Security=True"/>
我得到的错误是:

运行时发生与网络相关或特定于实例的错误 正在建立与SQL Server的连接。找不到服务器,或者 无法访问。验证实例名称是否正确,以及 SQL Server配置为允许远程连接。提供者:已命名 管道提供程序,错误:40-无法打开到SQL Server的连接

我的目标是检索该数据集并将其插入此代码段:

using (var memRDLC = new MemoryStream(Encoding.ASCII.GetBytes(myRdlcXml)))
{
    // Bind the rdl memory stream and data set to reportviewer
    rptViewer.ProcessingMode = ProcessingMode.Local;

    LocalReport r = rptViewer.LocalReport;
    r.LoadReportDefinition(memRDLC);
    foreach (DataTable dataTable in reportEngine.DataTables)
    {
        r.DataSources.Add(new ReportDataSource(
            dataTable.TableName + "_Table", dataTable));
    }
    r.Refresh();
}
using (var memRDLC = new MemoryStream(Encoding.ASCII.GetBytes(myRdlcXml)))
{
    // Bind the rdl memory stream and data set to reportviewer
    rptViewer.ProcessingMode = ProcessingMode.Local;

    LocalReport r = rptViewer.LocalReport;
    r.LoadReportDefinition(memRDLC);
    foreach (DataTable dataTable in reportEngine.DataTables)
    {
        r.DataSources.Add(new ReportDataSource(
            dataTable.TableName + "_Table", dataTable));
    }
    r.Refresh();
}