Mega Search
23.2 Million


Sign Up

Make a donation  
Any sample code calling Sql Server Reporting Services (SSRS)  
News Group: embarcadero.public.delphi.webservices

I've never used Web-service calls using Delphi and wondered if ANYONE has any sample code out there that shows how to interface with Microsoft SQL Server Reporting Services (SSRS) Web-service?  I did a WSDL import of the local service on our servers here into my Delphi app, but now I'm stumped as to how i interface with the service.  Anyone? Bueller? Bueller?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 28-Sep-2009, at 11:38 AM EST
From: James Grace
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=James Grace wrote:}{quote}
> I've never used Web-service calls using Delphi and wondered if ANYONE has any sample code out there that shows how to interface with Microsoft SQL Server Reporting Services (SSRS) Web-service?  I did a WSDL import of the local service on our servers here into my Delphi app, but now I'm stumped as to how i interface with the service.  Anyone? Bueller? Bueller?

You can use the endpoint to create a WSDL from MSSQL Server.
Please read about the endpoint in the Book Online.
I hope this can help your problem.

To create a WSDL from MSSQL there are some rules that you should know.
Please join in http://www.sqlservercentral.com to get more specific.

cheers,


Eko Indriyawan

--
Blog: http://ekoindri.com/
Specialization Expertise:MS SQL Server, Web Service, Accounting

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 28-Sep-2009, at 4:20 PM EST
From: Eko Indriyawan
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
Thanks for the quick response, Eko.  However, I have successfully generated a WSDL import of the SSRS Web-service on our local reporting server and can address that namespace, however I don't have any code as to how to interact with the SSRS web-service and wondered if perhaps someone may have interacted with the service in Delphi to generate reports (in my case, a PDF into a file folder on the server).  

James

