Answered How to use ReportingServices2006 service

  • 2012年4月12日 11:37
     
     

    Hi I'm working on a windows application vs2008 fw 3.5,

    I need export reports hosted on sharepoint 2007 so I have ssrs installed as integrated mode and sharepoint  2007 installed on the same machine windows 2008 server.

    On my dev machine have also ssrs installed for testing pourpose installed as native mode (no sharepoint on dev machine),

    now from my app I'm able to access to ssrs service, loadding and exporting a report to filesystem as .pdf format.

    To do that I'm using the using Microsoft.SqlServer.ReportingServices2005 name space and it's ok but I need todo the same 

    to the sharepoint machine and I read around that I need to use ReportingServices2006 instead but I dont undestand how to use this,

    I mean ReportingServices2006 it's not into the same namespace Microsoft.SqlServer, I try to added web reference from the sharepoint machine so I have a proxy but I do not understand how to use this and no example I found.

    Here the code to call ssrs native mode and this work:

     private void CallWithOutParameters()
            {
                try
                {
                    ReportExecutionService rs = new ReportExecutionService();
                    rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    rs.Url = txtUrl.Text;

                    // Render arguments
                    byte[] result = null;
                    string reportPath = txtReportPath.Text;
                    string format = cboFormat.Text;
                    string historyID = null;
                    string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

                    Microsoft.SqlServer.ReportingServices2005.Execution.DataSourceCredentials[] credentials = null;
                    string showHideToggle = null;
                    string encoding;
                    string mimeType;
                    string extension;
                    Microsoft.SqlServer.ReportingServices2005.Execution.Warning[] warnings = null;
                    WinRepServConsumer.ReportingService2005.ParameterValue[] reportHistoryParameters = null;

                    string[] streamIDs = null;

                    ExecutionInfo execInfo = new ExecutionInfo();
                    ExecutionHeader execHeader = new ExecutionHeader();

                    rs.ExecutionHeaderValue = execHeader;

                    execInfo = rs.LoadReport(reportPath, historyID);

                    String SessionId = rs.ExecutionHeaderValue.ExecutionID;

                    OutPut("SessionID: " + rs.ExecutionHeaderValue.ExecutionID);

                    try
                    {
                        result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);

                        execInfo = rs.GetExecutionInfo();

                        OutPut("Execution date and time: " + execInfo.ExecutionDateTime);
                    }

                    catch (System.Web.Services.Protocols.SoapException ex)
                    {
                        OutPut(ex.Detail.OuterXml);
                    }


                    // Write the contents of the report to an MHTML file.
                    try
                    {
                        FileStream stream = File.Create(txtOutputPath.Text, result.Length);
                        Console.WriteLine("File created.");
                        stream.Write(result, 0, result.Length);
                        Console.WriteLine("Result written to the file.");
                        stream.Close();
                    }
                    catch (Exception exx)
                    {
                        OutPut("Error: " + exx.Message);
                    }

                }

                catch (Exception ex)
                {
                    OutPut("Error: " + ex.Message);
                    return;
                }

                OutPut("CALL OK");

            }

    Can somebody help me to understand how do  I do that Please.

    Gianni


    Gioking http://social.msdn.microsoft.com/Forums/en-US/user


    • 已编辑 Gioking 2012年4月12日 12:01
    •  

全部回复

  • 2012年4月13日 5:33
     
     

    The ReportService2005 endpoint is used for managing objects on a report server that is configured for native mode. The ReportService2006 endpoint is used for managing objects on a report server that is configured for SharePoint integrated mode.

    The ReportService2010 endpoint merges the functionalities of ReportService2005 and ReportService2006 and can manage objects on a report server that that are configured for either native or SharePoint integrated mode.

    The ReportService2005 and ReportService2006 endpoints are deprecated in SQL Server 2008 R2. The ReportService2010 endpoint includes the functionalities of both endpoints and contains additional management features.

    But based on the code that is specified, it looks like you are using ReportExecution2005 endpoint. This endpoint is used to customize report processing and rendering from a report server in both native and SharePoint integrated modes. So, I don’t think you need to make any modifications to your code. This should even work for SharePoint integrated mode.

    To conclude:

    ReportService2010 endpoint      :               For Managing features.

    ReportExecution2005 endpoint :               For customizing Report processing and rendering.

    Hope this helps..


    Chaitanya( Twitter | Blogs )

    Any documentation bug? Tell us about it at Connect. Please feel free to add any community comments in any of the MSDN/technet articles.
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • 2012年4月13日 7:53
     
     

    Thanks for replay Chaitanya Medikonduri

    Becouse I see on this link http://msdn.microsoft.com/en-us/library/bb326209(v=sql.100).aspx the followung table ? maybe I mistake something !

    Proxy Endpoint

    Description

    ReportService2006

    Provides the APIs for managing a report server that is configured for SharePoint integrate mode.

    ReportExecution2005

    Provides the APIs for execution and navigation of reports.

    ReportServiceAuthentication

    Provides the APIs for authenticating users against a report server when the SharePoint Web Application is configured for Forms Authentication.

    Anyway Assuming I have a sub site called subsite into witch I have a document library called reports like this: http://win2008srv:43044/subsite/Reports/Forms/AllItems.aspx, how is the path I must specifi to reach the report eg. Report1 ?

    here the screen shot of sharepoint 2007 document library:

    aaa

    Becouse I get the following error:

    The path of the item '/Report1' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. ---> Microsoft.ReportingServices.Diagnostics.Utilities.InvalidItemPathException: The path of the item '/Report1' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash.

    I get the same error also if the path is without / or Reports/Report1

    Thank you for your help

    Gianni




    Gioking http://social.msdn.microsoft.com/Forums/en-US/user


    • 已编辑 Gioking 2012年4月13日 8:10
    •  
  • 2012年4月17日 8:56
    版主
     
     已答复
    Hi Gioking,

    Based on the error message, the URL is invalid. Please refer to the following format to open a specify report:
    http://ServerName:PortNumber/Sharepoint_Library/ReportName.rdl
    (Please note that the report must include “.rdl” extension)

    By the way, there is a thread about using URL access report and export to other format in SharePoint Integration mode for your reference. Please see:
    http://social.technet.microsoft.com/Forums/en/sqlreportingservices/thread/29533073-e605-4c19-bbdf-e1449465112e

    Regards,
    Bin Long

    Bin Long

    TechNet Community Support

  • 2012年4月17日 12:20