Home Page FO Designer user guide. XSL-FO tool for Oracle APEX and the Java[TM] platform
Home
                                                    FO Designer guide
                                                  • First steps
                                                  • Introduction
                                                  • The user interface
                                                  • Working with the interface
                                                  • Structure of the template
                                                  • Executing the template to create PDF files
                                                  • Learn by doing
                                                  • The invoice IDOC example
                                                  • The Group by example
                                                  • The two columns example
                                                  • Barcodes
                                                  • Charts
                                                  • The running totals example
                                                  • Interactive forms
                                                  • Flavours
                                                  • The base template
                                                  • Long texts and HTML fields
                                                  • The memo field explained
                                                  • Advanced functionalities
                                                  • FOP Could Server
                                                  • Migration of existing XSL-FO files
                                                  • FAQS
                                                  • Troubleshooting
                                                  • Licenses
                                                  • The two columns example
                                                    bcl_716964462.htm

                                                    9. The two columns example

                                                    The example tasksTwoColumns shows how to use Xpath to create a two columns report using a linear input XML file. The output will look like this:



                                                    It is a list of tasks organized in 2 columns, with the task name and the employee assign to the task.

                                                    The layout of the report is:

                                                    • there is a detail area which will contain 2 task name fields (2 columns). Therefore the area will need to be repeated for every second task. The Xpath to achieve this is:

                                                      ROWSET/ROW[position() mod 2 = 1]

                                                      This will select every second „ROW“ element in the XML
                                                    • In the area there are 2 TaskName field. The Xpath of the fields are:
                                                      • TASK_NAME : to select the TASK_NAME field in the current ROW node
                                                      • TASK_NAME/../following-sibling::ROW/TASK_NAME: to select the TASK_NAME field in the next ROW after the currently selected ROW (this will be the second column)

                                                        the XPATH expression means:
                                                        • select current TASK_NAME
                                                        • use the /../ to select the parent node (the ROW node)
                                                        • following-sibling::ROW: will select the next ROW
                                                        • /TASK_NAME selects the field in the ROW