Navigation:  Reference > Commands >

Setup Report Buffer

Print this Topic Previous pageReturn to chapter overviewNext page

 

This command is used to create the report buffer used in the other report commands.

 

 

SETUP_REPORT_BUFF

 

RB_NUM f/c/eRequired - The Report Buffer Number.  This must start at 1 (in any report the first page - main - automatically starts at 1) and there are a maximum of 15 available.  Each level is going to have to be a different number with the sub-levels linking back to a master.

 

REPORTNAME f/c/e If you are setting up Report Buffer Number 1 then you must include the name of the report here.  This is the name of the RTM file to use.  If it's not in the current subdirectory, you must also include a complete path.

 

LINK_TO f/c/e If this is a sub-level buffer, you would put the master buffer RB_NUM here.

 

 

COMMENTS

The program, WTASDMGR.SRC, contains a complete printing routine that displays a multi-level printing process.  It starts at the label tbPrint.Click.  WTASDMGR.RTM is the actual report format that is used.  We provide the program in source format, documented internally, so that you can see first hand a multi-level report.

 

These buffers will be the ones you refer to in Output Report Data and Update Report Data.

 

NOTE:  You must start with RB_NUM 1.  This initializes the buffers for a new report.

 

NOTE:  This command must not be in the START (or OnStart) event for the form.  It can be anywhere in the normally executed code and is generally immediately before the report data collection routines are executed.

 

NOTE:  When a buffer is created the program scans through the report format and makes sure that any DataFields on that page are included.  It also will include a space in the buffer if you have defined a field in your program where the name matches the name of an object used on that page.  This is how you control whether or not that object will appear while a specific record is printing.  The field in your program should be defined as a type A and size of 3.  Then, during the data collection process (OUTPUT_REPORT_DATA and UPDATE_REPORT_DATA commands), if you save 'ON' to the field the object will be printed, if you save 'OFF' it won't be printed.  You must also check the OnPrint Control Flag checkbox for the object before this will have the desired effect.  For an example of this please refer to the Tutorial, PART 4 - CREATING A TAS Professional REPORT.

 

NOTE: When you init a new sub report make sure you assign a TAG  # or you will get an error when you try to init the sub report.

setup_report_buff rb_num 1 REPORTNAME 'myreport'

setup_report_buff rb_num 2 Link_to 1 //If you get here at runtime and get an error you forgot to assign this buffer in your rtm a TAG  # in this case it going to be  2.

 

SEE ALSO

PRINT_REPORT

 

EXAMPLE

A step-by-step example of setting up a new report is provided in the Tutorial.

 

Note : if you want to re use the report buffer and clear it for another report re issue the the command

Sample code

(* The following is a what a simple report might look like that

  prints a customer code and name from the file BKARCUST.

  This report assumes that the file has been opened someplace

  else and that the handle field name is bkarcust_hndl.

 

  The first step is to create the buffer for the data we will save.

  Notice that we use '_' in the setup and '.' in the output.  *)

 

setup_report_buff rb_num 1 reportname 'simple'

 

(* The SCAN command will loop through the file starting at

  the beginning and retrieving each record in customer code order. *)

 

scan @bkarcust_hndl key bkar.custcode

output_report_data rb_num 1

ends

 

// at the end of the scan we execute the report

 

print_report

      // to clear the report buffer

setup_report_buff rb_num 1 reportname 'simple'

ret

 


Page url: http://www.cassoftware.com/tas/manual/setupreportbuffer.htm