How can i take the MaxD() value from the SumD() values

Stimulsoft Reports.WEB discussion
Post Reply
M.I.A
Posts: 22
Joined: Thu Mar 11, 2010 1:50 am

How can i take the MaxD() value from the SumD() values

Post by M.I.A »

Hello all

I want take the max number of the complete column for example the table below:

Student Present Number
5
12
20
16
3
25
11
18
20
8



I want take the max number of the above column, put it in variable or any other way to use it in the next column, for example the max number of the above column is (25), so my report should be like this:

Percentage Present ----------------------------------------------------------- Student Present Number
(5/25) * 100% --> Just the result must be here ----------------------------------------- 5
(12/25) * 100% ------------------------------------------------------------------------------- 12
(20/25) * 100% ------------------------------------------------------------------------------- 20
(16/25) * 100% ------------------------------------------------------------------------------- 16
(3/25) * 100% ------------------------------------------------------------------------------- 3
(25/25) * 100% ------------------------------------------------------------------------------- 25
(11/25) * 100% ------------------------------------------------------------------------------- 11
(18/25) * 100% ------------------------------------------------------------------------------- 18
(20/25) * 100% ------------------------------------------------------------------------------- 20
(8/25) * 100% -------------------------------------------------------------------------------- -8


I got the (Student Present Number) column by sitmulsoft, after I created datasource, I wrote under the text component in the text expression this: {SumD(DataSource1.StudentStatus)} and the result now coming correct for that column.




I tried this code in the code page in stimulsoft environment:
int maxNum = {MaxD{SumD(DataSource1.StudentStatus)}}


And under the text component of the (Percentage present) column I wrote this:
({SumD(DataSource1.StudentStatus)}/maxNum) * 100%

But ofcourese this did not work.

Please help, Thank you.

Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How can i take the MaxD() value from the SumD() values

Post by Jan »

Hello,

Can you attach your report this topic (or send it to support@stimulsoft.com). We need it to better understand report structure.

Thank you.
M.I.A
Posts: 22
Joined: Thu Mar 11, 2010 1:50 am

How can i take the MaxD() value from the SumD() values

Post by M.I.A »

Hello Jan

My report in the attachment.

Thank you.
Attachments
412.AttPercentageReport.mrt
(23.48 KiB) Downloaded 415 times
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How can i take the MaxD() value from the SumD() values

Post by Jan »

Hello,

If i right understand you need use following expression:

Code: Select all

{DataSource1.StudentStatus / MaxD(DataSource1.StudentStatus) * 100}%
Thank you.

M.I.A
Posts: 22
Joined: Thu Mar 11, 2010 1:50 am

How can i take the MaxD() value from the SumD() values

Post by M.I.A »

Hello Jan


Your code is close to what i want, but i exactly want something like this:

Code: Select all

{DataSource1.StudentStatus / MaxD(SumD(DataSource1.StudentStatus)) * 100}%
but i know this is not valid operation.

Because the Sum is not calculated in the (StudentStatus) column, and i calculate it in this line of code "SumD(DataSource1.StudentStatus)" and in the same time i want take the max value of this column after the sum operation.


Thank you.
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

How can i take the MaxD() value from the SumD() values

Post by Jan »

Hello,

In your report you have only one data source (and databand). So you receive only one result of calculation of SumD function. In this case MaxD function does not have sense.

Thank you.
Post Reply