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

Reporting with Web Service

8 Answers 401 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ali Kitabi
Top achievements
Rank 1
Ali Kitabi asked on 19 Nov 2008, 08:49 PM
Hello,

I have a web service which is returing me an array of xml objects in each element. When I create a new report in the Class Project I can see the the method of the web service. I am using the same as my datasource. When I preview the report only the headings show up, no data is shown there.

Any help would be appreciated.

Ali Kitabi

8 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 20 Nov 2008, 10:23 AM
Hi Ali,

Telerik Reporting does not provide its own data layer but depends on the existing .NET objects (DataSet, Data Table, DataView, ADO.NET, lists - for more information on report data binding, please, refer to this help topic). In this line of thoughts, Telerik Reporting is not aware or nor does it matter to it how and from where you provide the data for it. To use XML as a report datasource, load the XML into a DataTable and assign the DataTable to the report DataSource property.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 01 Jun 2011, 07:11 PM
This is from 2008.  Is there many people using reports anymore? 

There doesn't seem to be any help at all for using a webservice or programmatically binding the data to the telerik report.  Please post a complete example so I can see how to do this. 

Thanks!
0
Steve
Telerik team
answered on 02 Jun 2011, 07:48 AM
Hello Chris,

Each Telerik Reporting installation comes with documentation relevant for that version that is integrated in Visual Studio. The documentation for the latest version of all products is available online. Here is the Telerik Reporting help.
Since Q1 2010 DataSet is no more the preferred type of data source object. Instead we have introduced new Data Source Components and this is the suggested way to proceed from now on. Instead of using DataSets, DataTables and/or NeedDatasource event we suggest using the SqlDataSource/ObjectDataSource components that are designed to work especially with Telerik's reporting engine thus offering much better performance and support for parameterized queries.
As a new user to Telerik Reporting, we highly recommend reviewing the Quickstart and Designing Reports help sections. The videos section is also intended for new users and contains valuable information in the form of videos to get you started i.e.:

Regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 02 Jun 2011, 08:06 PM
But, you don't understand the question.  I'm using Web Services.  I can't use object data source or whatever else there is available.  My webservice can only return data that is serializable such as a dataset.  But, it does NOT matter what data the webservice returns.  The webservice is not available in the reporting project, as it is in a different solution entirely (like every other web service.)   so, your examples do not apply at all, and there is no documentation whatsoever on how to do this.  so, I had to figure it out myself.  I had to temporarily use a sqldatasource connection to get the design wizard to actually work, because since its a webservice, there is no permanent connection, correct?  so, you CANT see the datasource in the reporting project at design time.   It is only available when you call the webmethods, and then it returns the dataset.  So, in your designer you can't just drag and drop whatever fields you want without a permanent database connection.  You have to use the wizard or drag and drop fields from a permanent data connection such as objectdatasource or whatever it may be.  Next, I commented out the designer code, which binds the data to the sqldatasource, as of course, I can't have a permanent connection to the database, as I am using webservices.   then, in the aspx page with the report viewer, I had to manually bind the dataset to the datasource of the report.  After that I got it to work.  But again, where is the documentation on how to do this?  I shouldn't have to be doing it this way.



0
Massimiliano Bassili
Top achievements
Rank 1
answered on 03 Jun 2011, 07:44 AM
Actually that is exactly how you should do it. All project types except web sites would allow you to add the report directly in your project and thus you would have direct access to your web service, so you can use the data source components. It is only the website that has limitations and does not allow for the report designer to function among other things. Should you switch to web application instead, you should be good to go to use the above approach. Also you might find this blog post interesting, ignore the fact it is for WCF service, just try to grasp the bigger picture: Using Telerik Reporting with WCF RIA Services

