[REPORTS] merging two equal sections into one

Boom-BoxBoom-Box Member Posts: 27
Hello,

by such a title, I probably scared some people... but there's no way I can resume my doubts in one sentence...

I faced the following problem with a report:

I had one DataItem (BankAccountLedgerEntry1) to which I wanted to set a group of conditions, filters and ranges and print the results; then, I must reset all conditions and give a new set of filters and ranges, get the results and print them in the same body!

In order to make it possible for the record to obey to this different and sometimes antagonistic conditions, I used a Integer DataItem and made BankAccountLedgerEntry1 dependent of it.


so now I Have the followiing code:
BankAccountLedgerEntry1 - OnPreDataItem()

CASE RecordLoop1.Number OF

1: BEGIN
...
   END;

2: BEGIN
....

END


And now comes my real report problem:

Instead of putting all the lines in the same body, I get two equal sections (with different records, the ones I want) but I would like to merge it into the same body...
is this possible?how can I do it?

Thanks In Advance,

michael

Answers

  • BeliasBelias Member Posts: 2,998
    If I understood you...

    Process bankaccount with first set of filters and store the records in a bankaccount temptable.
    Process integer with the second set of filters and store the records in the SAME bankaccount temptable

    Delete your sections

    Create one new integer section (setrange number,1,temptable.count)
    process the temp tableusing the "NEXT" statement and show your temptable fields in this section.
    code in this new integer aftergetrecord:
    if number = 1 then
      temptable.findfirst
    else
      temptable.next
    

    if I guess what you want, you can use another bankaccount dataitem instead of YOUR integer dataitem.

    Hope it's clear
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Boom-BoxBoom-Box Member Posts: 27
    HI AGAIN,
    i found a different solution...

    both the Header and footer now belong to the integer, and the ledgerEntry only print as body!
    i also have to check if I have record or not to show the section or not:
    IF BankAccountLedgerEntry1.COUNT = 0 THEN
    CurrReport.SHOWOUTPUT(FALSE);
    

    this is worknig right now!

    thanks for your help!
Sign In or Register to comment.