Reporting Services and VB .Net

  • Hello,

    does anyone know if there is a possibility to load a report out of VB .Net? And how would you do this? And is it possible to pass variables to such a project which I would like to use as a filter for a sql statement?

    I know that you can call an Integration Services project with variables from VB but how about a report?

    That's how I call an SSIS project from VB and that's exactly what I need for a report:

    Imports Microsoft.SqlServer.Dts.Runtime

    Dim pkgLocation As String

    Dim pkg As New Package

    Dim app As New Application

    Dim pkgResults As DTSExecResult

    Dim TestValue As String

    pkgLocation = "..."

    pkg = app.LoadPackage(pkgLocation, Nothing)

    pkg.Variables("Variable1").Value = TestValue

    pkgResults = pkg.Execute()

    Thanks

    MlllG

  • Yes, it's possible.

    Drop a ReportViewer control onto you web page or form.

    Here is the code I use in asp.net:

    this.ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;

    this.ReportViewer1.ServerReport.ReportServerUrl = new Uri("Your URL for the report server");

    this.ReportViewer1.ServerReport.ReportPath = "/YourPath/YourReportName";

    ReportParameter[] parm = new ReportParameter[1];

    parm[0] = new ReportParameter("Your Parm Name", Your Parm Value, false);

    ReportViewer1.ServerReport.SetParameters(parm);

    this.ReportViewer1.ServerReport.Refresh();

  • Or you can use the .Render method to generate a stream straight to the page

  • Hi Si,

    Will you give some detail on how to use the .render method as you describe?

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply