sql server report aand web service

  • I have a couple of questions to ask you about a sql server reporting service connecting to a webservice within the DMZ. I am asking this

    question since I want to avoid the double hop problems that occur by using IIS on sql server 2005. (This is when you use windows authenication

    in sql server 2005 to connect to IIS.)

    Right now my company is using sql server 2005 and may upgrade to sql server 2008 within the next couple of months.

    The following questions pertain to using sql server 2005 and visual studio.net 2005:

    1. If I want to have sql server report service 2005 connect to web service within the DMZ, is this possible? If so, are there URLS and/or

    books that I can look at that would be able to answer this question?

    2. If question #1 is not possible, could I create a asp.net web page that would use some kind of a viewer contol that could display the sql

    server reporting service 2005 reports? This asp.net web page would then send the reports to a web service within the DMZ?

    I want to use the web service so that the reports can be opened up on the internet.

    The following questions pertain to using sql server 2008 and visual studio.net 2008:

    (I know that sql server 2008 does not use IIS. There is an http/system url that is used instead.

    1. If I want to have sql server report service 2008 connect to web service within the DMZ, is this possible? If so, are there URLS and/or

    books that I can look at that would be able to answer this question?

    2. If question #1 is not possible, could I create a asp.net web page that would use some kind of a viewer contol that could display the sql

    server reporting service 2008 reports? This asp.net web page would then send the reports to a web service within the DMZ?

    Thanks in advance!

  • Hi,

    Are you looking to consume web service (reporting Service) by an asp.net page and expose reports directly from reporting server.

    Have a look at this piece of code.

    Add a web Reference to the ReportService to your solution...Something this this

    //<servername>/<reportserver>/ReportService.asmx?wsdl

    and name the reference as RSWebService.

    Using RSWebService:

    protected void btnGenerateReport_Click(object sender, EventArgs e)

    {

    ReportingService rs = new ReportingService();

    string ReportID = "/Reports/ReportName";

    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

    byte[] ResultStream;// bytearray for result stream

    string[] StreamIdentifiers;// string array for stream idenfiers

    bool forRendering = true;

    string historyID = null;

    DataSourceCredentials[] credentials = null;

    string OptionalParam = null;// string out param for optional parameters

    ParameterValue[] values = null; // parametervalue array for optional parameters

    Warning[] optionalWarnings = null; // warning array for optional warnings

    ReportParameter[] _parameters = null;

    _parameters = rs.GetReportParameters

    (

    ReportID,

    historyID,

    forRendering,

    values,

    credentials

    );

    values = new ParameterValue[3];

    values[0] = new ParameterValue();

    values[0].Name = _parameters[0].Name;

    values[0].Value = DateTime.Now.ToString();

    values[1] = new ParameterValue();

    values[1].Name = _parameters[1].Name;

    values[1].Value = txtStartDate.Text.ToString();

    values[2] = new ParameterValue();

    values[2].Name = _parameters[2].Name;

    values[2].Value = txtEndDate.Text.ToString();

    _parameters = rs.GetReportParameters

    (

    ReportID,

    historyID,

    forRendering,

    values,

    credentials

    );

    rs.SetReportParameters(ReportID, _parameters);

    ResultStream = rs.Render(ReportID, "HTML4.0", null,

    "<DeviceInfo><Toolbar>True</Toolbar><HTMLFragment>True</HTMLFragment></DeviceInfo>",

    null, null, null, out OptionalParam, out OptionalParam, out values,

    out optionalWarnings, out StreamIdentifiers);

    // Write the report to Response

    Response.BinaryWrite(ResultStream);

    }

    Let me know in case of any issues.

    Regards,

    Pradeep

  • I want to send the asp.net web page or sql server report 2005 or possibly 2008 to a web service within a DMZ. I then want to allow users to see the results of the web service that is exposed to the internet. Basically the web service in the DMZ could be consumed and/or users could just look at the results in the DMZ.

  • The plan is to have a sql server service report 2005 or 2008 call a web service within the DMZ. The web service within the DMZ would be exposed to the internet to display reports to users. The reports could be consumed by I am not certain how that would be posssible.

    I will try your code suggestions!

    Thanks!

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

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