Recent

Author Topic: Total Pages after Gruop  (Read 4183 times)

pmesquita

  • Jr. Member
  • **
  • Posts: 62
Total Pages after Gruop
« on: June 14, 2021, 01:44:33 pm »
Personal,
How are we going?

I would like to know if it is possible .. because I looked but I didn't find anything that you solved ..

I have a report that basic is 3 bands: GroupHeader/MasterData/GroupFooter; - But in the "GroupCondition" of the GroupHeader I put a column to force the grouping of records but in this grouping I need the total pages to follow the grouping, that is:

Query:
ID ---- Name
1 one
1 ------ one one
1 ----- one one one
2 two
2 ----- two two
2 ----- two two two

Report
1 ----- one -> Page 1 of 3
1 ----- one one -> Page 2 of 3
1 ----- one one -> Page 3 of 3

after grouping by ID in GroupHeader

2 ----- two -> Page 1 of 3
2 ----- two two -> Page 2 of 3
2 ----- two two -> Page 3 of 3

what's happening to me is the total number of pages this is the total number of sheets in the report (obviously...) but I need to reset the Pages and TotalPages after grouping...
is there how to do this?

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: Total Pages after Gruop
« Reply #1 on: June 14, 2021, 08:27:40 pm »
I would like to help you, but I'm not sure I understand what you want.

First question is data from your query. Does it have 6 rows or did you show some grouping already?

Code: Text  [Select][+][-]
  1. ---------------------------------------
  2. |Row No. | ID  | Name                 |
  3. |--------|-----|----------------------|
  4. |1       |  1  | one                  |
  5. |2       |  1  | ------ one one       |
  6. |3       |  1  | ----- one one one    |
  7. |4       |  2  | two                  |
  8. |5       |  2  | ----- two two        |
  9. |6       |  2  | ----- two two two    |
  10. ---------------------------------------

Then what you refer to as 'Report' and 'after grouping by ID in GroupHeader'. Is it two parts of same report or do you get result as the former and you want it to look like latter?
I don't see '----- one one one' and '----- two two two' in your example of report, why is that?

Is it possible that you write exact result set from your query and draw on paper how you want your report to look like and post photo?

If it is just manipulation with page number you could use OnGetValue event of report and manipulate page numbers in code. Or you can use scripts in report's objects.

pmesquita

  • Jr. Member
  • **
  • Posts: 62
Re: Total Pages after Gruop
« Reply #2 on: June 15, 2021, 03:23:46 am »
Quote
First question is data from your query. Does it have 6 rows or did you show some grouping already?
Yes, a query is already sorted by the field that will be used for grouping as in your example.

Quote
Is it possible that you write exact result set from your query and draw on paper how you want your report to look like and post photo?

I'll try to explain it another way, because I think I wasn't clear...
Starting from your query if I import these records in the report, there will be the assembly and page break using the X field in the GroupHeader and in the footer the current page and the total pages so far will be calculated without problems.

What I need is that: When generating the report, when there is a change in the value of field X from A to B, there is a reset of the total of Pages and the current page as in the example below...

Report:
Code: Pascal  [Select][+][-]
  1. ID 1
  2.     One
  3.    One
  4.     One
  5.  
  6. --- Footer: 1 Of 1
  7.  
  8.  
  9. ID 2
  10.     Two
  11.     Two
  12.     Two
  13.  
  14. --- Footer: 1 Of 1
  15.  

As in the example above, when there is a page break using the ID field, the PAGES and TOTALPAGES variables must be reset because in my situation it is generating and counting the total of pages: x of 2 pages

 

TinyPortal © 2005-2018