2

I've got an rdlc report with a data source that provides something like this:

1/1/01    User1   5
1/1/01    User2   3
2/1/01    User1   4
2/1/01    User2   8
3/1/01    User1   5
4/1/01    User2   3
6/1/01    User1   9
6/1/01    User2   2

I then use a matrix (aka tablix) to show Date down the left hand side and User across the top. The count goes at the intersection. This all works okay.

I can configure it that missing cells have a 0 - eg for User2 on the 3rd.

The problem is that there is no entry for the 5th (eg a date when NO users had any activity). This also messes up graphs

What I want it to do is populate every date between the lowest and highest date.

How can I achieve this?

Basic
  • 26,321
  • 24
  • 115
  • 201

2 Answers2

0

For a Crystal reports solution, this seems like a good approach (CR 8)

To solve it in the datasource, it depends on what is the datasource... E.g. a solution for MySQL: MySQL how to fill missing dates in range?

Community
  • 1
  • 1
Eran Medan
  • 44,555
  • 61
  • 184
  • 276
  • I'd prefer not to solve it in the data source. I'm using EF4 Code-first and running an arbitrary query against my repository before converting the `IQueryable` to an `IEnumerable` of `anonymous type` which happens to fit the format the report is expecting - This allows the report to use the same BL and restrictions as the rest of the App (eg user A can't see user B's records at all) – Basic Dec 18 '10 at 11:05
  • And [un?]fortunately, we're using microsoft reporting not crystal - the crystal component for VS2010/.Net 4 isn't working yet – Basic Dec 18 '10 at 11:06
  • Yep, I'm out of ideas... I had this problem many times, luckily I could have solved it in the DB View... however I like the abstaction practice you mentioned here. I would say that the only way to solve it is via code (putting the source data in a custom datastructure and fill the gaps before feeding it to the report if possible, but I guess I'm stating the obvious) – Eran Medan Dec 19 '10 at 05:57
0

I eventually solved this by using a list of dates between the first and last date specified and getting counts for each user on the specified date.

I'm not convinced this is the best solution but I haven't found anything better.

Basic
  • 26,321
  • 24
  • 115
  • 201