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

How to create Dynamic Object name in Telerik Report

3 Answers 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 31 Oct 2013, 11:25 AM
hi friends, 
i need a solution to create dynamic Object Name in telerik report.
where in my report, different types of record binds in more than 5 tables
for every time in takes the count and runs in foreach loop according to the count and finally the result will bind as single report.

but now i can get the count and make run in foreach loop according to the count, but as the report object name is same, it displays the same result as respective to the count


i need to create the report object name dynamically
if any one haves the solution pls, share with me...

thanks in advance...

3 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 05 Nov 2013, 12:19 PM
Hi Raj,

It is not very clear to us what are you trying to achieve so we will need some additonal information about your setup and goals. You can provide us with a step-by-step explanation of what you are trying to do.

Regards,
IvanY
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Raj
Top achievements
Rank 1
answered on 08 Nov 2013, 07:36 AM
sorry for the delay
i need to create a report (both summary and detail report) from the list of Selected record.
For Example:-
Let input be, India, USA, UK, and UAE
For single Report:-
if i select one country from the list of records. 
Let be "India"
the report should show 
1.Summary report and following this 
2. Detail Report about India.
Multiple Report at same time:-
if i more than one country from the list of records.
Let it be All records from the list
the report should generate in following structure.
1.Title: india
1.1 Summary report of India and following this 
1.2. Detail Report about India.
2.Title: USA
2.1 Summary report of USA and following this 
2.2. Detail Report about USA.
3.Title: UK

3.1 Summary report of UK and following this 
3.2. Detail Report about UK.
4.Title: UAE
4.1 Summary report of UAE and following this 
4.2. Detail Report about UAE.

i am unable to create report for every country at same time.
due to i am fetching the records of all country from db first and then i am binding it to report viewer.
when i select 3 countries, the report generates 3 times but, for same country, which the record is lastly fetched from db. 

this code used to generate Summary Report 
 BookPASreport Summary = new BookPASreport(response6.Trawageupto, response6.Trawagecurrent, response6.village,response6.Centre,response6.Colldetails,
                                Region, State);//2
                            book.Reports.Add(Summary);
this code used to generate Detail Report 
 BookPASreportDetails Detail = new BookPASreportDetails(response6.Trawageupto, response6.Trawagecurrent, response6.village,response6.Centre,response6.Colldetails,
                                Region, State);//2
                            book.Reports.Add(Detail);

and then i am adding both the records in a book report:-
			ReportViewer1.Report = book;
			ReportViewer1.DataBind();

where the mistake is:-
i can understand where the mistake is. in summary report and detail report both the report obj name is "Summary" and "Detail" respectively as a result, it holds the record of lastly fetched from DB, and gives N-Number of report but for the lastly fetched records. i need to change that obj name("Summary" and "Detail") for each country according to the selection, if possible or else i need to find some other solution for that. if possible share me the ideas, or give me the alternate solution to achieve this target. thanks in advance ASRK....
0
IvanY
Telerik team
answered on 13 Nov 2013, 08:25 AM
Hello Raj,

From your code it seems that you have to use the ReportSource property since the Report property is already obsolete. Also please note that once you change the report in the report viewer you should use the RefreshReport method.

Regarding the code that you have provided - the code snippets seem to be ok. However please note that the actual data and the grouping/sorting/filtering of the data (which directly affects on the output) are in your report. Therefore we cannot tell for sure what the reason for your issue is, but it seems that something is wrong with the grouping/filtering or with the data binding.

Regards,
IvanY
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

Tags
General Discussions
Asked by
Raj
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Raj
Top achievements
Rank 1
Share this question
or