> {quote:title=Eko Indriyawan wrote:}{quote}
> > {quote:title=James Grace wrote:}{quote}
> > I've never used Web-service calls using Delphi and wondered if ANYONE has any sample code out there that shows how to interface with Microsoft SQL Server Reporting Services (SSRS) Web-service?  I did a WSDL import of the local service on our servers here into my Delphi app, but now I'm stumped as to how i interface with the service.  Anyone? Bueller? Bueller?
> 
> You can use the endpoint to create a WSDL from MSSQL Server.
> Please read about the endpoint in the Book Online.
> I hope this can help your problem.
> 
> To create a WSDL from MSSQL there are some rules that you should know.
> Please join in http://www.sqlservercentral.com to get more specific.
> 
> cheers,
> 
> 
> Eko Indriyawan
> 
> --
> Blog: http://ekoindri.com/
> Specialization Expertise:MS SQL Server, Web Service, Accounting

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 29-Sep-2009, at 8:13 AM EST
From: James Grace
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=Jean-Marie Babet wrote:}{quote}
> Hello James,
> 
> Unless someone has specifically worked with that service... it's best to 
> post any info you have. For example, if you have a WSDL and any 
> documentation... we can figure out whether/how it will work with Delphi SOAP 
> (I've done for many many services that I never use).
> 
> And additionally, Eko reported that our importer has problems with WSDLs 
> generated by MSSQL. I'm particularly interested in investigating that issue. 
> So I would be grateful to have a copy of an MSSQL WSDL to look into that 
> issue - and help also explain how the interface exposed by the service could 
> be invoked with Delphi.
> 
> Cheers,
> 
> Bruneau

Gladly, ... I'll copy the Namespace created by the WSDL Import below ... Google (or Bing) SSRS WebService for examples of how to call the service via VB.Net
Merci, Bruneau

James
***************************************************************
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://sql-report/reportserver/reportexecution2005.asmx
// Encoding : utf-8
// Version  : 1.0
// (9/28/2009 11:13:47 AM - 16.03.2006)
// ************************************************************************ //

unit reportexecution2005;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"
  // !:base64Binary    - "http://www.w3.org/2001/XMLSchema"
  // !:boolean         - "http://www.w3.org/2001/XMLSchema"
  // !:dateTime        - "http://www.w3.org/2001/XMLSchema"
  // !:int             - "http://www.w3.org/2001/XMLSchema"
  // !:double          - "http://www.w3.org/2001/XMLSchema"

  ExecutionHeader      = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices"[H] }
  ServerInfoHeader     = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices"[H] }
  TrustedUserHeader    = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices"[H] }
  ReportParameter      = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ValidValue           = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  DataSourcePrompt     = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ReportMargins        = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ReportPaperSize      = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  PageSettings         = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ExecutionInfo        = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  Warning              = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  DataSourceCredentials = class;                { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ParameterValueO
rFieldReference = class;       { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ParameterValue       = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  DocumentMapNode      = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  Extension            = class;                 { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }

  { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ParameterTypeEnum = (Boolean_, DateTime, Integer_, Float, String_);

  { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ParameterStateEnum = (HasValidValue, MissingValidValue, HasOutstandingDependencies, DynamicValuesUnavailable);

  { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  SortDirectionEnum = (None, Ascending, Descending);

  { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ExtensionTypeEnum = (Delivery, Render, Data, All);

  ArrayOfString = array of WideString;          { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ExecutionHeader = class(TSOAPHeader)
  private
    FExecutionID: WideString;
  published
    property ExecutionID: WideString read FExecutionID write FExecutionID;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ServerInfoHeader = class(TSOAPHeader)
  private
    FReportServerVersionNumber: WideString;
    FReportServerEdition: WideString;
    FReportServerVersion: WideString;
    FReportServerDateTime: WideString;
  published
    property ReportServerVersionNumber: WideString read FReportServerVersionNumber write FReportServerVersionNumber;
    property ReportServerEdition: WideString read FReportServerEdition write FReportServerEdition;
    property ReportServerVersion: WideString read FReportServerVersion write FReportServerVersion;
    property ReportServerDateTime: WideString read FReportServerDateTime write FReportServerDateTime;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  TrustedUserHeader = class(TSOAPHeader)
  private
    FUserName: WideString;
    FUserToken: TByteDynArray;
  published
    property UserName: WideString read FUserName write FUserName;
    property UserToken: TByteDynArray read FUserToken write FUserToken;
  end;

  ArrayOfReportParameter = array of ReportParameter;   { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ArrayOfDataSourcePrompt = array of DataSourcePrompt;   { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ArrayOfString1 = array of WideString;         { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ArrayOfValidValue = array of ValidValue;      { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }
  ArrayOfString2 = array of WideString;         { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // *********************
*************************************************** //
  ReportParameter = class(TRemotable)
  private
    FName_: WideString;
    FType_: ParameterTypeEnum;
    FNullable: Boolean;
    FAllowBlank: Boolean;
    FMultiValue: Boolean;
    FQueryParameter: Boolean;
    FPrompt: WideString;
    FPromptUser: Boolean;
    FDependencies: ArrayOfString1;
    FValidValuesQueryBased: Boolean;
    FValidValues: ArrayOfValidValue;
    FDefaultValuesQueryBased: Boolean;
    FDefaultValues: ArrayOfString2;
    FState: ParameterStateEnum;
    FErrorMessage: WideString;
  public
    destructor Destroy; override;
  published
    property Name_: WideString read FName_ write FName_;
    property Type_: ParameterTypeEnum read FType_ write FType_;
    property Nullable: Boolean read FNullable write FNullable;
    property AllowBlank: Boolean read FAllowBlank write FAllowBlank;
    property MultiValue: Boolean read FMultiValue write FMultiValue;
    property QueryParameter: Boolean read FQueryParameter write FQueryParameter;
    property Prompt: WideString read FPrompt write FPrompt;
    property PromptUser: Boolean read FPromptUser write FPromptUser;
    property Dependencies: ArrayOfString1 read FDependencies write FDependencies;
    property ValidValuesQueryBased: Boolean read FValidValuesQueryBased write FValidValuesQueryBased;
    property ValidValues: ArrayOfValidValue read FValidValues write FValidValues;
    property DefaultValuesQueryBased: Boolean read FDefaultValuesQueryBased write FDefaultValuesQueryBased;
    property DefaultValues: ArrayOfString2 read FDefaultValues write FDefaultValues;
    property State: ParameterStateEnum read FState write FState;
    property ErrorMessage: WideString read FErrorMessage write FErrorMessage;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ValidValue = class(TRemotable)
  private
    FLabel_: WideString;
    FValue: WideString;
  published
    property Label_: WideString read FLabel_ write FLabel_;
    property Value: WideString read FValue write FValue;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  DataSourcePrompt = class(TRemotable)
  private
    FName_: WideString;
    FDataSourceID: WideString;
    FPrompt: WideString;
  published
    property Name_: WideString read FName_ write FName_;
    property DataSourceID: WideString read FDataSourceID write FDataSourceID;
    property Prompt: WideString read FPrompt write FPrompt;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ReportMargins = class(TRemotable)
  private
    FTop: Double;
    FBottom: Double;
    FLeft: Double;
    FRight: Double;
  published
    property Top: Double read FTop write FTop;
    property Bottom: Double read FBottom write FBottom;
    property Left: Double read FLeft write FLeft;
    property Right: Double read FRight write FRight;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ReportPaperSize = class(TRemotable)
  private
    FHeight: Double;
    FWidth: Double;
  published
    property Height: Double read FHeight write FHeight;
    property Width: Double read FWidth write FWidth;
  end;



  // ***************************************************
********************* //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  PageSettings = class(TRemotable)
  private
    FPaperSize: ReportPaperSize;
    FMargins: ReportMargins;
  public
    destructor Destroy; override;
  published
    property PaperSize: ReportPaperSize read FPaperSize write FPaperSize;
    property Margins: ReportMargins read FMargins write FMargins;
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ExecutionInfo = class(TRemotable)
  private
    FHasSnapshot: Boolean;
    FNeedsProcessing: Boolean;
    FAllowQueryExecution: Boolean;
    FCredentialsRequired: Boolean;
    FParametersRequired: Boolean;
    FExpirationDateTime: TXSDateTime;
    FExecutionDateTime: TXSDateTime;
    FNumPages: Integer;
    FParameters: ArrayOfReportParameter;
    FDataSourcePrompts: ArrayOfDataSourcePrompt;
    FHasDocumentMap: Boolean;
    FExecutionID: WideString;
    FReportPath: WideString;
    FHistoryID: WideString;
    FReportPageSettings: PageSettings;
    FAutoRefreshInterval: Integer;
  public
    destructor Destroy; override;
  published
    property HasSnapshot: Boolean read FHasSnapshot write FHasSnapshot;
    property NeedsProcessing: Boolean read FNeedsProcessing write FNeedsProcessing;
    property AllowQueryExecution: Boolean read FAllowQueryExecution write FAllowQueryExecution;
    property CredentialsRequired: Boolean read FCredentialsRequired write FCredentialsRequired;
    property ParametersRequired: Boolean read FParametersRequired write FParametersRequired;
    property ExpirationDateTime: TXSDateTime read FExpirationDateTime write FExpirationDateTime;
    property ExecutionDateTime: TXSDateTime read FExecutionDateTime write FExecutionDateTime;
    property NumPages: Integer read FNumPages write FNumPages;
    property Parameters: ArrayOfReportParameter read FParameters write FParameters;
    property DataSourcePrompts: ArrayOfDataSourcePrompt read FDataSourcePrompts write FDataSourcePrompts;
    property HasDocumentMap: Boolean read FHasDocumentMap write FHasDocumentMap;
    property ExecutionID: WideString read FExecutionID write FExecutionID;
    property ReportPath: WideString read FReportPath write FReportPath;
    property HistoryID: WideString read FHistoryID write FHistoryID;
    property ReportPageSettings: PageSettings read FReportPageSettings write FReportPageSettings;
    property AutoRefreshInterval: Integer read FAutoRefreshInterval write FAutoRefreshInterval;
  end;

  ArrayOfWarning = array of Warning;            { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  Warning = class(TRemotable)
  private
    FCode: WideString;
    FSeverity: WideString;
    FObjectName: WideString;
    FObjectType: WideString;
    FMessage_: WideString;
  published
    property Code: WideString read FCode write FCode;
    property Severity: WideString read FSeverity write FSeverity;
    property ObjectName: WideString read FObjectName write FObjectName;
    property ObjectType: WideString read FObjectType write FObjectType;
    property Message_: WideString read FMessage_ write FMessage_;
  end;

  ArrayOfDataSourceCredentials = array of DataSourceCredentials;   { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30
/reporting/reportingservices
  // ************************************************************************ //
  DataSourceCredentials = class(TRemotable)
  private
    FDataSourceName: WideString;
    FUserName: WideString;
    FPassword: WideString;
  published
    property DataSourceName: WideString read FDataSourceName write FDataSourceName;
    property UserName: WideString read FUserName write FUserName;
    property Password: WideString read FPassword write FPassword;
  end;

  ArrayOfParameterValue = array of ParameterValue;   { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ParameterValueOrFieldReference = class(TRemotable)
  private
  published
  end;



  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  ParameterValue = class(ParameterValueOrFieldReference)
  private
    FName_: WideString;
    FValue: WideString;
    FLabel_: WideString;
  published
    property Name_: WideString read FName_ write FName_;
    property Value: WideString read FValue write FValue;
    property Label_: WideString read FLabel_ write FLabel_;
  end;

  ArrayOfDocumentMapNode = array of DocumentMapNode;   { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  DocumentMapNode = class(TRemotable)
  private
    FLabel_: WideString;
    FUniqueName: WideString;
    FChildren: ArrayOfDocumentMapNode;
  public
    destructor Destroy; override;
  published
    property Label_: WideString read FLabel_ write FLabel_;
    property UniqueName: WideString read FUniqueName write FUniqueName;
    property Children: ArrayOfDocumentMapNode read FChildren write FChildren;
  end;

  ArrayOfExtension = array of Extension;        { "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices" }


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // ************************************************************************ //
  Extension = class(TRemotable)
  private
    FExtensionType: ExtensionTypeEnum;
    FName_: WideString;
    FLocalizedName: WideString;
    FVisible: Boolean;
    FIsModelGenerationSupported: Boolean;
  published
    property ExtensionType: ExtensionTypeEnum read FExtensionType write FExtensionType;
    property Name_: WideString read FName_ write FName_;
    property LocalizedName: WideString read FLocalizedName write FLocalizedName;
    property Visible: Boolean read FVisible write FVisible;
    property IsModelGenerationSupported: Boolean read FIsModelGenerationSupported write FIsModelGenerationSupported;
  end;


  // ************************************************************************ //
  // Namespace : http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices
  // soapAction: http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/%operationName%
  // transport : http://schemas.xmlsoap.org/soap/http
  // binding   : ReportExecutionServiceSoap
  // service   : ReportExecutionService
  // port      : ReportExecutionServiceSoap
  // URL       : http://sql-report/ReportServer/ReportExecution2005.asmx
  // ************************************************************************
 //
  ReportExecutionServiceSoap = interface(IInvokable)
  ['{4BB161A3-7DC7-8F74-1DBB-1C6E7E007373}']
    function  ListSecureMethods: ArrayOfString; stdcall;
    function  LoadReport(const Report: WideString; const HistoryID: WideString): ExecutionInfo; stdcall;
    procedure LoadReportDefinition(const Definition: TByteDynArray; out executionInfo: ExecutionInfo; out warnings: ArrayOfWarning); stdcall;
    function  SetExecutionCredentials(const Credentials: ArrayOfDataSourceCredentials): ExecutionInfo; stdcall;
    function  SetExecutionParameters(const Parameters: ArrayOfParameterValue; const ParameterLanguage: WideString): ExecutionInfo; stdcall;
    function  ResetExecution: ExecutionInfo; stdcall;
    function  Render(const Format: WideString; const DeviceInfo: WideString; out Extension: WideString; out MimeType: WideString; out Encoding: WideString; out Warnings: ArrayOfWarning; out StreamIds: ArrayOfString): TByteDynArray; stdcall;
    function  RenderStream(const Format: WideString; const StreamID: WideString; const DeviceInfo: WideString; out Encoding: WideString; out MimeType: WideString): TByteDynArray; stdcall;
    function  GetExecutionInfo: ExecutionInfo; stdcall;
    function  GetDocumentMap: DocumentMapNode; stdcall;
    function  LoadDrillthroughTarget(const DrillthroughID: WideString): ExecutionInfo; stdcall;
    function  ToggleItem(const ToggleID: WideString): Boolean; stdcall;
    function  NavigateDocumentMap(const DocMapID: WideString): Integer; stdcall;
    procedure NavigateBookmark(const BookmarkID: WideString; out PageNumber: Integer; out UniqueName: WideString); stdcall;
    function  FindString(const StartPage: Integer; const EndPage: Integer; const FindValue: WideString): Integer; stdcall;
    procedure Sort(const SortItem: WideString; const Direction: SortDirectionEnum; const Clear: Boolean; out PageNumber: Integer; out ReportItem: WideString; out NumPages: Integer); stdcall;
    function  GetRenderResource(const Format: WideString; const DeviceInfo: WideString; out MimeType: WideString): TByteDynArray; stdcall;
    function  ListRenderingExtensions: ArrayOfExtension; stdcall;
    procedure LogonUser(const userName: WideString; const password: WideString; const authority: WideString); stdcall;
    procedure Logoff; stdcall;
  end;

function GetReportExecutionServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ReportExecutionServiceSoap;


implementation

function GetReportExecutionServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): ReportExecutionServiceSoap;
const
  defWSDL = 'http://sql-report/reportserver/reportexecution2005.asmx';
  defURL  = 'http://sql-report/ReportServer/ReportExecution2005.asmx';
  defSvc  = 'ReportExecutionService';
  defPrt  = 'ReportExecutionServiceSoap';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as ReportExecutionServiceSoap);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


destructor ReportParameter.Destroy;
var
  I: Integer;
begin
  for I := 0 to Length(FValidValues)-1 do
    if Assigned(FValidValues[I]) then
      FValidValues[I].Free;
  SetLength(FValidValues, 0);
  inherited Destroy;
end;

destructor PageSettings.Destroy;
begin
  if Assigned(FPaperSize) then
    FPaperSize.Free;
  if Assigned(FMargins) then
    FMargins.Free;
  inherited Destroy;
end;

destructor ExecutionInfo.Destroy;
var
  I: Integer;
begin
  for I := 0 to Length(FParameters)-1 do
    if Assigned(FParameters[I]) then
      FParameters[I].Free;
  SetLength(FParameters, 0);
  for I := 0 to Length(FDataSourcePrompts)-1 do
    if Assigned(FDataSourc
ePrompts[I]) then
      FDataSourcePrompts[I].Free;
  SetLength(FDataSourcePrompts, 0);
  if Assigned(FExpirationDateTime) then
    FExpirationDateTime.Free;
  if Assigned(FExecutionDateTime) then
    FExecutionDateTime.Free;
  if Assigned(FReportPageSettings) then
    FReportPageSettings.Free;
  inherited Destroy;
end;

destructor DocumentMapNode.Destroy;
var
  I: Integer;
begin
  for I := 0 to Length(FChildren)-1 do
    if Assigned(FChildren[I]) then
      FChildren[I].Free;
  SetLength(FChildren, 0);
  inherited Destroy;
end;

initialization
  InvRegistry.RegisterInterface(TypeInfo(ReportExecutionServiceSoap), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'utf-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(ReportExecutionServiceSoap), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/%operationName%');
  InvRegistry.RegisterHeaderClass(TypeInfo(ReportExecutionServiceSoap), ServerInfoHeader, 'ServerInfoHeader', '');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ParameterTypeEnum), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ParameterTypeEnum');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ParameterTypeEnum), 'Boolean_', 'Boolean');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ParameterTypeEnum), 'Integer_', 'Integer');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ParameterTypeEnum), 'String_', 'String');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ParameterStateEnum), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ParameterStateEnum');
  RemClassRegistry.RegisterXSInfo(TypeInfo(SortDirectionEnum), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'SortDirectionEnum');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ExtensionTypeEnum), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ExtensionTypeEnum');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfString), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfString');
  RemClassRegistry.RegisterXSClass(ExecutionHeader, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ExecutionHeader');
  RemClassRegistry.RegisterXSClass(ServerInfoHeader, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ServerInfoHeader');
  RemClassRegistry.RegisterXSClass(TrustedUserHeader, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'TrustedUserHeader');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfReportParameter), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfReportParameter');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfDataSourcePrompt), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfDataSourcePrompt');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfString1), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfString1');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfValidValue), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfValidValue');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfString2), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfString2');
  RemClassRegistry.RegisterXSClass(ReportParameter, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ReportParameter');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ReportParameter), 'Name_', 'Name');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ReportParameter), 'Type_', 'Type');
  RemClassRegistry.RegisterXSClass(ValidValue, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ValidValue');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ValidValue), 'Label_', 'Label');
  RemClassRegistry.RegisterXSClass(DataSourcePrompt, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'DataSourcePrompt');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(DataSourcePrompt), 'Name_', 'Name');
  RemClassRegistry.RegisterXSClass(ReportMargins, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ReportMargins');
  RemClassRegistry.RegisterXSClass(ReportPaperSize, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ReportPaperSize');
  RemClassRegistry.RegisterXSClass(PageSettings, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'PageSettings');
  RemClassRegistry.RegisterXSClass(ExecutionInfo, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ExecutionInfo');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfWarning), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfWarning');
  RemClassRegistry.RegisterXSClass(Warning, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'Warning');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(Warning), 'Message_', 'Message');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfDataSourceCredentials), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfDataSourceCredentials');
  RemClassRegistry.RegisterXSClass(DataSourceCredentials, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'DataSourceCredentials');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfParameterValue), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfParameterValue');
  RemClassRegistry.RegisterXSClass(ParameterValueOrFieldReference, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ParameterValueOrFieldReference');
  RemClassRegistry.RegisterXSClass(ParameterValue, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ParameterValue');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ParameterValue), 'Name_', 'Name');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(ParameterValue), 'Label_', 'Label');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfDocumentMapNode), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfDocumentMapNode');
  RemClassRegistry.RegisterXSClass(DocumentMapNode, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'DocumentMapNode');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(DocumentMapNode), 'Label_', 'Label');
  RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfExtension), 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'ArrayOfExtension');
  RemClassRegistry.RegisterXSClass(Extension, 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices', 'Extension');
  RemClassRegistry.RegisterExternalPropName(TypeInfo(Extension), 'Name_', 'Name');

end.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 9-Oct-2009, at 8:00 AM EST
From: James Grace
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
Hello James,

Now, I'm learning to SSRS, if successful I'll let you know.
If not I reply to this thread, then I still fail.


Best Regards,


Eko Indriyawan

--
Blog: http://ekoindri.com/
Specialization Expertise:MS SQL Server, Web Service, Accounting

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 1-Oct-2009, at 12:15 PM EST
From: Eko Indriyawan
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=Jean-Marie Babet wrote:}{quote}
> Hello James,
> 
> Unless someone has specifically worked with that service... it's best to 
> post any info you have. For example, if you have a WSDL and any 
> documentation... we can figure out whether/how it will work with Delphi SOAP 
> (I've done for many many services that I never use).
> 
> And additionally, Eko reported that our importer has problems with WSDLs 
> generated by MSSQL. I'm particularly interested in investigating that issue. 
> So I would be grateful to have a copy of an MSSQL WSDL to look into that 
> issue - and help also explain how the interface exposed by the service could 
> be invoked with Delphi.
> 
Hello Bruneau,

Please check your email, I've sent you an email

Best Regards,


Eko Indriyawan

--
Blog: http://ekoindri.com/
Specialization Expertise:MS SQL Server, Web Service, Accounting

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 8-Oct-2009, at 3:06 PM EST
From: Eko Indriyawan
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
Bruneau, 

Apologies for the delayed reply... I worked my way around this problem by using the RS.EXE (via Delphi ShellExecute) to create and store my PDF's.  It looks like RS.EXE is smart enough to transact with the Web-service to generate my reports.  Not quite as efficient as a direct Delphi call to the SSRS web-service but at least it works.

The version of Delphi is  Borland Developer Studio 2006 Win.

Jim 

> {quote:title=Jean-Marie Babet wrote:}{quote}
> Hello,
> 
> Thanks for the Delphi binding generated by the importer. What version of 
> Delphi are you using? I'm asking because I find the binding generated by the 
> importer a little strange. It's lacking something that I would expect. 
> Typically, in the initialization section I would expect to see the 
> following:
> 
> 
>   InvRegistry.RegisterInvokeOptions(TypeInfo(ReportExecutionServiceSoap), 
> ioDocument);
> 
> 
> Without that line, the SOAP runtime will treat the service as an rpc|encoded 
> service - which is an older standard that I doubt SSRS is using. I know that 
> earlier versions of our importer had problems detecting newer document style 
> services. So I'm suspecting that maybe you have an earlier version of the 
> importer. It's possible also that I'm wrong and that the WebService is an 
> rpc|encoded service but I would be very very surprised if that were the 
> case.
> 
> That said looking at the methods in interface in the Delphi binding (i.e. 
> ReportExecutionServiceSoap) I assume that the first one does is call the 
> 'LogonUser' method. I then went online to look for LogonUser and found this:
> 
> 
>     http://msdn.microsoft.com/en-us/library/aa225885(SQL.80).aspx
> 
> 
> The online matches the Delphi one:
> 
> VB
> Public Sub LogonUser( _
>    ByVal userName As String _
>    ByVal password As String _
>    ByVal authority As String _
> )
> 
> 
> Delphi
>     procedure LogonUser(const userName: WideString; const password: 
> WideString; const authority: WideString); stdcall;
> 
> 
> The typical Delphi code to invoke the above would read as follows:
> 
> 
> procedure TForm1.Button2Click(Sender: TObject);
> var
>   Service: ReportExecutionServiceSoap;
> begin
>   Service := GetReportExecutionServiceSoap(False, '', HTTPRIO1);
>   Service.LogonUser('Put Your Username Here',
>                     'Put the Password Here',
>                     '');
> 
> end;
> 
> 
> 
> Can you confirm whether the above works for you? And if possible, could you 
> email me a copy of the WSDL - I'm curious about my suspicion of a document 
> style service not being correctly identified? Thank you.
> 
> Cheers,
> 
> Bruneau

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Oct-2009, at 8:59 AM EST
From: James Grace
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=James Grace wrote:}{quote}
> I've never used Web-service calls using Delphi and wondered if ANYONE has any sample code out there that shows how to interface with Microsoft SQL Server Reporting Services (SSRS) Web-service?  I did a WSDL import of the local service on our servers here into my Delphi app, but now I'm stumped as to how i interface with the service.  Anyone? Bueller? Bueller?

I know this is very late in this thread, but I searched for ages on the web and couldn't find any example code for interfacing with Reporting Services. Here's some I hacked together, hope someone finds it useful:

{code}
uses ReportService2005, ReportExecution2005, SoapHTTPClient; 
// get reportservice2005 and reportexecution2005 by importing the appropriate wsdl

procedure SaveSSRSReportToFile(const APDFFileName: string);
const
  ServiceURL = 'http://SQLSERVER2005/reportserver/ReportService2005.asmx';
  ExecURL = 'http://SQLSERVER2005/reportserver/ReportExecution2005.asmx';
  ReportName = '/Folder 1/Folder 2/Folder 3/A Long Report Name';
var
  args: array[0..4] of string;
  rs: ReportService2005.ReportingService2005Soap;
  rsExec: ReportExecution2005.ReportExecutionServiceSoap;
  GRParams: ReportService2005.GetReportParameters;
  RepParamsResponse: ReportService2005.GetReportParametersResponse;
  LRParams: ReportExecution2005.LoadReport;
  LoadParamsResponse: ReportExecution2005.LoadReportResponse;
  i: Integer;
  setParams: ReportExecution2005.SetExecutionParameters;
  setParamValues: ReportExecution2005.ArrayOfParameterValue;
  renderParams: ReportExecution2005.Render;
  renderResponse: ReportExecution2005.RenderResponse;
  setParamsResponse: ReportExecution2005.SetExecutionParametersResponse;
  fileStream: TFileStream;
  execHeader, renderHeader: ReportExecution2005.ExecutionHeader;
  HTExec: THttpRIO;
begin
  args[0] := 'Param1'; // note params need to be correct length (I had one that was 3 characters, but was only passing two, needed a trailing space to make it work)
  args[1] := 'Param2';
  args[2] := 'Param3';
  args[3] := 'Null';   // "Null" is just a bit of text that is used below to create a "Null" parameter
  GRParams := GetReportParameters.Create;
  setParams := SetExecutionParameters.Create;
  LRParams := LoadReport.Create;
  renderParams := Render.Create;
  execHeader := ExecutionHeader.Create;
  renderHeader := ExecutionHeader.Create;
  HTExec :=  tHttpRio.Create(nil);
  try
    rs := GetReportingService2005Soap(False, ServiceURL);
    rsExec := GetReportExecutionServiceSoap(False, ExecURL, HTExec);
    try
      GRParams.Report := ReportName;
      GRParams.ForRendering := False;
      RepParamsResponse := rs.GetReportParameters(GRParams);

      // Fill the Parameters to call in the SetExecutionParameters later
      SetLength(setParamValues, Length(RepParamsResponse.Parameters));
      for i := 0 to Length(RepParamsResponse.Parameters)-1 do
      begin
        setParamValues[i] := ParameterValue.Create;
        setParamValues[i].Name_ := RepParamsresponse.Parameters[i].Name_;
        if args[i] <> 'Null' then // do not set the param if you want it to be null
          setParamValues[i].Value := args[i];
      end;
      setParams.ParameterLanguage := 'en-us';
      setParams.parameters := setParamValues;

      // Load the selected report.
      LRParams.Report := ReportName;
      LoadParamsResponse := rsExec.LoadReport(LRParams);

      // Send ExecutionHeader
      execHeader.ExecutionID := LoadParamsResponse.executionInfo.ExecutionID;
      HTExec.SOAPHeaders.Send(execHeader);

      // Set the Parameters
      setParamsResponse := rsExec.SetExecutionParameters(setParams);
      renderParams.Format := 'PDF';

      // Send RenderHeader
      renderHeader.ExecutionID := setParamsResponse.executionInfo.ExecutionID;
      HTExec.SOAPHeaders.Send(renderHeader);
      renderResponse := rsExec.Render(renderParams);
      fileStream := TFileStream.Create(APDFFileName, fmCreate);
      try
        fileStream.Write(renderResponse.Result[0], Length(renderResponse.Result));
      finally
        FreeAndNil(fileStream);
      end;
    except
      on E: Exception do
      begin
        ShowMessage(E.Message);
      end;
    end;
  finally
    GRParams.Free;
    setParams.Free;
    LRParams.Free;
    renderParams.Free;
    renderHeader.Free;
    execHeader.Free;
    RepParamsResponse.Free;
    LoadParamsResponse.Free;
    setParamsResponse.Free;
    renderResponse.Free;
    for i := 0 to Length(setParamValues) - 1 do
      setParamValues[i].Free;
    SetLength(setParamValues, 0);
    //FreeAndNil(HTExec);
    rs := nil;
    rsExec := nil;
  end;
end;
{code}

Edited by: Pat Buxton on Mar 2, 2011 7:50 AM

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Mar-2011, at 11:52 AM EST
From: Anonymous
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=Pat Buxton wrote:}{quote}
> 
> I know this is very late in this thread, but I searched for ages on the web and couldn't find any example code for interfacing with Reporting Services. Here's some I hacked together, hope someone finds it useful:
> 
> {code}
> uses ReportService2005, ReportExecution2005, SoapHTTPClient; 
> // get reportservice2005 and reportexecution2005 by importing the appropriate wsdl
> 
> procedure SaveSSRSReportToFile(const APDFFileName: string);
> const
>   ServiceURL = 'http://SQLSERVER2005/reportserver/ReportService2005.asmx';
>   ExecURL = 'http://SQLSERVER2005/reportserver/ReportExecution2005.asmx';
>   ReportName = '/Folder 1/Folder 2/Folder 3/A Long Report Name';
> var
>   args: array[0..4] of string;
>   rs: ReportService2005.ReportingService2005Soap;
>   rsExec: ReportExecution2005.ReportExecutionServiceSoap;
>   GRParams: ReportService2005.GetReportParameters;
>   RepParamsResponse: ReportService2005.GetReportParametersResponse;
>   LRParams: ReportExecution2005.LoadReport;
>   LoadParamsResponse: ReportExecution2005.LoadReportResponse;
>   i: Integer;
>   setParams: ReportExecution2005.SetExecutionParameters;
>   setParamValues: ReportExecution2005.ArrayOfParameterValue;
>   renderParams: ReportExecution2005.Render;
>   renderResponse: ReportExecution2005.RenderResponse;
>   setParamsResponse: ReportExecution2005.SetExecutionParametersResponse;
>   fileStream: TFileStream;
>   execHeader, renderHeader: ReportExecution2005.ExecutionHeader;
>   HTExec: THttpRIO;
> begin
>   args[0] := 'Param1'; // note params need to be correct length (I had one that was 3 characters, but was only passing two, needed a trailing space to make it work)
>   args[1] := 'Param2';
>   args[2] := 'Param3';
>   args[3] := 'Null';   // "Null" is just a bit of text that is used below to create a "Null" parameter
>   GRParams := GetReportParameters.Create;
>   setParams := SetExecutionParameters.Create;
>   LRParams := LoadReport.Create;
>   renderParams := Render.Create;
>   execHeader := ExecutionHeader.Create;
>   renderHeader := ExecutionHeader.Create;
>   HTExec :=  tHttpRio.Create(nil);
>   try
>     rs := GetReportingService2005Soap(False, ServiceURL);
>     rsExec := GetReportExecutionServiceSoap(False, ExecURL, HTExec);
>     try
>       GRParams.Report := ReportName;
>       GRParams.ForRendering := False;
>       RepParamsResponse := rs.GetReportParameters(GRParams);
> 
>       // Fill the Parameters to call in the SetExecutionParameters later
>       SetLength(setParamValues, Length(RepParamsResponse.Parameters));
>       for i := 0 to Length(RepParamsResponse.Parameters)-1 do
>       begin
>         setParamValues[i] := ParameterValue.Create;
>         setParamValues[i].Name_ := RepParamsresponse.Parameters[i].Name_;
>         if args[i] <> 'Null' then // do not set the param if you want it to be null
>           setParamValues[i].Value := args[i];
>       end;
>       setParams.ParameterLanguage := 'en-us';
>       setParams.parameters := setParamValues;
> 
>       // Load the selected report.
>       LRParams.Report := ReportName;
>       LoadParamsResponse := rsExec.LoadReport(LRParams);
> 
>       // Send ExecutionHeader
>       execHeader.ExecutionID := LoadParamsResponse.executionInfo.ExecutionID;
>       HTExec.SOAPHeaders.Send(execHeader);
> 
>       // Set the Parameters
>       setParamsResponse := rsExec.SetExecutionParameters(setParams);
>       renderParams.Format := 'PDF';
> 
>       // Send RenderHeader
>       renderHeader.ExecutionID := setParamsResponse.executionInfo.ExecutionID;
>       HTExec.SOAPHeaders.Send(renderHeader);
>       renderResponse := rsExec.Render(renderParams);
>       fileStream := TFileStream.Create(APDFFileName, fmCreate);
>       try
>         fileStream.Write(renderResponse.Result[0], Length(renderResponse.Result));
>       finally
>         FreeAndNil(fileStream);
>       end;
>     except
>       on E: Exception do
>       begin
>         ShowMessage(E.Message);
>       end;
>     end;
>   finally
>     GRParams.Free;
>     setParams.Free;
>     LRParams.Free;
>     renderParams.Free;
>     renderHeader.Free;
>     execHeader.Free;
>     RepParamsResponse.Free;
>     LoadParamsResponse.Free;
>     setParamsResponse.Free;
>     renderResponse.Free;
>     for i := 0 to Length(setParamValues) - 1 do
>       setParamValues[i].Free;
>     SetLength(setParamValues, 0);
>     //FreeAndNil(HTExec);
>     rs := nil;
>     rsExec := nil;
>   end;
> end;
> {code}
> 

Thanks Pat, for posting the code. It was unbelievably helpful.
I grabbed the code did some minor debugging and it worked like a charm.

I know this is even later in the post but I am hoping to try to takes this a little further.
I need to change the Datasource of the report depending on which Database I want to use.
I then want to display the report to the screen instead of export to PDF.

Has anyone accomplished this kind of thing or perhaps someone can point in the right direction as to where to look for more information.
I am new to SSRS and Delphi XE.

Thanks,
Leonard

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Jun-2011, at 4:18 PM EST
From: Leonard Mann
 
Re: Any sample code calling Sql Server Reporting Services (S  
News Group: embarcadero.public.delphi.webservices
> {quote:title=Leonard Mann wrote:}{quote}
> 
> I need to change the Datasource of the report depending on which Database I want to use.

Just as an update if anyone is interested.

I was able to dynamically change the Database by using an Expression as the Data Connection string for the datasource.

="Data Source=(ServerName);Initial Catalog=" & Parameters!Database.Value

I then passsed my Database as a parameter and I accomplished what I needed.
I could pass the Server using the same method

="Data Source=" & Parameters!Server.Value & ";Initial Catalog=" & Parameters!Database.Value

Still looking into how to send the report stright to the browser from within Delphi.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 27-Jun-2011, at 5:58 PM EST
From: Leonard Mann