Search code examples
sql-serverreporting-servicesssrs-2008ssrs-2012ssrs-tablix

How to filter/show records in the order of date while displaying using SSRS?


I created SSRS report which takes 3 input parameters(rpId, rpStartDate, rpEndDate) and dataset return's user details. When we are displaying the results in a table/grid, i need to show records based on created_date field returned by dataset. I need display to all the records in the order of date for each date between the date range users chooses and display no'of records under the records info.

For Example:

If your chooses to get records(results) for date range between 1/1/2016(jan 1) to 1/5/2016(jan 5)

I need to display like below in table or grid

Created Date: 1/1/2016

First Name      Last Name       Middle Name Address1    Address2    City
Sam             Test             M           123 test   Drive 1     England
William         Adam             A           123 Circle Apt 2013    New York

No of records for 1/1/2016 : 2

Created Date: 1/3/2016

First Name      Last Name       Middle Name Address1    Address2    City  
Aaron            Silva            B         546 Wood Dr Plaza      Delhi
Kapil            Sam              R         750 Parkwoo Circle     Los Angles
Asha             Tucker           C         1234 Main Dr Briar Rd  Dallas


No of records for 1/1/2016 : 3

Can some one please let me know to how display in this way?

Thanks in Advance!


Solution

  • The dataset returned from query should have created_date column. So in short you need to group your detail columns by created_date column. In more details:

    1. Drop a tablix and then drag and drop detail columns into the tablix, such as first_name, last_name, etc.
    2. At the bottom of the design view, right click the entry within Row Groups, and select "Add Group" - "Parent Group", then select Created_date column from drop down list
    3. At this stage your tablix should have one column (created date) added. Right click the content cell of this column, then from context menu select "Insert Row" - "Inside Group Above"
    4. The newly added blank row should be within the parent group (created date).

    5. Now copy the grouped column content by pressing Ctrl + C(it should be like "[created date]")

    6. Right click the grouped column header and select "delete columns"
    7. select newly added empty row and paste copied content by pressing Ctrl + V
    8. Run the report, now the row contents should be grouped by created_date
    9. You can add "no of records" by adding total - after group