I have an ASP.Net application (C#) with an rdlc report, which is populated by a datatable, called
TimesheetEntries. The table is structured as shown below:
This has been working OK so far, but now the customer wants me to add a few more rows under the totals row, to show the Annual Fees charged to the Client. This information is coming from another table in the DB. The customer wants the report to look like below:
ClientA Project1 User1 3.0 90.00
Project1 User2 1.0 30.00
Project Totals 4.0 120.00
Client A Project2 User1 3.0 90.00
Project Totals 3.0 90.00
Client Totals 7.0 210.00
Annual Fees 2012 100.00
Annual Fees 2013 100.00
Client Total Fees 410.00
I am a little confused as to how to do this; I thought of adding an additional field in the datatable, called fees and the for the first row of each client populate it with the value, and finally display that under the totals. This can work but it will not
give me the year breakdown they want. Some clients have fees issued for 2012 and 2013, some for 2013 only and some no fees at all, so I don't know upfront how many such fields to include in the datatable.
Any ideas? I would really appreciate a swift reply.
I solved this issue; For future reference, here is what I did: I added a new field called RowType in my datatable. In code-behind, I make two database calls, one to retrieve the timesheet entries and a second to retrieve the annual fees for each company.
Using them, I build the datatable used to bind the report onto. The rows containing Timesheet entries have the RowType field equal to "Project Fees", whereas the rows containing annual fees have it set to "Annual Fees".
I then created an additional RowGroup on the report, based on the new field, and set its visibility and sorting parameters accordingly to show/ not show when the RowType has one value or the other.
Member
5 Points
66 Posts
Adding subtotals to a report
Jan 22, 2013 03:03 PM|cloucas|LINK
I have an ASP.Net application (C#) with an rdlc report, which is populated by a datatable, called TimesheetEntries. The table is structured as shown below:
EntryDate,Username,ClientName,ProjectName,Hours,Cost
In displaying the report, I am grouping for ClienName, and then by ProjectName, and in the group footer I have a subtotals row like so:
ClientA Project1 User1 3.0 90.00
Project1 User2 1.0 30.00
Project Totals 4.0 120.00
Client A Project2 User1 3.0 90.00
Project Totals 3.0 90.00
Client Totals 7.0 210.00
ClientB Project3 User1 3.0 90.00
Project Totals 3.0 90.00
Client Totals 3.0 90.00
This has been working OK so far, but now the customer wants me to add a few more rows under the totals row, to show the Annual Fees charged to the Client. This information is coming from another table in the DB. The customer wants the report to look like below:
ClientA Project1 User1 3.0 90.00
Project1 User2 1.0 30.00
Project Totals 4.0 120.00
Client A Project2 User1 3.0 90.00
Project Totals 3.0 90.00
Client Totals 7.0 210.00
Annual Fees 2012 100.00
Annual Fees 2013 100.00
Client Total Fees 410.00
I am a little confused as to how to do this; I thought of adding an additional field in the datatable, called fees and the for the first row of each client populate it with the value, and finally display that under the totals. This can work but it will not give me the year breakdown they want. Some clients have fees issued for 2012 and 2013, some for 2013 only and some no fees at all, so I don't know upfront how many such fields to include in the datatable.
Any ideas? I would really appreciate a swift reply.
Chris.
None
0 Points
2 Posts
Re: Adding subtotals to a report
Jan 23, 2013 01:41 AM|lijo.leecorp|LINK
Let me Break it to some Steps,
1. Join the Details the Data Table (The New Fields and Values from the Back End Itself)
The Table or the Matrix Will not help you with Multiple DataSet so keep it in one DataSet
2. Use the Matrix Here, Use the Row Grouping
Hope this works
Member
5 Points
66 Posts
Re: Adding subtotals to a report
Jan 23, 2013 02:50 AM|cloucas|LINK
I solved this issue; For future reference, here is what I did: I added a new field called RowType in my datatable. In code-behind, I make two database calls, one to retrieve the timesheet entries and a second to retrieve the annual fees for each company. Using them, I build the datatable used to bind the report onto. The rows containing Timesheet entries have the RowType field equal to "Project Fees", whereas the rows containing annual fees have it set to "Annual Fees".
I then created an additional RowGroup on the report, based on the new field, and set its visibility and sorting parameters accordingly to show/ not show when the RowType has one value or the other.
This seems to be working.