Grouping charts

Stimulsoft Reports.PHP discussion
Post Reply
pvb
Posts: 8
Joined: Tue Oct 13, 2020 3:40 pm

Grouping charts

Post by pvb » Tue Dec 08, 2020 3:56 pm

Hello,

I have data like this:

Code: Select all

ProductID	Value
2690		1	
2690		2
2690		3
2691		1
2691		2
2691		3	 

I want to present values for every ProductID on different chart. Like this one:
monthly_stats_tn.jpg
monthly_stats_tn.jpg (10.08 KiB) Viewed 3031 times
I tried to use a solution from example (viewtopic.php?t=57239) using Variable which is set in Before Print event for group heder and then used in chart Filters property. It works fine in desktop Designer but it does not work in PHP version. Probably beacuse Before Print is not supported.

Am I right? Is there any other solution which can give me the same result?

Thank you in advance.
Lech Kulikowski
Posts: 4053
Joined: Tue Mar 20, 2018 5:34 am

Re: Grouping charts

Post by Lech Kulikowski » Wed Dec 09, 2020 7:45 am

Hello,

What code do you use in the BeforePrint event?
It should be converted to JavaScript.

> I want to present values for every ProductID on different chart. Like this one:

You can add the "Data from Other Data source" with grouping by ID and then use it as a master data source.

Thank you.
pvb
Posts: 8
Joined: Tue Oct 13, 2020 3:40 pm

Re: Grouping charts

Post by pvb » Tue Dec 15, 2020 5:22 pm

This are my settings:

1) Variable definition:
CurrentFilter (int)

2) Setting variable in Before Print event for Group1

Code: Select all

CurrentFilter = Orders.CustomerID
23 Filters property of clustered chart set to:

Code: Select all

Orders.CustomerID == CurrentFilter
Lech Kulikowski
Posts: 4053
Joined: Tue Mar 20, 2018 5:34 am

Re: Grouping charts

Post by Lech Kulikowski » Wed Dec 16, 2020 12:00 am

Hello,

Thank you for the information.
HighAley
Posts: 8391
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grouping charts

Post by HighAley » Wed Dec 16, 2020 8:28 am

Hello,

Please, try to use the next code in the BeforePrint event:

Code: Select all

CurrentFilter = Orders.getData("CustomerID");
Thank you.
pvb
Posts: 8
Joined: Tue Oct 13, 2020 3:40 pm

Re: Grouping charts

Post by pvb » Wed Dec 16, 2020 9:22 am

Hello,

Thank you for the answer. It works.

BTW: I have found another workaround solution:
1) Create master-detail report.
2) Add master and detail band to report.
3) Set master and detail height to 0 (setting Enabled=False for detail band does not work, because section is not processed)
3) Add group header for detail band.
4) Put chart on group header. Do not set any data assingment.
HighAley
Posts: 8391
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grouping charts

Post by HighAley » Thu Dec 17, 2020 7:48 am

Hello,

We are always glad to help you.

Thank you.
Post Reply