Blog pro de Jean-Baptiste HEREN

Notes d'un consultant freelance en informatique

Aller au contenu | Aller au menu | Aller à la recherche

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

Article modifié le mercredi 11 novembre 2009, 21:57

Jean-Baptiste HEREN

Auteur: Jean-Baptiste HEREN

Restez au courant de l'actualité et abonnez-vous au Flux RSS de cette catégorie

Les commentaires sont fermés



Voir aussi

01-_Application_Engine_Process_Definition.png

Trace Application Engine SQL and Peoplecode

Application Engine Trace can be activated by Changing the process Definition. Go in Process Sheduler>process Definition Select the process you want to follow, Go on override tab and add the...

Lire la suite

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 */...

Lire la suite