Hi,
I have to create a report for many item (animal), for each animal there are a header section with general information and a detail section with the list of birth (number of children, average weight etc..).
I use report parameter to pass the animal id from my silverlight application.
I start with report for single animal: in the header and footer I insert textbox with date and animal id, in detail section I insert general animal's informations and a table with list of birth.
As datasource I use my custom class Animal that contains general information and an List<BirthInformation> called ListBirth.
I create two datasource, ds1 for the report with Animal class and ds2 for the table with birth information setting datasource to Animal and DataMember to ListBirth. I had to make the second datasource for see the member of the list ListBirth
In the report's code I use NeedDatasource event, so on constructor I put the report datasource to null, and in the event handler I use the code:
Animal a = GetAnimal(id);
this.DataSource = a;
this.table4.DataSource = a.ListBirth;
The report work fine.
Is this correct way to work?
I need now to make the report (single) form many animal whit a page break from an animal and the next, but I don't understand if I do to use a group or a new report with this report as subreport in a table and how to set the datasource.
Thank you very much.
andrea
I have to create a report for many item (animal), for each animal there are a header section with general information and a detail section with the list of birth (number of children, average weight etc..).
I use report parameter to pass the animal id from my silverlight application.
I start with report for single animal: in the header and footer I insert textbox with date and animal id, in detail section I insert general animal's informations and a table with list of birth.
As datasource I use my custom class Animal that contains general information and an List<BirthInformation> called ListBirth.
I create two datasource, ds1 for the report with Animal class and ds2 for the table with birth information setting datasource to Animal and DataMember to ListBirth. I had to make the second datasource for see the member of the list ListBirth
In the report's code I use NeedDatasource event, so on constructor I put the report datasource to null, and in the event handler I use the code:
Animal a = GetAnimal(id);
this.DataSource = a;
this.table4.DataSource = a.ListBirth;
The report work fine.
Is this correct way to work?
I need now to make the report (single) form many animal whit a page break from an animal and the next, but I don't understand if I do to use a group or a new report with this report as subreport in a table and how to set the datasource.
Thank you very much.
andrea