Cross tab - Relationship between values

Stimulsoft Reports.NET discussion
Post Reply
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Cross tab - Relationship between values

Post by Fabio Pagano »

Hi
I need your help with cross tab.
I have two value in summary field and I need to make relationship between values. I'll explain better: value1 / value2.
Value1 is a sum of field "minute", value2 is a count of field "person". So I'd like to have a relationship to obtain How many minutes employ a person for a given activity.

thanks in advance
best regards
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Cross tab - Relationship between values

Post by HighAley »

Hello.

You could use next code in the ProcessCell event of the cell.

Code: Select all

if (Cells[0,-1]> 0)
    e.Value = Cells[0,-2] / Cells[0, -1];
else
    e.Text = "NONE";
Please, look at the attached report template.

Thank you.
Attachments
CrossTabProcessCell.mrt
(15.46 KiB) Downloaded 384 times
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: Cross tab - Relationship between values

Post by Fabio Pagano »

Good evening. Thank you for the answer, we have correctly populated the cell.

Anyway, we've seen that the cell's totals are not correctly calculated: we've used your report as example with the datasource "demo.xml" present in Stimulreport installation.

In the attached files we've put in square red the total cells not correctly calculated:
Image5.png
Image5.png (8.56 KiB) Viewed 4419 times
Image7.png
Image7.png (13.3 KiB) Viewed 4419 times
Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Cross tab - Relationship between values

Post by HighAley »

Hello, Fabio.

It's possible to hide these Totals. Or you need to show something there.
Could you specify this moment?

Thank you.
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Re: Cross tab - Relationship between values

Post by Fabio Pagano »

Hello,
I'd like to see in column TOTAL the average of TOTAL.
thanks
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Cross tab - Relationship between values

Post by Alex K. »

Hello,

We need some additional time to prepare a code for your task.

Thank you.
Alain25170
Posts: 4
Joined: Thu Feb 04, 2021 9:40 pm

Re: Cross tab - Relationship between values

Post by Alain25170 »

Hello

Did you get a response for this problem?

Thank you
D
Lech Kulikowski
Posts: 6196
Joined: Tue Mar 20, 2018 5:34 am

Re: Cross tab - Relationship between values

Post by Lech Kulikowski »

Hello,

You can use the ProcessCell event of the cell for such tasks.

Thank you.
Post Reply