Use Customized Data Provider

Hi,

We are trying to use report designer control in our exiting application.we are trying to use the same existing connection as report designer connection as well.we have tried several ways and nothing went good.We have used IDbConnection as database connection in our exiting application.if we can inject the same connection to report designer it is easy to maintain and the user functionality as well.And we dont need to give end user to change the existing connection.End users can change sql queries and create report.please update us on how to use IDbConnection as primary connection of report designer.

tnx in advance

chaminda

Comments

  • edited 6:11PM
  • edited 6:11PM
    i have checked.but the thing is in that Config.DesignerSettings.ApplicationConnection accept only DbConnection. But we need to use IDbConnection.is that possible ?
  • edited 6:11PM
    Now what we have done is we have explicitly converted IDbConnection to DbConnection.But we cant see all the database tables once we have done in this way.and there should be a beter way of doing this which we didn't know at the moment.coz explicit conversion might be directed to problems when we go forward.

    and i also facing the prob as in http://www.fast-report.com/en/forum/?p=/discussion/8832 . i cant see tables in the data wizard and also no data in query designer as well.

    i am using OleDbConnection in my IDbConnection.Hope there will be a way to over come this issues

    tnx

    Chaminda
  • edited 6:11PM
    we have try to Created a customize data provider using DataConnectionBase.but there are 2 problems once we try to derived from that base class.

    1. we cant override GetEditor(); method.
    2.when we use that connection which is customized users can add another database connection.(we need to restrict that.).and if we try to preview the report connection will disappear.

    how we should over come from this.

    the problerm is we don't need to use another database connection in our application.we just need to use the same connection as we have used in existing app.We dont mind using a new connection when we designing the report.but we need to use existing application connection(IDbConnection) when we run the report.

    tnx

    chaminda
  • edited 6:11PM
    Hi ,

    i want to clarify few things when we are going forward with your report designer solutions.Hope you all can help me with them.

    1.can we create our own class something similar to OleDbDataConnection class which is derrived from DataConnectionBase class ?
    2.if yes is there any example or sample project ?
    3. can we restrict users to use connection which we assign to the report dictionary.without adding a new connection to the designer.(if user click on new dictionary all the data will vanished.)

    please help me.we are new to fast report and we need to go ahead with the designer.

    waiting

    chaminda


  • edited 6:11PM
    Hello,

    1) yes, you can.
    2) there are many connectors with source code available here:
    http://www.fast-report.com/pbc_download/FRNetConnections.zip
    3) the only way is to use the Config.DesignerSettings.ApplicationConnection. And I don't understand why you can't use this option with your OleDbConnection?
  • edited 6:11PM
    tnx for the helpful answer.the prob is i want to use my exisiting application connection when executing the report.

    Can i get the sql query from the report and run it inside application connection and set data back to the report. is that possible ?

    something like


    var table = fastReport.GetDataSource(tableName) as TableDataSource;
    string selectCommand = table.SelectCommand;
    var data = Presenter.ExecuteSql(selectCommand);

    fastReport.RegisterData(data, tableName);

    is there a way of doing this.waiting for a quick reply.

    tnx in advance.

    Chaminda
  • edited 6:11PM
    I'm afraid it's not possible. I will try to modify our code to allow use of existing application connection object instead of creating its copy. I will let you know in this thread.
  • edited 6:11PM
    AlexTZ wrote: »
    I'm afraid it's not possible. I will try to modify our code to allow use of existing application connection object instead of creating its copy. I will let you know in this thread.

    tnx. Hope you can make it soon. and i have try to set the exisiting connection in my case it's a IDbConnection, which is open.the error i am getting from the report was that connection is already open.Hope u will consider this as well.i mean allow us to use an open connection.

    tnx

    Chaminda
  • edited 6:11PM
    The new version will be available tomorrow. It allows to use the opened connection.
  • edited 6:11PM
    AlexTZ wrote: »
    The new version will be available tomorrow. It allows to use the opened connection.

    Tnx a lot.its work like charm !!!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.