Charts With Groups

Stimulsoft Reports.NET discussion
Post Reply
Arunkumar S
Posts: 21
Joined: Mon Jul 23, 2007 5:12 am
Location: Chennai

Charts With Groups

Post by Arunkumar S »

Hi,

Facing one more problem.

My data source has 3 Columns, PlanName, AppName, Value

Example:

PlanName AppName Value
P1 A1 12
P1 A2 15
P1 A3 17
P2 A1 21
P2 A2 32
P2 A3 28
P3 A1 19
P3 A2 29
P3 A3 25

In the report i want 1 Bar Chart Per "PlanName", Listing "AppName" in the X-Axis and the "Value" In the Y-Axis (3 Bars - 1 Bar Per appName).
I have added a Group Header band For PlanName, Then Added the DataBand, In that i have added the Barchart, Assigned the "Argument Data Column" as AppName column and "Value Data Column" as value column. The problem is I am getting 9 Chart (1 chart per row in the above said example), and chart is showing 9 Bars as 1 bar per Row.

I have tried moving the chart to the header band. No luck.

Please Help Me,

Thanks,

Arunkumar.s
Arunkumar.s
Senior Application Developer.
Indepth Solutions Pvt Ltd.
India.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Charts With Groups

Post by Edward »

I hope the following thread will help you.

http://forum.stimulsoft.com/Default.aspx?g=posts&t=437

Thank you.
Arunkumar S
Posts: 21
Joined: Mon Jul 23, 2007 5:12 am
Location: Chennai

Charts With Groups

Post by Arunkumar S »

Hi, Thanks for your reply. But still the issue exists. As i said in the example

PlanName AppName Value
P1 A1 12
P1 A2 15
P1 A3 17
P2 A1 21
P2 A2 32
P2 A3 28
P3 A1 19
P3 A2 29
P3 A3 25

As per our requirement, i don't want the series, i simply wanted to display the x and y values. The link you have given is much similar to our requirement but i don't want to plot the series. I have tried using that, but still the same problem exists, I am getting 9 bars in the chart instead of 3 and 9 charts insted of 3.

Is there any other way to do this.

For the above said data, i need 3 charts in the report 1 chart per Plan name and each chart should show 3 bars, 1 bar per App name column.

It is very urgent, Any help is greatly appreciated!

Thanks.
Arunkumar.s
Senior Application Developer.
Indepth Solutions Pvt Ltd.
India.
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Charts With Groups

Post by Guest »

You can use the filters for series of chart in the event of databand. Write for BeginRenderEvent:

Code: Select all

Chart1.Series[0].Filters.Add(new Stimulsoft.Report.Chart.StiChartFilter(Stimulsoft.Report.Components.StiFilterItem.Value, Stimulsoft.Report.Components.StiFilterDataType.String, Stimulsoft.Report.Components.StiFilterCondition.EqualTo, Value));
For RenderingEvent write following:

Code: Select all

Chart1.Series[0].Filters[0].Value = Value
See the attachment.

Thank you.
Attachments
17.Charts With Groups.zip
(3.02 KiB) Downloaded 277 times
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

Charts With Groups

Post by Guest »

You can use the filters for series of chart in the event of databand. Write for BeginRenderEvent:

Code: Select all

Chart1.Series[0].Filters.Add(new Stimulsoft.Report.Chart.StiChartFilter(Stimulsoft.Report.Components.StiFilterItem.Value, Stimulsoft.Report.Components.StiFilterDataType.String, Stimulsoft.Report.Components.StiFilterCondition.EqualTo, Value));
For RenderingEvent write following:

Code: Select all

Chart1.Series[0].Filters[0].Value = Value
See the attachment.

Thank you.
Attachments
18.Charts With Groups.zip
(3.02 KiB) Downloaded 249 times
Johnt000050
Posts: 3
Joined: Thu Aug 02, 2007 3:11 pm
Location: Philly

Charts With Groups

Post by Johnt000050 »

Pavel wrote:You can use the filters for series of chart in the event of databand. Write for BeginRenderEvent:

Code: Select all

Chart1.Series[0].Filters.Add(new Stimulsoft.Report.Chart.StiChartFilter(Stimulsoft.Report.Components.StiFilterItem.Value, Stimulsoft.Report.Components.StiFilterDataType.String, Stimulsoft.Report.Components.StiFilterCondition.EqualTo, Value));
For RenderingEvent write following:

Code: Select all

Chart1.Series[0].Filters[0].Value = Value
See the attachment.

Thank you.
We are also having the same issue. (By the way, the zip file doesn't have xsld file and I couldn't run the report because of that)

The issue here is that we need to group by the PlanName, and the series (argument column in chart designer) is the AppName the value (value column in chart designer). What we should get is...

P1
====


P2
====


P3
====


According to your example, you are filtering the value. What we will be getting 8 charts with value 12, 15, 17, 21 (2 bar), 32, 28, 18, , 25 respestively.
Arunkumar S
Posts: 21
Joined: Mon Jul 23, 2007 5:12 am
Location: Chennai

Charts With Groups

Post by Arunkumar S »

Hi,

Rendering Events also didn't help. But Found another way to work it out. I have just splited the data into 2 seprate data sources.

In our Example, Initally i had only one data source with following columns
PlanName AppName Value
P1 A1 12
P1 A2 15
P1 A3 17
P2 A1 21
P2 A2 32
P2 A3 28
P3 A1 19
P3 A2 29
P3 A3 25

Now, I have created the First data source "DS1" With only My Plan Name Column, And the Second Data Source "DS2" with Above Said 3 Columns, Then created a relation "REL1" in the "DS2" with Plan name as the link column.

Now In the Report, Added the Group Header Band, Assigned DS1.PlanName
Added the Data Band, Assigned the DS1,
Added the chart in the data band, then Assigned the data source as DS2, and Assigned the Relation "REL1"
Now i'm Getting Exactly 3 Charts with 3 Bars In Each.

Hope this would help!.

Thanks.
Arunkumar.s
Senior Application Developer.
Indepth Solutions Pvt Ltd.
India.
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Charts With Groups

Post by Brendan »

Hi,
I also had to do something similar to this a couple of weeks ago.
You seem to already have figured it out but I'll post the sample I have if it helps you or others in the future.

What I done was created a 2nd Datasource based on the registered Data Source and then grouped the data by Plan Name. I do this by using the "New Datasource... -> Data from other Data Source. Select my Original Datasource, Select the Groups Tab, Add Group and Select PlanName, click ok", Set Cache All Report Data property to true and then create a relationship between the new Datasource and my original.

I drop my New Datasource onto a page creating a databand, place a Chart inside the databand and set the Datasource of the chart to my original datasource and the relation to the one I created.

Sample File Download
Post Reply