RTF Tips and Tricks - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

RTF Tips and Tricks

Description:

Develop with sharing in mind. e.g., multiple-project proposals ... Can also export any text-based format, e.g., XML, HTML. Running external programs and DLL ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 14
Provided by: paul372
Category:
Tags: rtf | sharing | tips | tricks

less

Transcript and Presenter's Notes

Title: RTF Tips and Tricks


1
RTF Tips and Tricks
  • Trnsport Users GroupPresentation
  • October 15, 2004

2
Why Were Here
  • C/S Release 5 added a lot to RTF
  • RTF was added to SiteManager fairly recently
  • Many people havent worked with it, or arent
    aware of all its capabilities
  • This is not an RTF class

3
Zen and the Art of RTF
  • Read the manual, significant updates in December
    04 release
  • Study existing templates
  • Adapt, instead of re-invent, if possible
  • Develop reports incrementally
  • Logic before formatting
  • Outline
  • Work from the outside in
  • Develop as plain text report first

4
Save Someones Sanity(possibly even your own)
  • Develop with sharing in mind
  • e.g., multiple-project proposals/contracts
  • Comment, comment, comment
  • Then comment some more
  • RTFLOG.TXT is your friend
  • Indent code blocks
  • Comment ENDIFs, ENDREPEATs, etc.

5
Enhance Your Performance
  • SELECT usually isnt the best query
  • Do you really need all the columns?
  • Avoid WHERE_OR_AFTER
  • Retrieves ALL rows matching the condition
  • Keep database keys in mind
  • Keep unnecessary statements out of loops

6
Good Stuff
  • NUM_ROWS special variable
  • Gives the number of rows that the latest GET or
    REPEAT command found
  • FOUND special variable
  • Returns true if the latest GET or REPEAT command
    found a record that matches the condition in the
    command
  • ! can be used as a pointer of sorts (code_ex.)
    (output_ex.)

7
More Good Stuff
  • Exporting data using RTF
  • CSV, COLUMNAR built in
  • Can also export any text-based format, e.g., XML,
    HTML
  • Running external programs and DLL functions
    within an RTF template (code_ex.)(rawout_ex.)(fino
    ut_ex.)

8
Exporting Data
  • From CAS ArchiveContracts.rtf
  • LET table_name "CONTMOD"
  • REPEAT OVER CONTMOD WHERE CONTID IS
    SUBSET.CONTID
  • EXPORT CSV table_name, SUBSET.CONTID,,
  • CONTMOD.CMODTYPE,,
  • ...

9
Calling an External Program Example 1
  • From SiteManager SMVend2ebs.rtf
  • load SystemCall
  • ...
  • let OutputFile t_cd_tbl_dtl.cd_desc
  • ...
  • call plug in SystemCall( "if exist "
    OutputFile " del " OutputFile )
  • ...

10
Calling an External Program Example 2
  • From CAS casecnt.rtf
  • load SystemCall
  • ...
  • call plug in SystemCall( "del " CFBEXPTDIR
    "\d" subset.cnfacs ".dat" )
  • ...

11
What on Earth is CFBEXPTDIR?
  • Environment variable
  • Defined in ITIDPSSV.CFG
  • Other job-specific variables are defined in the
    job parameter file
  • Other examples OutFiles, SysFiles
  • For a list, look at a JOBPARM.TXT file
  • JOBEXEC.TXT also handy

12
RTF Tips and Tricks
  • Mark Douglas
  • mark.douglas_at_infotechfl.com

13
Questions??
Write a Comment
User Comments (0)
About PowerShow.com