Custom Dataset Processing Extension Regisration

Discussion in 'ASP .Net' started by Oney, Nov 14, 2004.

  1. Oney

    Oney Guest

    I created a middle tier component that produce dataset from database
    for sql reporting services but i can not open connection

    details:

    middle tier component which name is MyReports.dll

    using System;
    using System.Data;
    using Microsoft.ApplicationBlocks.Data;

    namespace MyReports
    {

    public class myData
    {
    public myData()
    {}

    public DataSet GetData(string ReportName)
    {
    DataSet ds = null;

    if(ReportName == "Customers")
    {
    string sqlcommand = "SELECT * FROM Customers";

    ds = SqlHelper.ExecuteDataset("Data
    Source=(local);Database=Northwind;Trusted_Connection=true",CommandType.Text,sqlcommand);
    }

    return ds;
    }
    }
    }

    I also created a Dataset processing extension dll which name is
    RSCustomData.dll

    using System;
    using System.Data;
    using System.Collections;
    using System.Xml;
    using Microsoft.ReportingServices.DataProcessing;

    namespace MyCompany.SqlReporting.DataExtension
    {

    public class CustomData :
    Microsoft.ReportingServices.DataProcessing.IDataReader
    {
    private int _fieldCount = 0;
    private int _currentRow = 0;
    private string _fieldName;
    private int _fieldOrdinal;
    private Type _fieldType;
    private object _fieldValue;
    private DataSet _ds = null;

    internal CustomData(string ReportName)
    {
    MyReports.myData mydata = new MyReports.myData();
    _ds = mydata.GetData(ReportName);

    _currentRow = -1;
    }

    public bool Read()
    {
    _currentRow++;
    if(_currentRow >= _ds.Tables[0].Rows.Count){
    return (false);
    }
    else
    return (true);
    }

    public int FieldCount{
    get{
    _fieldCount = _ds.Tables[0].Columns.Count;
    return _fieldCount;
    }
    }

    public string GetName(int i)
    {
    _fieldName = _ds.Tables[0].Columns.ColumnName;
    return _fieldName;
    }

    public Type GetFieldType(int i)
    {
    _fieldType = _ds.Tables[0].Columns.DataType;
    return _fieldType;
    }

    public object GetValue(int i)
    {
    _fieldValue = _ds.Tables[0].Rows[this._currentRow];
    return _fieldValue;
    }

    public int GetOrdinal(string name)
    {
    _fieldOrdinal = _ds.Tables[0].Columns[name].Ordinal;
    return _fieldOrdinal;
    }

    public void Dispose()
    {}
    }
    }



    then I added these dll's to ReportServer bin file and ReportDesigner
    and I added these tag to RSReportServer.config

    in data tag

    <Extension Name="MyDataExtension"
    Type="MyCompany.SqlReporting.DataExtension,MyCompany.SqlReporting.DataExtensions"
    />



    same tag to the RSDesigner.config file in the Data tag and designer
    tag



    Then I added this code policy tags to policy config files


    When I try to add new report based on "MyDataExtension" on the report
    wizard an error occured that is
    "A connection cannot be made to the database. Set and check the
    connection string." I am sure the connection string
    is correct.

    Where am i mistake ?
     
    Oney, Nov 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anand
    Replies:
    3
    Views:
    898
    Tim Daneliuk
    Nov 8, 2003
  2. Hubert Hung-Hsien Chang
    Replies:
    2
    Views:
    515
    Michael Foord
    Sep 17, 2004
  3. Dima67
    Replies:
    9
    Views:
    1,202
    Marvin Landman
    Sep 4, 2009
  4. Michael
    Replies:
    3
    Views:
    206
    Jerry Goldin
    May 12, 2004
  5. Iñaki Baz Castillo
    Replies:
    2
    Views:
    228
    Iñaki Baz Castillo
    Apr 20, 2011
Loading...

Share This Page