Accessing Report Runtime or Report Definition from Custom Data Provider


08-11-2010, 4:03 PM
Hi,

I'm implementing a custom data provider for accessing data from our web services. I've implemented a new DataProviderFactory, IDBConnection, IDBCommand, IDataProviderService, and IDataReader, and it's all working fine to get the data from the IDataProviderService and have it show up in either the report, or as available/default values for parameters.

However, there seems to be no way to access the actual report runtime or report definition to get information on parameters that may need to be passed into the service call, etc. The DataProviderFactory that provides the Connection and the Command seem to be generated in a static context without any reference to the current report instance. How can I link from these classes back to the currently executing report?

-Jason

Re: Accessing Report Runtime or Report Definition from Custom Data Provider


08-11-2010, 9:35 PM
Hello,
Basically it's not possible to access the report runtime from the code of custom data provider. If you would like to use the parameters for the IDbCommand implementation, then you should implement IDbCommand.CreateParameter and IDbCommand.Parameters.
After that if a report author specifies the query parameter for a data set that is driven by the custom data provider, then the parameter is passed in IDbCommand implementation by using CreateParameter/Parameters method/property. Then you can access to the parameters collection in IDbCommand.ExecuteReader method.
The query parameters can be mapped in the report parameters.
Let me know if you have any further questions.

Sergey Abakumoff
GrapeCity

Re: Accessing Report Runtime or Report Definition from Custom Data Provider


08-12-2010, 12:38 PM
Thanks for the info. I'll give that a try.

-Jason