Blog Pro de Jean-Baptiste HEREN

Notes d'un consultant Freelance en Informatique

To content | To menu | To search

Squelette Sqr Report

SQR est un langage assez fastidieux à déboger, et l'on se laisse souvent prendre aux petits pièges comme par exemple, la nécessité d'indenter les ordres sql pour qu'ils fonctionnent...
Voici donc un squelette de programme sqr. J'espère que comme pour moi, il vous évitera d'obtenir des erreurs avant même d'avoir commencé à programmer :).

Vous trouverez joint à ce post, le fameux fichier WORDFILE.TXT permettant la coloration syntaxique de SQR dans l'éditeur UltraEdit.

#INCLUDE 'SETENV.SQC'
BEGIN-SETUP
    #INCLUDE 'SETUP01.SQC'
END-SETUP
!-------------------------------------------
! Begin-Heading
! Standard Section ran on each pages
!-------------------------------------------
BEGIN-HEADING 6
  print 'header' ()
END-HEADING
!-------------------------------------------
! Begin-Footing
! Standard Section ran on each pages
!-------------------------------------------
BEGIN-FOOTING 4
  last-page           ()  ' /' ' '      ! "Page 12 of 25.
END-FOOTING
!-------------------------------------------
! Begin Report
! Main section of program execution (standard for Reports).
!-------------------------------------------
BEGIN-REPORT
   ! We have to manualy manage the line position
   let #line = 1
   let #col = 1
   let $mytext1 = 'test1'
   let $mytext2 = 'test2'
   ! Print my text1
   print $mytext1 (#line, #col)
   ! We have to manualy manage the line position
   ADD 1 TO #line
   ADD 10 TO #col   
   ! Print my text2
   print $mytext2 (#line, #col)
   ADD 1 TO #line
   do MY-REPORT
END-REPORT
!-------------------------------------------
! Your Custom Procedure
! Put here the main part of your Report
!-------------------------------------------
BEGIN-PROCEDURE MY-REPORT
  print 'page1' (#line, #col)
  
  ! Create new page
  new-page
  MOVE 1 TO #line
  MOVE 1 TO #col 
  print 'page2' (#line, #col)
END-PROCEDURE !MY-REPORT
Jean-Baptiste Heren

Author: Jean-Baptiste Heren

Stay in touch with the latest news and subscribe to the RSS Feed about this category

Comments are closed



You Might Also Like

Finding one component location in the peoplesoft portal

Just replace the 'MY_COMPONENT_GBL' parameter in the following sql script. This works for MS SQl Server. You can add more levels by adding Outer Joins. [SQL] /* Where is my component in the portal */...

Continue reading

02_-_new_component_interface.png

Peoplesoft Component interface HOWTO

Here is a tutorial explaining how you can create a function containing one Component INterface, and make use of it from any peolplecode. Following example takes the PO Receipt Component to make...

Continue reading