Navigation:  Reference > Report Objects >

TppSubReport

Print this Topic Previous pageReturn to chapter overviewNext page

 

Use the SubReport object to create compound reports.  By placing one or more SubReports in a Detail Band (on any page) the program will look for a buffer that uses the same RB_NUM as the Tag property for that SubReport.  Any records waiting (they are created with the Output_Report_Data and Update_Report_Data commands) will be printed.  The Detail Band can contain a combination of text (TppLabel), objects (such as TppDBText) and SubReports.

 

PALETTE ICON & EXAMPLE

 

 

PROPERTIES

The following are the properties that apply to this object.  Some are defined in Common Properties and are linked to their appropriate page.

 

CaptionNormally a Caption property would print, however, when it's used in a SubReport it just names the object so that you can easily tell what is what on your report form.

 

HeightThe heigth of the SubReport indicator on the report form.  This has nothing to do with the actual size of the bands that will print and should remain at the default value.

 

LeftThe starting position of the SubReport indicator.  If the ParentWidth property is checked then this will always be 0.  If the ParentWidth property is not checked then this will be the starting point on the report for the SuReport to begin, almost like putting an extra margin value in.

Name

OnPrint

ParentWidthIf this is checked the SubReport indicator will stretch from one side of the report form to the other.  However, if you uncheck this option you can resize the indicator.  If you do this the SubReport will print in the space allotted.  See the EXAMPLE section below for more information.

 

ShiftRelativeToIf you have multiple SubReports in your Detail Band, or a combination of SubReports and Regions you will want to set this value to the SubReport or Region that immediately preceeds this SubReport.  By doing that this SubReport won't start printing until the other is done.  If you don't do this it will overprint the other SubReport/Region.  Also, if the previous SubReport/Region has nothing to print this SubReport will move up as you would expect.  To choose the appropriate object just click on the down arrow in the property box and choose the name of the previous SubReport/Region.  If there are no other SubReports or Regions in the Detail Band you can ignore this property.

 

TagThis is how you link the report format to your program.  The number you put here must match the number you used in the Setup_Report_Buff command (and the other output commands) in your program.  The Main page automatically defaults to 1.  So, any SubReport you add to the report format must have a Tag property value of 2 or higher. If you do not Assign a number you will get an error at runtime just before you try to setup this buffer.

 

       NOTE:  If you find your report doesn't print the data you expect (or no data at all) this is the first place to look.  If these numbers don't match (and the DataField names in the DB objects with the Setup_Report_Buff field names) then your report won't print properly.

 

Top

Visible

WidthIf ParentWidth is checked this will always be the width of the report form.  If ParentWidth is not checked then this will be the horizontal size of the SubReport in the same Units you have specified for this report.

 

EXAMPLE

Probably one of the most unique uses of the SubReport is to use two or more in a Detail Band at the same level.  For example, if you have a detail band with the following:

 

       

 

Then, assume the report is going to display a Company Name in SubReport1 and the sales for that company in SubReport2.  You might get something like the following:

 

001  Bug-B-Gone Exterminators        104     $29.95     02/01/01    500

                                               105          $10.95         02/15/01         500

002  Pro Musica                      101    $199.50     02/14/01    500

003  Little Greenhouse

004  La Villa Restaurant                102    $350.31         02/15/01         500

 

Notice how company 001 has two sales, company 003 has none, and the other two have one each.  It wouldn't matter how many sales each customer had, the proper lines would print.  In fact, you could have a multiple line print-out on the left also, and that would work just as well.

 

 

 


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