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

Telerik Report pagination

1 Answer 109 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 04 Aug 2013, 09:48 AM
Hi All,

I'm working on an ASP.NET MVC 4 app. Telerik Reporting has been chosen as the Tools of report generation. It's been a couple of days am challenging to generate a report. Here is the scenario:

There is a ReportModel class providing required properties to bind to the report.

public class NewReportModel
    {
        public string ReprotTitle { get; set; }
        public List<Product> Products { get; set; }
        public double ReportSum { get; set; }
    }
 
  public class Product
    {
        public string Name { get; set; }
        public double Price { get; set; }
        
    }


As shown above, there is a Generic List Property of Property which must be displayed in the details section with pagination, thus I must use a TextBox control as Table does not support pagination. (According to what I have gained from surfing the web and Telerik Blogs).

The ReportTitle prop should also shown at the top of every page, and ReportSum at the bottom of every page of the report.

On the other hand, I apply an ObjecctDataSource and its DataMember returns an instance of the NewReportModel class. The Report Designer DataSource is bound to the mentioned ObjectDataSource. Up to here, I can have the ReportTitle and ReportSum props shown on the Report. 

The problem is that, How Can I have list of products displayed on the report viewer with pagination? 

I tried to use table and bind its DataSource to the List<Product> and so Bind the table TextBox expression to "=Fields.Name". But this is not what needed as it brings no pagination. I also tried to use SubReport but again no pagination.

I explicitly mean HTML pagination, The ReportViewer control pagination and not the Export PDF pagination.

How can I come over this problem? 

Thanks in advance,
Ali,

1 Answer, 1 is accepted

Sort by
0
Ali
Top achievements
Rank 1
answered on 04 Aug 2013, 10:39 AM
I've found an answer on my own, hope it helps the others too:

private void TheSecondReport_ItemDataBinding(object sender, EventArgs e)
        {
            var reportParamTitle = new ReportParameter
                                  {
                                      Name = "Title",
                                      Value = "Report Title",
                                      Type = ReportParameterType.String
                                  };
            var reportParamSummation = new ReportParameter
            {
                Name = "Summation",
                Value = 46464646,
                Type = ReportParameterType.Integer
            };

            textBox2.Value = reportParamTitle.Value as string;
            textBox3.Value = reportParamSummation.Value.ToString();
        }
Tags
General Discussions
Asked by
Ali
Top achievements
Rank 1
Answers by
Ali
Top achievements
Rank 1
Share this question
or