Hi all,
I'm developing a report and I don't know how to layout it.
The data source is a JSON DataSource and his structure is the following :
public class School
{
public string Name { get; set; }
public List<Class> Classes { get; set; }
}
public class Class
{
public string Name { get; set; }
public List<Student> Students { get; set; }
public List<Teacher> Teachers { get; set; }
}
public class Student
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class Teacher
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Role { get; set; }
}
The desired layout is illustrated on the join file DesiredLayout.png and the report definition is joined too (containing datasource).
As you can see in the report definition, I don't use Header section. Because my list of teachers, on the top right, cannot be in a Header section.
And my problem is when the list of students for one class take more than one page, the school name, the class name and the list of teachers don't repeat.
My second problem is for the numbering on the footer. I don't know how to make it correctly.
Thank you for your help, regards
Hello Francis,
You are using hierarchical JSON data. In this case you can use bindings to set the data within the reports. All data sources seem to have the same feed. If that is the case, I'd suggest that you use a single JSON data source. See the attached example.
You can pay attention to the following:
1. You can bind the data sources for the nested elements like this
2. In order to have table headers printed on every page, you can set the "ColumnHeadersPrintOnEveryPage" property to True.
I didn't manage to resolve to topic with the paging numbers. Is that critical? I have a couple of ideas I can try but that could make the report a bit more complex.
Regards,
Krasimir Baylov
Ah, and now I understood your problem in a better way. I could try to provide some ideas in the next few days. Let's see if anyone else would manage to handle this, too.
By the way, what is the expectation for the page numbers? Should they be based on the total number of pages or should be reset when a new school, class starts?
--Krasimir Baylov
Thank you Krasimir,
1) yes, it's much simpler with only one data source ! Thank you (and sorry, I'm new to Telerik Reporting ;) ).
2) Your proposal works for the header of the table of students. But It's not the problem. The problem is for School name, Class name, and list of teachers. They only appears on first page of each classes. And I need that they appears on each pages.
3) The page numbering must reset for every class (the school is the same for all the classes).