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

Not able to view the report data using business object

7 Answers 266 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Admin Staff
Top achievements
Rank 1
Admin Staff asked on 25 Jun 2009, 03:33 AM
Hi,

We are using your ASP.NET AJAX Telerik control for the last two and half years in one of our enterprise applications . Right now we are exploring the possibility of using Telerik reporting control in order to utilize built in print functionality for some of our reporting pages.

The scenario we are trying to achieve is as follows...

The report definition are in a seperate class library. Using Report viewer control in a asp.net application.
In a webform we are having a custom web control in the top of a page where the user can select some search criteria.   When the user invoke a search button , need to populate the report viewer control that is below the custom control by the data returned from a WCF service.

The problem is while submitting the search button the report viewer control only displays the tool bar without any data. If we select any export format from the dropdown list, the exported report contains data as expected from the wcf service. What we are expecting is the report viewer control should have data once the user selects search criteria and invoke the search button in a webform so that they can print the report directly.

P.S. In the preview mode it contains only the Page and report header only.

Thanks in advance for your help.

Regards

Prabhu

 I have attached a sample screen shot for reference below


7 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Jun 2009, 12:57 PM
Hello Prabhu,

You've missed the most essential information, namely - how do you bind the report to the wcf service? How/where do you assign the report property to the ReportViewer and if this is done in design time, have you tried forcing it in runtime i.e.:

ReportViewer1.Report = new MyReport();

P.S. This is most probably due to the fact that when in Preview, the application is Visual Studio itself and not your web application, thus you need to add respective references to your service in the devenv.exe.config file, which usually resides under C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE directory (don't forget to make a backup copy before modifying it).

All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Admin Staff
Top achievements
Rank 1
answered on 02 Jul 2009, 03:22 AM
1. I am binding the wcf service to the report in the needdatasource event of report.  Wcf service method accepts a parameter to retrieve a list of records. I am having a custom search control in an aspx page where we get the filter criteria. Need to pass this criteria to the wcf method inside the reports datasource event.

The aspx page layout will be like below

aspx page containing a custom search control
- aspx page contains an ascx page which houses a report viewer control
- assigning the report in page load event of ascx like below
                                    if (Page.IsPostBack) 
            
                 IReportDocument report = (IReportDocument)Activator.CreateInstance(typeof(PlanFormReport)); 
                 this.ReportViewer1.Report = report; 
           

I need to pass the filter criteria from my custom search control in aspx page to the report's needdatasource event from where i have called the wcf service.

public void PlanFormReport_NeedDataSource(object sender, EventArgs e) 
        { 
            //I need to get the SearchCriteria object from my aspx page and pass to 
            //the below wcf method 
            this.DataSource = ActivityManager.GetPlanFormList(SearchFilter); 
        } 
 

Thanks in advance for your help.

Regards

Prabhu
0
Chavdar
Telerik team
answered on 02 Jul 2009, 02:01 PM
Hi Prabhu,

In the NeedDataSource event instead of

this.DataSource = ActivityManager.GetPlanFormList(SearchFilter);

try with this:

((Telerik.Reporting.Processing.Report)sender).DataSource = ActivityManager.GetPlanFormList(SearchFilter);

The reason is that you have to assign the data source to the currently processed report instance and not to the report definition which is actually accessed through this.DataSource.

Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Admin Staff
Top achievements
Rank 1
answered on 03 Jul 2009, 03:57 AM
Hi Chavdar,

Thanks for your reply.

I have changed and assigned the data coming from service to report as advised by you in NeedDatasource event.But I am not able to view the data in reportviewer or in any selected export format. 

In the report viewer i am not able to view anything including page , report headers and also details. In the exported file it displays only page and report header.  But I am getting the expected data from my wcf service.

I have designed the report as below

In the report definition page placed a Telerik.Reporting.Table to bind data from service. By using designer mapped the returned type i.e List<SomeType> of the service to the datasource of telerik reporting table control.

The report contains three sections namely 

1. PageHeader
2. ReportHeader
3. Detail Section.

In the detail section having telerik reporting table as mentioned above.

Please guide where i have gone wrong. Thanks in advance for your clarification.

Regards

Prabhu
0
Chavdar
Telerik team
answered on 03 Jul 2009, 07:45 AM
Hello Admin Staff,

It will be much appreciated if you open a support ticket and send us your solution so that we can check it locally. The behavior you described is very odd and we cannot guess how this might happen without looking at your implementation. Thanks in advance.

Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Admin Staff
Top achievements
Rank 1
answered on 03 Jul 2009, 11:41 AM
Hi Chavdar,

The problem is due to reportViewer height. If i follow the steps as mentioned in the following link  http://www.telerik.com/community/forums/reporting/telerik-reporting/how-to-set-reportviewer-height-and-width-to-100.aspx by removing doc type and setting the dom tree height to 100% it works fine. 

But we are not in a position to do the same. The reason is raised by my collegue benoit in the following link http://www.telerik.com/community/forums/reporting/telerik-reporting/web-report-viewer-problem-with-xhtml-transitional-doctype.aspx

Please let us know how to proceed.

Regards

Prabhu
0
Chavdar
Telerik team
answered on 03 Jul 2009, 02:38 PM
Hello Admin Staff,

If the height of the viewer is set to a percent(%) value then it depends on the parent element's height. Therefore you have to set explicitly the height of all of the parent elements either as suggested in the corresponding link or in any other way you prefer in order to get a proper viewer size. The only discrepancy will remain that the viewer's height will be a little bit greater than the actual one when viewing the page with the viewer in IE 6.0. Hopefully this will be fixed for the next version.

Greetings,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Admin Staff
Top achievements
Rank 1
Answers by
Steve
Telerik team
Admin Staff
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or