Create a custom generic report for simple list or form list

You can use a custom template to create a report. The custom template must be based on the simple list or form list template schema.

  1. Set the auto-formatting type to "New List":
    CALL fgl_report_setAutoformatType("NEW LIST")
  2. Set the fglAutoformatTemplateURL rendering hint to point to a template (.4rt file). The custom template must be based on either the SimpleListTemplate.rsd or FormListListTemplate.rsd schema in the GSTDIR/gre/templates directory.
  3. Set the mandatory values using the fglAutoformatLogoURL, fglAutoformatOrganizationName, fglAutoformatSelectionText, fglAutoformatKeyText, fglAutoformatPrintingInformationText, and fglAutoformatNumberOfFormColunms rendering hints.
  4. Optional: Extend the schema by adding custom placeholders and assigning their values using rendering hints. For example, if a placeholder is called "PrintingDate", then specify the date using the fglAutoformatPrintingDate rendering hint.

Example

The following example, from OrderReport.4gl in the Reports demo, sets the values for the "New Generic List" template:

CALL fgl_report_setAutoformatType("NEW LIST")
      IF filename!="New Generic List.4rp" THEN
            LET renderingHints=om.saxAttributes.create()
            LET GSTDIR=fgl_getenv("GSTDIR")
            CALL renderingHints.addAttribute("fglAutoformatTemplateURL",GSTDIR.substring(1,GSTDIR.getLength()-4)||"/gre/templates/"||filename.substring(18,filename.getLength()-4))
            CALL renderingHints.addAttribute("fglAutoformatOrganizationName","Four Js Development Tools")
            CALL renderingHints.addAttribute("fglAutoformatKeyText"," ")
            CALL renderingHints.addAttribute("fglAutoformatSelectionText","Sorted by Customers and Orders")
            CALL renderingHints.addAttribute("fglAutoformatPrintingInformationText","Revenue List")
            CALL fgl_report_setRenderingHints(renderingHints)
       END IF