Cheers!
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 03 Jun 2011, 06:51 PM
It's nothing to do with the website or web application.  How can the report designer see the webservice?, and of course it needs all the fields from the webservice to be able to allow all the fields to be populated automatically(like the way a sqldatasource sees all the fields and allows the user to generate the fields).  The way I did it is correct, but it is a workaround.  I also had problems installing telerik reports, as the toolbox disappeared for no reason(so I didn't see any tools that would allow me to drag and drop a column or field onto the report designer until a few days later!!).  So, another time waster is that telerik installation is buggy, and your telerik reporting tools disappear and you have to constantly reset the toolbox for them to reappear(its done that twice so far.).  So,  the only other way i could have done it is if the telerik reporting actually installed correctly, then I could see that I could have created the fields, etc. without having a temporary direct connection to the database.  the telerik walkthrough also doesn't explain how I could use it with reporting, so it wouldn't help me in this case.
0
Chris @ Intrinsic
Top achievements
Rank 1
answered on 03 Jun 2011, 07:00 PM
Another problem I'm having is, that I figured out I couldn't have multiple datasources with the one report.  So, now I added a subreport.  It didn't work (didn't display the subreport).  But, for some reason, after tweaking the parameters, I got the error on the report preview screen: "Object reference not set to an instance of an object."    So, I removed the subreport,  but of course that didn't work.  In the generated file (.designer.cs)  i see the lines of code:

 

 

//

 

 

 

// subReport1

 

 

 

//

 

 

 

this.subReport1.Name = "subReport1";

 



Why is this still there?  I deleted it.  I deleted it out of designer, but it still puts it back.  By the way, I'm using version

5.0.11.316

as everyone on our team is using it, and I had to rollback my installation (uninstall latest version and install 316.)  Is 316 full of bugs, so that's why I'm seeing all those issues?  Should I upgrade? 
I have proved that this is buggy, due to the fact that the telerik reporting toolbox items disappear after a while, and I have to reset the toolbox!    So, will upgrading to the latest version of telerik reporting solve these problems? 

I also have one parameter in my report, and if I input a value that doesn't exist in the database, the report works and just displays the field names, but of course no data, but if I input a valid value into the parameter I get the error "Object reference not set to an instance of an object". 

0
Steve
Telerik team
answered on 06 Jun 2011, 03:26 PM
Hi Chris,

If Telerik Reporting is properly installed, the Toolbox should be populated automatically without having to do anything at all. Some cases where Telerik Reporting is initially missing from the Toolbox have been brought to our attention, but resetting it fixed the problem (as in your case). We are not sure why this happened in a first place (corrupted VS install, other 3rd party software etc.) so we recommend the following:
  • make sure you have a single instance of Visual Studio opened - reset the toolbox. Visual Studio saves its settings per instance, so the last Visual Studio you close is the one that makes last changes. If that is not the VS instance with the reset Toolbox, then it's likely, VS would not remember the changes made in the other instance.
  • If the previous point does not help, VS might be corrupted and we recommend repairing it.
About your second question - you can have a single data source per Data Item. We would need more information on how you've added it and what was your goal. Since you talk about parameters, if you aim at creating a master-detail scenario, please review the Creating Master-Detail Reports Using SubReports help article. Generally stating that something does not work without providing details on what you did exactly, does not give us any clue on what could be wrong. That is why, we would appreciate it if you provide exact steps to follow whenever you've encountered a problem.
We tried to reproduce the issue with the left out subreport serialization but with no luck (short video is attached). Generally such problems can occur if you have manually altered the InitializeComponent method and the designer tries to repair it. That is why we recommend to make changes only through the report designer.
Your last inquiry about the parameter lacks information about the parameter type, how you provide value to it, used data source and the full error. When you run the report, open the Output window in Visual Studio and check for stack trace that would contain more info about the error. You could also enable the CLR exceptions from the Visual Studio menu (Debug -> Exceptions).
All the best,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ali Kitabi
Top achievements
Rank 1
Answers by
Steve
Telerik team
Chris @ Intrinsic
Top achievements
Rank 1
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or