
Jason Maronge
Top achievements
Rank 1
Jason Maronge
asked on 29 Oct 2010, 04:01 PM
Does anyone know how to bind a report to a webservice and have it call that service each time the parameters change or the report is refreshed? I have not seen any answers to this. I have tried to override the OnNeedDataSource in a base class, handling the NeedDataSource event and according to all the other post this only gets called when the datasource is null which is only once. Something does not seem right here. I should be able to update my datasource any time the report needs to be refreshed, or at least have the option. So if anyone has a complete example how to bind a report to a webservice and send parameters please post a solution. I am trying to do something like this in the NeedDataSource is my base report:
Thanks for your help,
Jason
if
(
string
.IsNullOrEmpty(
this
.StoredProcedureName))
{
base
.OnNeedDataSource(sender, e);
return
;
}
object
[] parameters =
new
object
[
this
.ReportParameters.Count];
for
(
int
index = 0; index <
this
.ReportParameters.Count; index++)
{
Telerik.Reporting.ReportParameter trp =
this
.ReportParameters[index];
parameters[index] =
new
object
[] {
"@"
+ trp.Name, trp.Value };
}
this
.DataSource = WebServiceProxy.Execute(StoredProcedureName, parameters);
Thanks for your help,
Jason
9 Answers, 1 is accepted
0

Jason Maronge
Top achievements
Rank 1
answered on 01 Nov 2010, 10:36 PM
I went ahead and used an object datasource to accomplish my needs.
0
Hello Jason Maronge,
Peter
the Telerik team
We are not sure that we have correctly understood the issue you are experiencing generally our suggestion is to use an ObjectDataSource for report's DataSource and let it automatically refresh when a report parameter is changed or the viewer is refreshed. Check out the attached sample that shows how we have used the service with an ObjectdDataSource.
Greetings,Peter
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 01 Jun 2011, 07:27 PM
So, how exactly did you do that? There is no examples anywhere on how to use a webservice and bind the dataset programatically to the report.
0

Paul
Top achievements
Rank 1
answered on 24 Jun 2011, 12:24 AM
Hi,
I must admit I'm having the same problem. In VS2005 I'm trying to bind a ObjectDataSource to a web service method that returns a dataset - however when using the ObjectDataSource I can't see a reference to the web service to allow me to bind to it.
Have I missed something fundamental?
The web service is available within the project solution and returns data so I'm hoping I can use it a design time?
Thanks,
Paul.
I must admit I'm having the same problem. In VS2005 I'm trying to bind a ObjectDataSource to a web service method that returns a dataset - however when using the ObjectDataSource I can't see a reference to the web service to allow me to bind to it.
Have I missed something fundamental?
The web service is available within the project solution and returns data so I'm hoping I can use it a design time?
Thanks,
Paul.
0
Hello Paul,
You should create a method that returns the dataset from your web service and bind via the ObjectDataSource to that method.
Best wishes,
Steve
the Telerik team
You should create a method that returns the dataset from your web service and bind via the ObjectDataSource to that method.
Best wishes,
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

Paul
Top achievements
Rank 1
answered on 24 Jun 2011, 01:25 PM
Thanks, I'm getting slightly further but the "Data Explorer" window isn't behaving as I'd expect it to. I was hoping once that I'd bound the ObjectDataSource to the correct method I would be able to use the data explorer to view the data source.
I've created a data accessing class and this is now shoing within the ObjectDataSource wizard so I can bind to this. The code for the class is below...
But within Visual Studio 2005 the Data Explorer is showing No Data Source and the following exception: When I click on a field within the report it doesn't recognise any fields as being available eventhough the report itself has it's data source set as "ds [Telerik.Reporting.ObjectDataSource]" which is the name of the ObjectDataSource on the report. When the report is actually ran though the fields do bind at runtime and are shown correctly - it's just the design time experience that's proving painful?
I'm using the Q1 2011 Telerik Reporting.dll
Can you provide more assistance?
I've created a data accessing class and this is now shoing within the ObjectDataSource wizard so I can bind to this. The code for the class is below...
namespace
Test.ReportLibrary.TestReport
{
using
Test.ReportLibrary.TestReportDataSource;
using
System;
using
System.Collections.Generic;
using
System.Text;
[System.ComponentModel.DataObject()]
public
class
DataSource
{
public
TestReportDataSource Data =
new
TestReportDataSource();
[System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
public
System.Data.DataTable GetKeyInformationData(
string
eFolderId)
{
return
Data.GetKeyInformationData(eFolderId);
}
}
}
Telerik.Reporting.Processing.Data.ObjectDataSourceException: An error has occurred
while
resolving
'ds'
data source: Object reference not
set
to an instance of an
object
.
at Telerik.Reporting.Processing.Data.ObjectQueryProvider.ResolveDataSource()
at Telerik.Reporting.Processing.Data.ObjectQueryProvider.ResolveDataSourcePropertiesFromEnumerable()
at Telerik.Reporting.Processing.Data.ObjectQueryProvider.ResolveDataSourceProperties()
at Telerik.Reporting.Processing.Data.ObjectSchema.FillSchema(ObjectQueryProvider queryProvider)
at Telerik.Reporting.Processing.Data.ObjectSchema..ctor(ObjectQueryProvider queryProvider)
at Telerik.Reporting.Processing.Data.ObjectQueryProvider.CreateSchema()
at Telerik.Reporting.Processing.Data.MultidimensionalQueryProvider.GetSchema()
at Telerik.Reporting.Design.DataSourceService.GetCurrentDataSourceSchema(Boolean throwOnError)
at Telerik.Reporting.Design.DataExplorerControl.RefreshDataSource()
I'm using the Q1 2011 Telerik Reporting.dll
Can you provide more assistance?
0
Hello Paul,
The only way for the report designer to show you any data source related information (incl. data source schema) is to have a valid data source available at design time. As far as the Visual Studio designer is concerned a valid data source means:
Generally speaking the existing data source objects cover most of the scenarios; in the rare cases when they do not work you can always mock your data just to enable the report designer to show any data schema.
Best wishes,
Steve
the Telerik team
The only way for the report designer to show you any data source related information (incl. data source schema) is to have a valid data source available at design time. As far as the Visual Studio designer is concerned a valid data source means:
- a data source object that is instantiated and initialized in the InitializeComponent() method of the designed object class -- this is the only part of the class that VS designer respects;
- the data source object should be be operational at design time; this means that VS (through the report designer) should be able to use this object and even instantiate it correctly. The tricky part here is that these objects become part of the VS application (devenv.exe) and not your application (your application from the VS' point of view is just a couple of work items - projects and files and not an executable).
Generally speaking the existing data source objects cover most of the scenarios; in the rare cases when they do not work you can always mock your data just to enable the report designer to show any data schema.
Best wishes,
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

Paul
Top achievements
Rank 1
answered on 24 Jun 2011, 03:34 PM
So should I check that the object is initialized correctly within the generated InitializeComponent() function?
I can copy the web service from the project to an IIS server so it's hosted and available - would that allow the designer to view it correctly?
I can copy the web service from the project to an IIS server so it's hosted and available - would that allow the designer to view it correctly?
0

Lars
Top achievements
Rank 1
answered on 27 Jan 2012, 01:07 AM
It wot be nice if tare whose a WinformServiceClient like the one to Silverlight so you create the report on the server and send it to the client :-) my english is warily bad so i hope you understand me :-)