Search code examples
chartsdatasetreportviewerreport-viewer2010

Microsoft ReportViewer (2010) Chart Time as Category with intervalled values


first question here, so please pardon me if I'm doing something wrong.

I'm trying to create a Line Chart in MS ReportViewer 2010, which should show how many people were registered on any day. Basically it should show on the X axis the last 30 days, every day on a tick mark and on the Y axis the number of people registered on that day.

On my dataset, I have a 'People' table which includes the 'RegistrationDate' column.

So far (in the last 3 hours :) ) I've managed to do this: - RegistrationDate on the X (Category) Axis - CountRows() on the Y (Values) Axis

and if I leave 'Auto' in the Minimum and Maximum scale value I do get some result, but I have these problems: 1) in particular the chart includes on the X-Axis only the dates where there is at least one person registered, but leaves out the ones with zero. Basically the axis isn't divided in 30 days, but around 20, leaving out the days where there are no registrations There's a check on 'always include 0' but changes nothing

2) I've tried to set the X axis minimum / maximum manually and the data disappears !

Thanks in advance !!

[edit_update] after bashing my head on it for 24h, and realizing reportviewer documentation and tutorials are scant to say the least (I guess people use other tools ?), I've implemented a workaround in the code. In a loop from minDate to maxDate, I filled a list of objects that have date and registration count as members, thereby filling the x axis with every value possible, zeros as well. Far from nice and not very flexible (I still don't understand how the x axis grouping works very well), but it sort of does its job. Is this a case where I should reply my own question ? [end_update]


Solution

  • after bashing my head on it for 24h, and realizing reportviewer documentation and tutorials are scant to say the least (I guess people use other tools ?), I've implemented a workaround in the code. In a loop from minDate to maxDate, I filled a list of objects that have date and registration count as members, thereby filling the x axis with every value possible, zeros as well. Far from nice and not very flexible (I still don't understand how the x axis grouping works very well), but it sort of does its job. Is this a case where I should reply my own question ?