Accountant in Fastreport sums more than once, how to solve?

Asked

Viewed 763 times

1

I have a very complex report in fastreport on a certain page the structure is a Masterdata -> Detaildata and within this Detail have the required components, Everything works 100%, it happens that in a fxtMmo need to put the number of the sheet this will number in sequence each spreadsheet of Detail.

I did the following, in the code I created a global variable ContaPlanilha: integer = 0;

In the frxMemo Beforeprint: ContaPlanilha := ContaPlanilha +1;

In the text of frxMemo I put "Planilha número: [ContaPlanilha]"

It takes the value of the variable and puts it in the frxMemo as it should be, it turns out that even having only 1 test record, the variable has the value set as 2 is like passing twice in the Onbeforeprint, but as said only has 1 single record...

I am using "Double Step" because it is a complex report and I need some values of variables that are only available in this condition

It seems to me that this "Double Step" is causing this problem, but how to create an incremental variable without this problem?

1 answer

3


Friend, make use of the if Engine.FinalPass before increasing its variable, with it you can know if it is in the first or according to step and consequently, can increase its variable only once.

  • Killed the stick Andrey, that’s right

  • Very good the answer...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.