Grid summary on each page

Stimulsoft Reports.WPF discussion
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grid summary on each page

Post by HighAley »

Hello.

We make in improvement to solve your problem. The patch will be available on September 26.
But you should also to change your report. You should add a Data Band name to cSumIf() function

Code: Select all

{cSumIf(DataSource2, Clients.Qualities.Value,Clients.Qualities.PName.Name == "A")}
Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

I tested it today and works fine. Thank you for help.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grid summary on each page

Post by HighAley »

Hello.

It's a good news.
Have a nice weekend.

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Hello again.

I found new problem. Now list is dynamic, so i don't know correctly how much element will be in list and how much I have to summary.
Sample 1
Sample 1
sample1.png (48.61 KiB) Viewed 5549 times
So:
- I have list A, and this list contain list of Quality (each quality has Value and Name)
- I want to display list of Quality as row in list A
- List of Quality is dynamic (as show on picture)
- I want to summary each column of grid - so summary Quality with the same name (they are in the same column in grid - as show on picture)
If this list wasn't dynamic, i could put condition like:

Code: Select all

{cSumIf(DataSource2, Clients.Qualities.Value,Clients.Qualities.PName.Name == "A")}
but now I do not know how many item will be in this list A.
My idea was to add additional field as "Number" and in this field set the number of column this Quality belong. And then I add Variable "Number" and i wanted to have condition like this

Code: Select all

{cSumIf(DataSource2, Clients.Qualities.Value,Clients.Qualities.Number == Number )}
and in event of this TextBox increase "Number" after printing (or something like that).
My first reaction was - It should work - but it do not. "Number" in event is increasing very well (as show on picture), but what I see is that "conditions" is performed before this TextBox is printing.
My questions are:
- Do you have any idea where I should put incresing "Number", to make it work in conditions in summary?
or
- Do you have better solution to this problem?

Of course i add to attachments sample project and report.

Thanks you in advance.
Attachments
Report.mrt
Raport
(22.44 KiB) Downloaded 456 times
StimulsoftWpfApplication.zip
Sample project
(4.55 MiB) Downloaded 446 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Grid summary on each page

Post by HighAley »

Hello.

Sorry for delay with answer. We need some additional time.

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

Hello.

Any progress about this issue?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Grid summary on each page

Post by Alex K. »

Hello,

Can you please send us a sample, screenshot or image how it should look like for more understanding your task.

Thank you.
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

I a bit modified my screenshot and now maybe it will be easier to understand.
sample1.png
sample1.png (60.66 KiB) Viewed 5496 times
What i want:
- I have list that contains dynamic list (i do not know exactly how many items will be in the dynamic list, but in all dynamic list will be the same amount of element).
- I want to have summary on each page: for example I have list that contains 3 dynamic list and each dynamic list has 5 element. I want summary on each page that will sum: first value of all dynamic list, second value of all dynamic list, third value of all dynamic list, etc.
It should look like this:
Grid:
Dynamic list ID | Value 1 | Value 2 | Value 3 | Value 4 | Value 5
ID: 1 | 1 | 1 | 1 | 1 | 1
ID: 2 | 5 | 9 | 11 | 2 | 9
ID: 3 | 4 | 0 | 1 | 2 | 6
Summary:
Total on this page | 10 | 10 | 13 | 5 | 16

And the problem is, that this list is dynamic, so I do not know how many items will be in this dynamic list, so I am not sure how can I do summary to it.
My idea was as i showed in sample report - to add additional filed "Number" to dynamic list (first element in dynamic list has Number = 1, second has Number = 2, etc.) and add additional variable "Number" and in conditions in Sum check that Number from dynamic list is equal to Number from variable, and than in Event (for example "after print") increase variable Number and than do the next Sum.
If it matter I can send from project to report information (for example in additional Variable "DynamicListCount") information about how many items is at the momemnt in dynamic list.

I hope you will more understand it. If you still have some troubles with understand what I want to achieve (I know, that it is a bit complicated), than I will try to do better sample project, but it will be after 6 May.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Grid summary on each page

Post by Alex K. »

Hello,

As a way, you can use the additional variable with conditions and additional code in BeforePrint event.
Please check the modified report in attachment.

Thank you.
Attachments
Report_modified.mrt
(23.53 KiB) Downloaded 349 times
Niqu
Posts: 81
Joined: Wed Aug 08, 2012 9:08 am

Re: Grid summary on each page

Post by Niqu »

You can see that your idea is wrong?
In event you put code like

Code: Select all

if (Column == 1)
Sum1 += Clients.Qualities.Value;
and in conditions like

Code: Select all

if (Column == 1) {...}
It is a idea, but it work only for static list, not for dynamic list - in this example I have only 4 columns, but normally this number is "dynamic".
As I thought, you do not understand me correctly, so i will make better sample project, to better show how it should look like.

Edit:
I make some other sample project to show how it should work.
I add only 3 clients (to easier math) and on the beggining there are 3 element in dynamic list, but we can add additional element to this list. Try to add 2 additional element and look what happen - your raport will be broke, because your report is for static not for dynamic list.
I hope now you will better understand what is my problem and what I want to achive.

Thank you in advance for your help.
Attachments
StimulsoftWpfApplication4.zip
(4.55 MiB) Downloaded 371 times
Post Reply