This is a migrated thread and some comments may be shown as answers.

Dynamically consuming web services

4 Answers 318 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Clinton Smyth
Top achievements
Rank 1
Clinton Smyth asked on 09 Oct 2013, 10:11 PM
Hi

We need to source data from a web service for both designing and running reports in the standalone Telerik Report Designer.

We have the web service written and published which exposes all the available methods and their parameters to the user.  When called from the web browser it works fine, returning the requested data in a DataTable in XML format (it is a standard .NET web service).

What we need is for the Report Designer to act in a similar way to the web browser, in that it should dynamically display the web service methods that are available - along with their parameters, and once filled in by the user, they should be invoked and the data made available.  This is needed when designing the report, and should be transparent when running the report.

Given that our end users are not programmers, the selection of the above needs to be simple.

We are often updating the web service and thus need the Report Designer to pick changes up dynamically without the need to distribute anything to the client.

I have created a custom reports datasource (inherits from ObjectDataSource), with config set up and referenced as follows in the Telerik.ReportDesigner.exe.config (per http://www.telerik.com/help/reporting/standalone-report-designer-extending-configuration.html)
:
<Telerik.Reporting>
        <AssemblyReferences>
            <add name="CustomReportsDataSource" version="1.0.0.0" culture="neutral" publicKeyToken="null" />
        </AssemblyReferences>
    </Telerik.Reporting>

The above assembly is only a stub but references the webservice, which I take it allows access to the webservice in the Report Designer due to the Report Designer's use of reflection.

I was hopeful the following config would enable direct access to the webservice, but it is used only by the CustomReportsDataSource.  This unfortunately means our webservices are not dynamic and have to be stubbed in statically in the CustomReportsDataSource.dll, thus necessitating the distribution of this dll whenever there's a change to the web service.
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="ReportsWebServiceSoap" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:82/Webservices/ReportsWebService.asmx"
            binding="basicHttpBinding" bindingConfiguration="ReportsWebServiceSoap"
            contract="ReportsServiceReference.ReportsWebServiceSoap" name="ReportsWebServiceSoap" />
    </client>
</system.serviceModel>

To create a report in the Report Designer, I have to do the following (which is also required of a non developer):
  1. Click 'New Report'
  2. Use the Report Designer Wizard and select the Object Data Source.
  3. Click 'Add New Data Source'
  4. Select the 2nd available data source type (appended with 'ReportsServiceReference')
  5. Select 'ReportsWebServiceSoapClient'
  6. Click 'Next' and select 'Choose a data source member'
  7. Select the method required, click 'Next'
  8. Enter the parameters
  9. Select the fields, report type, etc.

Is there a way to simplify this for the end user?  i.e. include our object data source in 'Current Data Sources' and suppress all extraneous methods, displaying only those from the web service?  Ideally, the end user should not have to deal with steps 3-6 above.

Initially, I had an error in the config and at this point would always get the following (very vague and thus difficult and hugely time wasting to resolve) message:

"An error occurred while invoking data retrieval method"

There were no details pertaining to this message in the Telerik.ReportDesigner.log file (log enabled by adding the system.diagnostics section in the config file, per http://www.telerik.com/community/forums/reporting/telerik-report-designer/standalone-report-designer-exe-requirements.aspx).  Further, the webservice was not being called as evidenced by debugging messages not appearing in the server log.

It would've saved me hours and would be appreciated if you could provide more details for this type of error (simply displaying the exception generated would've made the world of difference!).

So my questions are:
  1. As above, is there any way to simplify the report creation process for the end user?
  2. Is there a way to invoke the webservice dynamically?
  3. There was talk of providing an OData data source, any progress/timeframe on that?

Thanks

4 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 15 Oct 2013, 09:11 AM
Hello Clinton,

Connecting to oData feeds is still in our Roadmap. For now the way to use oData is as consuming data service by using external assembly where you can retrieve the data and load it in a custom object for use in the report. For more details take a look at:

In order to avoid multiple calls to the service, you can load the data in in-memory objects and allow the end-user to work with them in the report. You can also provide templates to help your users.

About the error you receive, if the Standalone Designer error log does not contain the stack trace, you can test using the same data retrieval method in Visual Studio. If it is a design time issue debug with a second VS instance.

In order to further troubleshoot the described connectivity issues we will need more details about the exception and an example we can test at our side, so please open a support ticket and send us your files there.

Regards,
Stef
Telerik

Have you tried the new visualization options in Telerik Reporting Q2 2013? You can get them from your account.

0
Clinton Smyth
Top achievements
Rank 1
answered on 15 Oct 2015, 12:44 AM

Hi

It's been a while since our original request and the requirement has resurfaced. Has any progress been made during the intervening time that would make this possible?

In short, we're looking for a way to dynamically supply a list of classes and their properties to the standalone report designer. We're able to access a static class provided by a separate dll but a dynamic class (provided in the same dll) is not visible.

 Thanks

 

0
Stef
Telerik team
answered on 16 Oct 2015, 03:15 PM
Hello Clinton,

Th approach for using data services as data source in reports is still to have a data access layer wrapped by an Object/Entity/OpenAccess DataSource component. Also data must have a tabular representation and if the data schema will be dynamic, the data source component will have to be reconfigured in order fields to be loaded for usage.

Feel free to log a feature request describing the business case and the need of a data source component working with data services directly. Features are considered for implementation based on the demand for them and thus you can raise the task's priority.

Regards,
Stef
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Clinton Smyth
Top achievements
Rank 1
answered on 17 Oct 2015, 09:15 PM
I've logged a feature request: http://feedback.telerik.com/Project/162/Feedback/Details/172592-ability-for-standalone-reports-to-use-dynamically-generated-schema
Tags
Report Designer (standalone)
Asked by
Clinton Smyth
Top achievements
Rank 1
Answers by
Stef
Telerik team
Clinton Smyth
Top achievements
Rank 1
Share this question
or