We are starting to explore the capabilities of the GRE.
In 4gl, we were able to generate a report with no header/footer (so the report would be continuous), in the follow way:
IMPORT FGL libgre
SCHEMA fms
MAIN
DEFINE
p_country RECORD LIKE country.*,
report_handler om.SaxDocumentHandler
database mt11
#LET report_handler = fgl_report_createProcessLevelDataFile("test1")
#START REPORT rp_test1 TO XML HANDLER report_handler
START REPORT rp_test1 to "test1.txt"
DECLARE country_data CURSOR FOR
SELECT * FROM country
ORDER BY cntryid
BEGIN WORK
FOREACH country_data INTO p_country.*
OUTPUT TO REPORT rp_test1(p_country.*)
END FOREACH
COMMIT WORK
FINISH REPORT rp_test1
END MAIN
REPORT rp_test1 (r_country)
DEFINE
r_country record like country.*
OUTPUT
LEFT MARGIN 0
TOP MARGIN 0
BOTTOM MARGIN 0
PAGE LENGTH 1
LEFT MARGIN 0
ORDER EXTERNAL BY r_country.cntryid
FORMAT
ON EVERY ROW
PRINT r_country.*
END REPORT
Using the PAGE LENGTH of 1, the above code would produce a file of 265 lines without any headers/footers.
Example output:
AD ANDORRA
AE UNITED ARAB EMIRATES
AF AFGHANISTAN
AG ANTIGUA AND BARBUDA
AI ANGUILLA
AL ALBANIA
AM ARMENIA
AN NETHERLANDS ANTILLES
AO ANGOLA
AQ ANTARCTICA
AR ARGENTINA
AS
AT AUSTRIA
AU AUSTRALIA
AW ARUBA
AX ÅLAND ISLANDS
AZ AZERBAIJAN
...etc
So if I remove the comments on lines 11 and 13 and then comment line 14, it would produce an XML file like this:
https://4js.com/2004/REPORT[/url]">
<PageHeader pageNo="1"/>
<Group>
<OnEveryRow>
<Print>
<Item name="r_country.cntryid" type="CHAR(20)" value="AD " caption="Cntryid"/>
<Item name="r_country.des" type="VARCHAR(40)" value="ANDORRA" caption="Des"/>
</Print>
<PageTrailer/>
</OnEveryRow>
</Group>
<Group>
<OnEveryRow>
<PageHeader pageNo="2"/>
<Print>
<Item name="r_country.cntryid" type="CHAR(20)" value="AE " caption="Cntryid"/>
<Item name="r_country.des" type="VARCHAR(40)" value="UNITED ARAB EMIRATES" caption="Des"/>
</Print>
<PageTrailer/>
</OnEveryRow>
</Group>
<Group>
<OnEveryRow>
<PageHeader pageNo="3"/>
<Print>
<Item name="r_country.cntryid" type="CHAR(20)" value="AF " caption="Cntryid"/>
<Item name="r_country.des" type="VARCHAR(40)" value="AFGHANISTAN" caption="Des"/>
</Print>
<PageTrailer/>
</OnEveryRow>
</Group>
.....
<Group>
<OnEveryRow>
<PageHeader pageNo="264"/>
<Print>
<Item name="r_country.cntryid" type="CHAR(20)" value="ZM " caption="Cntryid"/>
<Item name="r_country.des" type="VARCHAR(40)" value="ZAMBIA" caption="Des"/>
</Print>
<PageTrailer/>
</OnEveryRow>
</Group>
<Group>
<OnEveryRow>
<PageHeader pageNo="265"/>
<Print>
<Item name="r_country.cntryid" type="CHAR(20)" value="ZW " caption="Cntryid"/>
<Item name="r_country.des" type="VARCHAR(40)" value="ZIMBABWE" caption="Des"/>
</Print>
<PageTrailer/>
</OnEveryRow>
</Group>
<OnLastRow/>
</Report>
So using XML, it will produce 265 pages instead of 265 continuous "on every row".
If this is the expected behavior, I have the following questions:
1) Is there any way to produce an XML file with continuous rows (no headers/footers) in XML using the report constructs.
2) If not, if we produced the XML another way using the XML methods, would we be able to get the report engine to accept it. But maybe GRE would interpret this for the Excel and put each of those pages on one line. (And actually the XML that was produced doesn't look the same from page 1 to page 2)
I haven't tried number 2 and will experiment with it. My goal is to be able to send an XML file to the report engine that will produce an Excel spreadsheet. I do know that there are other ways to produce Excel using the channel and the java method, but I wanted to explore this other way.
This is 3.10.09.
Thanks,
Candy