Page 1 of 1

Subtotal on current page, SQL datasource

Posted: Tue Feb 10, 2015 10:15 am
by MP_Synergy
Hi,

I am trying to get a subtotal for the current page of an SQL column that has data returned to a panel. If the number of rows returned from the sql is split across more than one page, I would like to display the subtotal of each page's results at the bottom of the page.

I have tried using an example that is not for sql:
http://forum.stimulsoft.com/viewtopic.php?t=3655

Where you use cSumRunning. This is for a running total, but it does not work exactly as I intended either as it will display the total of page 1 on page 2, and the total of page 1 + 2 on page 3, and so on. What I would expect is to have the total of page 1 on page 1, then the total of page 1 + 2 on page 2.

Can you give me any advice on how to get the current page total when using an sql server database as a datasource?

Many thanks,

Mital

P.S. Apologies if this is the wrong forum.

Re: Subtotal on current page, SQL datasource

Posted: Tue Feb 10, 2015 1:33 pm
by Alex K.
Hello,

Can you please send us your report with test data for analysis.

Thank you.

Re: Subtotal on current page, SQL datasource

Posted: Wed Feb 11, 2015 11:51 am
by MP_Synergy
Hi,

I've exported the sql data to a csv file to use. Although this will not replicate any problems encountered due to the fact that data is being retrieved from sql.

The STKC_QTY running total is giving the total for the page before, I would like to have the total displayed for the current page rather than the page before.

I'd also like to know how to get a subtotal per page, so it each page would display 8 rather than 8, 16, 24, etc.

I have the data file and the mrt but I'm not sure how to attach them to this post.

edit: I've attached the mrt and example data.

Re: Subtotal on current page, SQL datasource

Posted: Thu Feb 12, 2015 7:32 am
by Alex K.
Hello,

We couldn't reproduce this bug.
Please try to check the last build.
I'd also like to know how to get a subtotal per page, so it each page would display 8 rather than 8, 16, 24, etc.
You can use the following expression:

Code: Select all

{cSum(DataDataSource1,DataSource1.STKC_QTY)}
Thank you.

Re: Subtotal on current page, SQL datasource

Posted: Fri Feb 13, 2015 9:41 am
by MP_Synergy
Thank you for your response. We are using an older version which would explain the issue. There is a property against the text field called "Process at End". In our version this can only be set to true or false, however in the latest version it seems you can set this to "end of page" and "end of report". Setting it to "end of page" gives the results you posted.

Re: Subtotal on current page, SQL datasource

Posted: Fri Feb 13, 2015 10:28 am
by Alex K.
Hello,

Let us know if you need any additional help.

Thank you.