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: Foreach loop data  (Read 12145 times)
Joseph M.
Posts: 18


« on: August 22, 2009, 05:14:09 pm »

Hello,

I have several reports that are characterized as lists of items to be reported togeather on the same report. For instance I have demographic data that contain lists of items that need to be reported. Along with this I also have physical performace type data, condition data and tasks that are all stored in tables and have a varable number of rows associated with each. What I am trying to do is pass the report the primary demographic data then in a "First Page Header" block I perform the Foreach loops that collect the remaining data. I'm getting an error on the report generation like below:

Is this proper form for such a report. I have attached the report files. I can also forward the rdd file but it is too large to post to the forum.

Thanks for you help.

Joe Miller


DEBUG: ERROR: failed to consume token end element FirstPageHeader
Exception at document location :
publicId=-//FOURJS//any XML stdin//EN systemId=file:/usr/local/RM6_220_DEV/4RP/hha_note_new.4rp line no=26
LoaderStyleSheet: element no 17 path=/Report/Group/OnEveryRow
ScopeStyleSheet: element no 17 path=/Report/Group/OnEveryRow
RTLStyleSheet: element no 16 path=/Scope/Report/FirstPageHeader
HlPxmlToPxmlStyleSheet: element no 1 path=/PXML
PxmlLayouter: element no 1 path=/PXML
PdfWriterStyleSheet: element no 1 path=/DVI
ExecStyleSheet: element no 1 path=/DVI
Processor error:
com.fourjs.pxml.shared.DocumentStructureException: Expected:start element rtl:match(nameConstraint=Foreach)
        at com.fourjs.pxml.stylesheet.RTLStyleSheet.endElementEvent(RTLStyleSheet.java:908)
        at com.fourjs.pxml.stylesheet.StyleSheet.endElement(StyleSheet.java:222)
        at com.fourjs.pxml.stylesheet.ScopeStyleSheet.a(ScopeStyleSheet.java:168)
        at com.fourjs.pxml.stylesheet.ScopeStyleSheet.endElementEvent(ScopeStyleSheet.java:138)
        at com.fourjs.pxml.stylesheet.StyleSheet.endElement(StyleSheet.java:222)
        at com.fourjs.pxml.stylesheet.StyleSheet.endElementEvent(StyleSheet.java:228)
        at com.fourjs.pxml.stylesheet.StyleSheet.endElement(StyleSheet.java:222)
        at com.fourjs.pxml.stylesheet.LoaderStyleSheet.endElement(LoaderStyleSheet.java:64)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at com.fourjs.pxml.stylesheet.StyleSheetPipe.c(StyleSheetPipe.java:147)
        at com.fourjs.pxml.stylesheet.StyleSheetPipe.run(StyleSheetPipe.java:153)

* hha_note_new.4rp (29.19 KB - downloaded 1012 times.)
Romain W.
Four Js
Posts: 48


« Reply #1 on: August 24, 2009, 12:23:55 pm »

Hi Joe,

Can we pursue this discussion through support? I sent you an email about this.
Thanks

Best regards,
Romain W.
Reuben B.
Four Js
Posts: 1046


« Reply #2 on: August 26, 2009, 12:29:51 am »

Notwithstanding what is being dealt with at a support level, two things I'll point out...

1.  If you have a 4gl file with just the REPORT statement in it then the .rdd file created is smaller and hence may be able to be uploaded.

2.  One technique I used recently with data coming from multiple foreach loops was

FOREACH ... INTO a.*
   OUTPUT TO REPORT report-name("A", a.*, NULL, NULL)
END FOREACH

FOREACH ... INTO b.*
   OUTPUT TO REPORT report-name("B", NULL, b.*, NULL)
END FOREACH

FOREACH ... INTO c.*
   OUTPUT TO REPORT report-name("C", NULL, NULL, c.*)
END FOREACH

REPORT report-name(type, a-data, b-data, c-data)

ON EVERY ROW
   PRINTX type, a-data, b-data, c-data


and then in the 4rp in the ON EVERY ROW, create 3 stripes, one for a-data, b-data, c-data etc, and set the visibility condition of the stripe to be type=='A', type=='B', type=='C" respectively








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