Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Using the ON EVERY ROW variables on a PAGE HEADER  (Read 15266 times)
Silvia A.
Posts: 6


« on: July 19, 2011, 11:17:23 am »

I'm trying to print variable data on the page header, but it always print the first value sent to the report.

Versions Used
  Server:
    CentOS 5.1 32 bits
    Genero BDL 2.32.03
    Report Designer 2.32.24
    Report Engine  2.32.09
   
    Java:
      java version "1.6.0_25"

I've found this topic , written two years ago:

     3.) How can i use the ON EVERY ROW variables on a PAGE HEADER ?

     --> I have a simple report ordered by 2 columns and I want to print the first column value in the page header (I print both columns on the "ON EVERY ROW" section of the report using the "PRINTX" statement, but the value printed, on every page, is the value of the first row sent to the report).




and the answer:

Do I understand the third question correctly? You have a report that displays a table of values (two columns). Now, if I put the text "This is the value of the first field of the first row of this page: xxx" in the header, this would be what you are trying to achieve?

If yes, then the answer is, that you cannot do this currently. What you can do is: "This is the value of the first column of the last row of the previous page: xxx" in the page header and "This is the value of the first colum of the last row of this page: xxx" in the page footer.

We actually have the functionality you are asking for in the backend but we did not add this option to the REFERENCEBOX to make things more simple. The option we have provided enables you to make things like "Total from previous pages: xxx" in the header and "Total until this point: xxx" in the footer.

Is this functionality active now or is there any solution to print this variable values on the page header?

Silvia Arduán
Alex G.
Four Js
Posts: 155


« Reply #1 on: July 20, 2011, 02:49:37 pm »

Hi Sivlia,
>I'm trying to print variable data on the page header, but it always print the first value sent to the report.
If you just place the variable in the header then this is what will happen. If you want the value to change based on page breaks then you need to place an invisible INFONODE in the ERVERY ROW trigger and use a REFERENCEBOX in the page header. If you do this, then the  header will show the value of the bottommost INFONODE on the previous page. The limitation explained in the other thread still applies but the request is also very unusual. What is the caption for the value you are trying to print?
Regards,
Alex 
Silvia A.
Posts: 6


« Reply #2 on: July 22, 2011, 12:38:34 pm »

Hi Alex,
We are printing some invoices all in the same report, so we have different customer data on each page header. Now we have a page break after group of document.
Using infoNode, on every page break we would need to show the value of the first Infonode on the actual page, the infonode on the previous page would have former invoice's customer data.

The reason we print all the invoices in the same report is to avoid different pdf documents for each invoice. Using report writter is it possible to keep the same pdf open for different reports? It could work for us then..

Regards,
Silvia
Alex G.
Four Js
Posts: 155


« Reply #3 on: July 24, 2011, 04:08:09 pm »

Hi Silvia,
for this you need neither INFONODE nor REFERENCEBOX. Suppose you want to print one invoice per customer and you want all invoices to end up in a single pdf,  then you write a 4gl loop that iterates over all items ordered by customer_no. As a result of that you will have a a trigger (BEFORE GROUP) of customer_no in which you place a  "Page Root" element. From the page header of this element you can freely access all customer data. This will do exactly what you describe. Within one invoice the customer data does not change, right? If it did, then you would indeed need the complicated INFONODE/REFERENCEBOX stuff.
Regards,
Alex
Silvia A.
Posts: 6


« Reply #4 on: July 25, 2011, 08:48:19 am »

Thanks Alex, that works perfect, I was wrong and thought page root had to be definded before all the groups of the report.
Regards,
Silvia
Alex G.
Four Js
Posts: 155


« Reply #5 on: July 25, 2011, 09:25:22 am »

Hi Silvia,
that is great that you could make it work from the textual explanation only. Yes, you can have several page roots and even have them nested as in the attached example which illustrates the issue using a simple report. The page root is not really a special type of element. It is a top-to-bottom MINIPAGE with x-size and y-size set to maximize. Like the MINIPAGE it can be used almost anywhere in the document.
Regards,
Alex

* InvoiceBatch.zip (2.31 KB - downloaded 1162 times.)
Reuben B.
Four Js
Posts: 1126


« Reply #6 on: July 25, 2011, 03:18:23 pm »

Attached is another example of a report style similar to what Silvia is attempting to produce.  Amongst other things shows how to

  • position totals either fixed or floating
    print continued if document (invoice, purchase order etc) goes onto the next page
    keep columns aligned with different fonts for heading and detail
    alternate background colour of lines in detail
    page numbering for the document (invoice, purchase order etc)

To go back to something that was mentioned in the first post "I'm trying to print variable data on the page header, but it always print the first value sent to the report.", a subtle difference between an Informix and GRW Report is that in Informix PAGE HEADER uses the first row of data on the page, PAGE TRAILER uses the last row of data sent to the page.  What GRW does is uses the first row of data for both the pageHeader and pageFooter sections.

How I explain that in my classes (for those in the Asia Pacific region I expect to be running some classes in the next few months) is that at the beginning of the page, the layoutter draws the pageHeader and the pageTrailer, and then it knows how much space there is for the page detail in between.  So at the time the pageHeader and pageTrailer is rendered, all the layoutter has to work with is the first row of data for the page.   (This can also be used to explain the non WYSIWYG aspect of the report designer as the layouter needs the pageHeader and pageTrailer before the page detail).  Hope that helps

Reuben

* masterdetailreport.zip (5.88 KB - downloaded 1129 times.)

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines