Search code examples
c#wpfrdlcreport-viewer2010

Generate report week wise using a date field RDLC report


I have a RDLC report that displays count of Test Packs issued each day. I want to change this report in such a way that it should show the count of test packs issued per week instead of per day. How can i achieve that?

Here is the result of the current report (exported to excel).

The report is generated Island wise, then issue date wise test packs count.

enter image description here

The property in my ViewModel returns a collection that contains Test Pack records with fields like

public class TestPack
{
     public string TestPackNo { get;set; }    
     public string Island { get;set; }
     public string IssueDate { get;set; }
}

Solution

  • There two ways to achieve this.

    1. Work with underlying data - for example, add column "MondayofCurrentWeek" (since every week would have Monday) and group by that column instead. (This would be my preferred solution.)

    2. Add group by "week start" expression. You might need to add function to report's code to find it base on current date function. Since the language for report's code is VB, this may help: https://msdn.microsoft.com/en-us/library/aa227527(v=vs.60).aspx