How to create Dynamic Object name in Telerik Report

4 posts, 0 answers
  1. Raj
    Raj avatar
    33 posts
    Member since:
    Jan 2012

    Posted 31 Oct 2013 Link to this post

    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...
  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 05 Nov 2013 Link to this post

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Raj
    Raj avatar
    33 posts
    Member since:
    Jan 2012

    Posted 08 Nov 2013 Link to this post

    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....
  5. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 13 Nov 2013 Link to this post

    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.

Back to Top