Click here to Skip to main content
15,892,072 members
Articles / Web Development / ASP.NET

A reporting service using SOAP calls passing XML to a Data Extension

Rate me:
Please Sign up or sign in to vote.
4.00/5 (5 votes)
19 Oct 2005CPOL8 min read 85.5K   406   26  
Demostrates how to render a report by passing XML to a data extension via SOAP calls.
// File: DataSetConnection.cs

using System;
using System.Diagnostics;
using Data = System.Data;
using Microsoft.ReportingServices.DataProcessing;
using Microsoft.ReportingServices.Interfaces;

namespace CustomDataExtension
{
	/// <summary>
	/// </summary>
	public class DataSetConnection : IDbConnection, IExtension
	{
		#region Properties
		private string _connectionString;
		private System.Data.ConnectionState	_connectionState = System.Data.ConnectionState.Closed;
		private string _localizedName = "Custom Data Extension";

		/// <summary>
		/// Gets/sets the connection string
		/// </summary>
		/// <remarks>
		/// ToDo
		/// </remarks>
		public String ConnectionString 
		{
			get { return (this._connectionString); }
			set { this._connectionString = value; }
		}

		/// <summary>
		/// Gets the connection timeout.
		/// </summary>
		/// <remarks>
		/// This extension does not currently support a timeout so will always return 0.
		/// </remarks>
		public Int32 ConnectionTimeout 
		{
			get { return (0); }
		}

		/// <summary>
		/// TODO
		/// </summary>
		public System.Data.ConnectionState State 
		{
			get 
			{
				return _connectionState;
			}
		}

		/// <summary>
		/// TODO
		/// </summary>
		public string LocalizedName 
		{
			get { return _localizedName; }
			set { _localizedName = value; }
		}
		#endregion

		/// <summary>
		/// Signals the begin of a transaction
		/// </summary>
		/// <returns>null since we do not support transactions</returns>
		public IDbTransaction BeginTransaction () 
		{
			return (null);
		}

		/// <summary>
		/// Opens the connection (not used)
		/// </summary>
		public void Open () 
		{
			//Debug.WriteLine("Connection :: Open()");
		}

		/// <summary>
		/// Closes the connection (not used)
		/// </summary>
		public void Close () {}

		/// <summary>
		/// Creates a IDbCommand object
		/// </summary>
		/// <returns>A new IDbCommand</returns>
		public IDbCommand CreateCommand () 
		{
			//Debug.WriteLine("Connection :: CreateCommand()");
			return new DataSetCommand();
		}

		/// <summary>
		/// TODO
		/// </summary>
		/// <param name="configuration"></param>
		public void SetConfiguration(string configuration) {}

		/// <summary>
		/// Dispose of any held resources
		/// </summary>
		public void Dispose() {}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) LEN Associates Inc.
United States United States
Years of software consulting and software development using Microsoft development products such as Microsoft Content Management System, SQL Server Reporting Service, ASP.Net C# VB.Net, HTML and javascript web development, Visual Studio add-on development, C++ MFC/ATL and COM+ development, and ActiveX components.

Comments and Discussions