mvines wrote:Thanks Edward, that definitely got me on the right track.
Your project was close, but not quite what I needed. I was looking to have all of that information on the same chart. So all I had to do to your project to get that to happen was.
1. Move the chart out of the databand.
2. Delete the databand.
3. Set the charts DataSource to Categories.
I noticed that Categories.CategoryName can be set to either Argument Data Column, or Argument, and the chart still comes out as expected.
You are very welcome. Actually the difference between these properties is the follows:
DataColumn specifies a Data Column which specifies a DataColumn from Chart.DataSource property. Chart will produce as many values as that DataSource contains.
In case of Argument you can use instead of the DataColumn any expression. This expression will be calculated 'Chart.CountData' times or 'Chart.DataSource' times (as many times as amount of records in that DataSource).
I also noticed that Chart.CountData can be set to any value, and it does not have an effect on this particular chart. I still don't understand what CountData does. If you could fill me in I would appreciate it.
That is because Chart.DataSource has a higher priority than Chart.CounData.
Lastly, I noticed that If I entered into the Value field {Totals.Count(Products.ProductID)} I did not receive a Report Compilation error. This did not result in the correct chart either, but it did compile.
The Totals.Count function expects a DataSource as its parameter:
Totals.Count(Products) -is an equivalent of Products.DataTable.Rows.Count and returns amount of records in the 'Products' datasource.
Please see the report in the attachment.
You could also prepare all required data using 'Data From other Source' datasource. This DataSource can be based on the 'Products' DataSource and group and count its records according with CategoryID DataColumn.
The attached report shows both techniques.
Thank you.