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

Parameter Passing and SubReports

1 Answer 858 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 04 Apr 2007, 05:56 PM
Hi,

1. How do I design the report to take parameters and How do I pass parameters to a Report at run time ?
2. How do I use subreports and pass parameters to them from the master report?
3. Any examples of Drill down and sub reports available?
4. Does it have MultiLanguage support?
5. Ajax support?
Thanks,
Karthik

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 06 Apr 2007, 09:23 AM
Hello Karthik,

Up to your questions:

  1. In the current version the reports do not have built-in parameter passing functionality. However you can design a Win/Web form to take certain input (parameters) from the user and then use them in the query string of the report's data source.
     
  2. Sub-reports are used to display master-detail relationships. There is a very good example of Subreports that can clarify this. There we have created an example with 3 reports in a master-detail hierarchy. The top-level report is called ProductCategory and contains a Subreport for all product sub-categories. This report will show all product sub-categories for a given product category. The Subreport item displays a Report called ProductSubcategory. The ProductSubcategory report itself contains another Subreport that will show all products for a given sub-category.
    You can check the design-time and code-behind of those 3 reports from the sample VisualStudio solution that is installed with telerik Reporting. Here are a few quick steps to get you started with the most simple case:
    1. Create a new Report and connect to a data source which has two tables that are in a master-detail relationship. This MasterReport should bind to fields from the MasterTable.
    2. Design another Report that will show up in the place of the Subreport item. This second Report should bind to fields form the DetailTable.
    3. Place a Subreport item in the DetailSection of the MasterReport and set its ReportSource property to the point to the DetailReport.
    4. Then you need to hook to the Subreport item's NeedDataSource event. The sender object passed into the event handler is the Subreport item. From its DataItem property, which is a DataRowView, you can obtain the current row from the MasterTable. Having that, you know the value of the primary key for that row.
    5. Now you need to create the DataSource for the Subreport by selecting all rows from the DetailTable and then filtering the results by the already obtained primary key.
    6. Set the Subreport item's DataSource property to point that filtered data source and that should be it. Check out the source code of the ProductCategory sample report that installs with telerik Reporting to see all that in action.
       
  3. In the current version we do not have Drilldown functionality yet.
     
  4. If you are asking whether reports can be localized, then yes, they can. What you should do is select the Report in design time and set its Localizable property to true. Then change the Language property to what you desire and after that all strings that you enter in design-time will be stored in an appropriate .resx file for that language.
     
  5. The web-viewer does not use AJAX because it does not need it. It does not do postbacks.


Sincerely yours,

Rossen

the telerik team


Instantly find answers to your questions at the new telerik Support Center
Tags
General Discussions
Asked by
Karthik
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or