CapeSoft.Com
Clarion Accessories
RightReports
Documentation
CapeSoft Logo

CapeSoft RightReports
Documentation

Download Latest Version JumpStart FAQ History
Installed Version Latest Version

Getting Started

Adding CapeSoft RightReports to your Application (JumpStart)

There is a completed example, in which all of the below steps have been followed, in your clarionx\3rdparty\examples\RightReports\abc folder.

Step 1: Install the latest versions of Draw, RightReports and Clarion FreeImage.

Note: You can get by without Clarion FreeImage, but it does very much limit the type of image files you will be able to use in your reports. In fact, you will only be able to use bitmaps.

Step 2: Import the RightReports Tables into your dictionary.

Step 3: Import the RightReports Procedures into your app.

Note: For NetTalk Webserver applications, its a good idea to create a desktop application with the RightReports windows in it that you can use to create, edit and test reports. So go through these steps first with a desktop app (if your webserver application does not have an existing desktop app, create a new blank one and go through the steps to add RightReports for that app as for a normal desktop app). Webserver applications, its a good idea to create a desktop application with the RightReports windows in it that you can use to create, edit and test reports. So go through these steps first with a desktop app (if your webserver application does not have an existing desktop app, create a new blank one and go through the steps to add RightReports for that app as for a normal desktop app).

Step 4: Add the FreeImage, Draw and RightReports global extensions to your Single EXE app (see Step 4a for Multi-DLL).

Note: WebServer apps must have a PDF Global extension added (either the SV one or PDF-Tools or one of the other supported 3rdparty templates) - and don't forget to check the 'Enable Printing to PDF' on the RightReports Global Extension template.

Step 4a: Multi-DLL Applications

If you have a multi-DLL application and have added Draw to your Data DLL, the way to add the global Extensions is as follows:

Step 5: Tick the Generate All File Declarations option for your app.

You can find this by clicking on the Global button and going to the File Control tab its the first checkbox. If you don't do this, RightReports will only pick up tables you've specified in the table tree structures of the procedures in your application, and you will hence be able to use only these tables in your reports at runtime. Ticking this option ensures that RightReports makes all the tables in your dictionary available to the end user.

Step 6: Fill in some of the Global Template Options.

There are three main things you probably want to worry about here:

Step 7: Call the RightReportsBrowse procedure from somewhere in your app.

This is a browse for all the reports that have been created in your program. Call the RightReportsBrowse procedure (no parameters). If your application has a Frame, adding a Browse Reports option to one of the menus might be an idea, and you'll probably want to start a thread if it's a MDI application (if it's not, then you need to turn the MDI child off).

For WebServer applications:

Step 8: Add outputs to the Previewer window

Note: Existing apps (where RightReports was added to the app with version 1.58 or prior) require a re-import of the PrintPreviewer procedure in order to support this functionality. Import the RightReportsPreviewer(legacy or ABC).txa.

By default the previewer only outputs to the printer, but you can easily add additional outputs depending on what additional tools you own. The possibilities are (at this stage): Steps to implement:

1. Open the RightReportsPremier window in the window formatter.
2. Now populate the RightReports_PrintPreviewOutput control template (just a button) onto the window, next to the existing Print select button in the output group.



Right-click and select 'Actions'. On the general tab, select the Output to you would like to use (depending on which Global Extensions you have added to your application will depend on the options visible). On the extras tab (of the control properties) change the icon to something meaningful (like RR_PDF.ico, RR_Excel.ico or RR_Word.ico)

For PDF-Tools support, you must select the "Use the PDFTools Template" checkbox.

then you need to add the code template to generate the pdf into the Previewer embed points:



The template prompts should be as follows:



4. Click OK and save your changes to the formatter window.

Do this for each output type you want to support in your report.

Step 9: Ok Go!

Compile and run your app - and take a look at the Using the Report Editor section of this doc for details on creating reports.

The Imported RightReports Procedures

You will notice that one of the steps explained above while adding RightReports to your application involved importing a number of procedures. Below we give a short description for each of these procedures.

Template Options

The Global Extension Template
The Editor Control Template
The Printer Control Template

The Global Extension

The General Tab

global general tab

The Previewer Tab

global preview tab

Depending on your choice of Report Previewer, a tab may appear with options for that Previewer. These are basically the options for that previewer as they would appear if you had installed and used that 3rdparty tool directly. Consult the documentation that came with that tool for more information on the available options. See also The Report Previewer for more details on how to install and use these 3rdparty report previewers.

The Data Sources Tab

global data sources tab

All tables in your dictionary will be included and made available to users according to the Files Tab. If you would like to make other data sources available to users, such as queues and views, you need to fill in the details here. The insert window looks similar to the following:

global add data source

You are required to enter the Label of the data source, as well as a prefix (if it has one). For View's, you need to specify its primary source. For Queues, you will notice you can add Orders to the list provided. The idea is that you give each order a unique name and specify the fields in the queue to be used for this order.

Note that you can enter data sources here that are either declared globally (preferably threaded), or locally in the RightReportsPrint AND RightReportsUpdate procedures. The data sources need to be available to both of these procedures for the following reason: The Update procedure needs it in order to make it available to the user at run time. It needs the actual structure in order to add it to the list of data sources available to the user for report creation, to provide a list of fields, etc. There does not need to be data in the data source at this point. The print procedure, however, needs both the data structure as well as the data in order to print out the report.

We've placed this Tab on the global extension to prevent the need for you to enter this information twice (once for the update procedure, and once for the print procedure). Unfortunately this means that you have to type out the names of your data sources by hand, as global extensions do not allow you open the Fields Dialogue.

The Relationships Tab

global relationships tab

Once you have entered your Queue and View data sources on the Data Sources Tab above, you can specify relationships for them on this here Relationships Tab. Since File relationships are determined by your dictionary structure, the idea is that you use this space to specify relationships between queues, or relationships between a queue and a file.

add relationship tab

You need to specify the data source and its relating source, the type of relationship, and also the orders (think of these as keys) used to establish the relationship. Once the latter has been filled in, you also need to specify how the fields of the specified keys are primed for this relationship, in the two Linking Fields boxes.

Note: If the list of files does not have anything in it, go out of the Global Extension, Generate All and go back in.

The Custom Functions Tab

On this tab, you can add functions and variables defined in your application that you want to make available to users at run time (these will become available to them on the Functions Tab of the Editor). Users editing reports will be able to make use of these functions to calculate values, etc. to be included in the report.

add custom function tab

You need to make sure you have created the function in your application before adding it to this list. Also, it needs to be accessible by the RightReportsPrint procedure. So it should either be declared as global, or added to the procedures for RightReportsPrint.

The Files Tab

global files tab

On this tab you can override the fields you included or excluded from the Files List in your dictionary. This is useful for if you have more than one Report Editor in your application and you want to switch some of your tables on and off at DLL level rather than for the entire application.
The Options Tab

global advanced tab

The RightReports Files Tabs

You will notice that there are a number of other tabs on the Global Extension, such as Report, Band File, Controls File and Fields File. For the most, you will not need the tabs. If you, however, decide to rename some of the Imported RightReports Files or their fields, then you would possibly have to come to this tab to make sure all the table names, and their related field names, are still filled in correctly on this tab.

Report Tab

Band Files Tab

Controls File Tab

Tree Defn files Tab

Calcs file Tab

Totals File Tab

Secondary Files tab

Totals file tab

The Local Extension

The General Tab

local general tab

The RightReports_Editor Control Template

The General Tab

local hotkeys tab

The Hot Keys Tab

local hotkeys tab

On this tab you can specify hot keys for editing and moving controls in the Graphic Band Editor. The prompts are rather self-explanatory.

The Advanced Tab

local advanced tab

The RightReportsPrintControls Control template

local advanced tab



On this tab you can enter user variables that link to a lookup procedure to aid the user in entering user values (used in the report - see the Property Editor). On the User Variables with Lookup: local advanced tab

Use this list to override the view creation for these tables selected. You will need to handcode the views yourself.

Using The Report Editor

For a thorough overview on using the ReportEditor, take a look at the training video: http://www.clarionlivemedia.com/webinars/ClarionLive136_20111125_RobdeJagerOnRightReports.wmv

The Browse Window

The RightReportsBrowse procedure lets you browse the current reports in your program.

browse report layouts

It shows the date and time at which the report was last modified as well as the description. If you click the Add or Change button, you can edit this graphic report at runtime. The update procedure is called RightReportsUpdate.

The Update Form

the update form

The RightReportsUpdate procedure allows you to create and edit graphic reports with ease. There are three sections to this window:

The Report Structure List

This list allows you to specify a Primary Source, and add graphic report details, lookups, Secondary Source loops, calculations, headers and footers to your report. A short description for each of these is given below.

Note that you can move each item up or down depending on where on the report it should happen. You can also move each item left or right. If an item A is to the above and left of item B, it means that that item A is a parent of item B.

The Graphic Band Editor

Any detail, header or footer created using the Report Structure List above appears in this editor. Check out the cool editing functionality available to you: A note on Strings: Putting angular brackets around a word indicates to the report printing engine that this is possibly a local or global variable (see the Property Editor below), or a field in one of your report tables. See the Printing Variable and Field Values section for more details.

The Property Editor

This feature allows you to edit various properties belonging to the currently selected item in the Report Structure List. If a control is selected in the Graphic Band Editor, it allows you to edit the properties for that control. The property editor has several tabs:

The Print Window

When you have finished editing the report, you can press OK to save it and then click Print on the Browse Reports window. This brings up the Report Options window (the procedure is called RightReportsPrint):

the print window

Here you can select where you want to print the file to, choose your printer, etc. Any local or global report variables which were declared of type User will appear on this window, allowing the user to specify their values.

You will also notice a Primary Sort dropdown appearing in some cases. This happens when for the Primary Source of that report, the user specified User Selects for the sort order. If the keys for the file have non-empty descriptions, the descriptions appear in this dropdown. Otherwise the key name appears.

Clicking start sends the printing on its way. See the section on The Report Output for more on the output options.

Properties on the Properties Tab

The Properties Tab on the Property Editor allows you to edit any of the properties relating to the currently selected item in the Report Structure List in edit-in-place type fashion. If a control on a band is selected, its properties will appear in the Property Editor for editing. Below we list the properties for each different type of item along with descriptions for each.

A Note on Parent Files

Recall we mentioned that if an item A is left of any item B above it in the Report Structure List, it means that that item B is a parent of item A. The idea of a parent file works more or less the same. The parent file of an item is assumed to be the main file of the closest Secondary Loop or Primary Source item above it. It is also possible to override the parent file of a given Secondary Loop or Lookup by changing the Parent File entry on the Properties Tab.

Primary Sources

This item contains properties relating to the Primary Source of the report, as well as other general

Secondary Loops

Lookups


CUS:CField1 = INV:IField1

or

CUS:CField1 = INV:IField1 and CUS:CField2 = INV:IField2

or

CUS:CField1 = INV:IField1 and CUS:CField2 = INV:IField2 and CUS:CField3 = INV:IField3

You also need to make sure that there is a key in the Lookup file that contains each of the lookup fields used in the expression. Otherwise, the lookup will not work.

Calculations

Details, Headers, Footers and Forms

Controls

Advanced Report-Editing Things

Blocks in a Report

A classical example of a Block in a report would be the following:

Suppose you had a secondary loop through Purchased Items for a report on Invoices. For each invoice, you want to print a header, the Purchased Items relating to that Invoice, and then the invoice footer. Naturally, if there are no Purchased Items relating to an Invoice, because they for example have been filtered out, you wouldn't want that entire invoice to print. To achieve this, you would make the invoice header the Block Start and Suppress it, and the invoice footer the Block End and Suppress that too. The actual band with the Purchased Item info on it, however, should be left alone.

The effect that this will have is the following: If there is at least one record in the secondary loop that does not get filtered out and its associating detail prints, all the details within the block will print. However, if there are no valid records and hence no details for Purchased Items print, none of the other details (i.e. the invoice header and footer) will print either.

In your Report Structure List, this scenario would look something like the following:

block example

The stars represents bands with "Suppress if Block Empty" switched on, the closing angular bracket indicates a block start, and the opening angular bracket indicates a block end.

Functions and Variables in the Report

As was mentioned above in the section on the Property Editor, you can add variables to your report using the Global and Local tabs. Placing the name of this variable in angular brackets in a string on the report then causes the value of the variable to print out when the report is printed.

Note that there are three types of variables:
If you want functions to be available to the user at runtime, you need to take the following steps:
There are already a number of built-in functions that ship with RightReports. Since they are already loaded they're descriptions can be viewed as usual on the Functions Tab.

Tip: Say you have created your own clip function, called MyClip, and want this function to be called whenever the user calls clip. You will notice that Clip has already been bound by RightReports (to the usual Clarion Clip function). You need to make sure you unbind clip before binding it. So your code in the RightReportsBind embed point would be

UnBind (clip)
Bind(clip , MyClip)

Another Tip: Your custom function needs to take only string parameters, and it can only return strings, too. This is a limitation brought about by the Clarion Bind() procedure.

Built in Functions

FunctionName Description Example
ABS Returns the absolute value of a variable's contents abs(<MyVariable>)
INT Returns the integer value of a decimal int(<MyDecimal>)
CHANGED Returns if a variable has changed (1) or not (0).
NOTE: You must use quotes for the variable name to be checked and the variable cannot be a run-time variable, it must be a compiled variable (like a field in a file).
changed('MyVariable')
HEADER Returns if a variable has changed (1) or not (0) (first instance is returned as a change).
NOTE: You must use quotes for the variable name to be checked and the variable cannot be a run-time variable, it must be a compiled variable (like a field in a file).
header('MyVariable')
CHR Returns the ASCII string character of the ASCII value passed (valid numbers are 0 -255) chr(<MyNumber>)
CLIP Returns a clipped variable (i.e. removes the trailing spaces in a string) clip(<MyVariable>)
CLOCK Returns the current time (in clarion time - i.e. hseconds after midnight) clock()
TODAY Returns the current date in clarion date (i.e. number of days after 1 Jan 1800 + 3) today()
ALL Returns a string of repeated characters, where the first parameter is the character, and the
next is the number of repeats.
all(<MyCharvar>,<NoOfChars>)
RIGHT Right justifies a string right(<MyVariable>)
CENTRE/CENTER Centre justifies a string centre(<MyVariable>)
DAY Return the day of month from a date day(<MyDateVar>)
MONTH Returns the month from a date month(<MyDateVar>)
YEAR Returns the year portion of a date. year(<MyDateVar>)
LEFT Left justifies a string. left(<MyVariable>)
DOW Returns the day of week (0 for Sunday through 6 for Saturday) dow(<MyDateVar>)
DATE Returns a clarion date from a passed month, day and year date(<MyMonthVar>,<MyDayVar>,
<MyYearVar>)
BEGINSWITH Returns 1 if a string begins with a set of characters beginswith(<MyStringVar>,<MyCharsVar>)
CONTAINS Returns 1 if a string contains a set of characters contains(<MyStringVar>,<MyCharsVar>)
ENDSWITH Returns 1 if a string ends with a set of characters endswith(<MyStringVar>,<MyCharsVar>)
You can add your own custom functions to be used in reports. You must create the function, and then add it to the list in the rightreports global template's list of functions. It will then be available for report editing, and when printing a report. (see GloCustomFunctionsTab)

Printing Variable and Field Values

Putting angular brackets around a word indicates to the report printing engine that this is possibly a local or global variable (see the Property Editor), or a field in one of your report tables. When printing the report, RightReports will replace that part of the string with the current value of the variable, or with the value in the field of the current record in the table.

You can find all the local and global variables available to this report on the Local and Global tabs of the Property Editor. All the fields of the tables used in your report can be seen on the Fields Tab of the Property Editor. If your report is a Graphic report, you can drag and drop these fields onto any report band in the Graphic Band Editor above the field list.

Built-In Keywords

There are some built-in keywords such that if they are encountered in a string in angle brackets, RightReports will perform a certain action. The are essentially variables and are treated in exactly the same way. The following are examples:

Renaming Table Fields

Suppose one of your table fields has a name that obscures its meaning, such as INV:rn, which stands for the invoice number. It is possible for users to see and use an alternative name in the report editor, which may, for example, be more descriptive and hence easier to work with, such as INV:InvoiceNumber. To do this, take the following steps:

Report and Table Access Issues

Excluding Tables and Fields from the Files List

There will quite possibly be some tables in your dictionary that you want to hide from the users on the Fields Tab of the Report Editor. The way to do this is as follows: Once you have suppressed a table in your dictionary in this way, you can unsuppressed it by going to the Files Tab on the Global Extension. You will see that it is also possible to suppress files that have not been suppressed in the dictionary here.

In order to suppress specific fields of a given table in your dictionary, the process is the same as the above. You can just follow the five steps mentioned above to add the NoReports user option to the table field in your dictionary. NOTE: Overed fields are automatically suppressed.

Preventing Users from Editing a Report

It is possible to prevent users from editing a report by setting the EditAccess property in the RRDefinition file to a value greater than 0. If this is the case for a report, the Update window will open in view-only mode. The way the value of RRDFN:EditAccess is determined is left up to the programmer, and it is, for obvious reasons, not included in the Properties List for the report on the editor.

Preventing Access to Table Records

It is also possible to prevent a user from accessing certain records in the report tables when printing the report. In fact, it is possible to filter out any records of any table that the report loops through. To do this, you need to take the following steps: The code you are embedding into looks like this:

 loop
   CallResult = self.NextRecord()
   !Embed code here to filter out records
   if CallResult
     ReturnValue = CallResult
     break
   end
   if 0
   elsif self.CurrentDataSource.Name = 'MyFile'
      !Your embed point is here
      if fil:FieldName < 0 then cycle.
   elsif self.CurrentDataSource.Name = 'MyFile2'
   end
   ReturnValue = 0
   break
 end


So basically this allows you to loop until you find an unfiltered record. You can even set the ReturnValue to a non-zero value to stop the processing of the current file completely.

The Report Output

The Report Previewer

As can be seen on the Global General Tab, it is possible to choose a previewer for your generated reports besides the default RightReports or ABC ones. The way to go about using such a 3rdparty previewer depends on the product, but the general idea is as follows: global general tab

At the moment RightReports supports the IceTips, CPCS, ABC and RightReports-built-in report previewers. It is also possible to hand code your own call to a previewer (like RPM), should you wish to choose that option.

The RightReportsPrint Procedure

RightReportsPrint is the procedure responsible for printing the report created by the report editor. It also provides an interface for the user to setup some options that the report requires (like user variables used for filtering records). The RightReportsPrint procedure is imported as a window procedure with a Control template added to populate the necessary code. There are a number of options for the template, discussed in the RightReportsPrintControls template section of this doc.

For example, you want to use your own Report Previewer. In this case, you could hand-code the call to the previewer yourself. Choose the Hand code option on the General Tab of the Global Extension, and follow the instructions laid out on the Hand coded Previewer tab that appears. Alternatively, you can do a search in the RightReportsPrint procedure for RightReportsPreview. You can replace this function call with your own.

Entering User variables

The user variables created for a report (in the local or global tabs) - will be displayed here at runtime, allowing the user to enter values for these user variables.

Printing to a PDF File

As you saw on the RightReportsPrint Window, you can choose to output your report to a number of formats. One possibility is to output to PDF. To enable this, you need to take the following steps:

Printing to Word and Excel

As was mentioned before, it is possible to output to a number of different formats. Among these is the possibility to send the report output to a Microsoft Office Excel or Word file. Note that you need CapeSoft Office Inside version 2.63 or later. To enable this feature you need to take the following steps:
If you would like the user to preview the output document automatically, then you need to add the HyperActive global extension template to your application as well.

Importing and Exporting Reports

Importing and Exporting a RightReports Report

It is possible for you to export a Report from RightReports into an XML format, and to import such a report again too. The idea here is to make reports portable. For example, this feature enables you to export a report, send the resulting XML file to a client, and he or she can then import the report into their system with minimal fuss. In addition, by exporting a report, you ensure that you have a saved copy in case you need to revert back to it for whatever reason. Re-importing an exported report also mimics the copy-paste action.

Note that this feature requires require XFiless1.61 or later1.61 or later. To enable this feature, you need to take the following steps: import export

There is one option allowing to to control which reports may be imported into your program. If an exported report does not have this identifier, importing it will fail. The idea is that programs with different dictionaries will clearly not be able to support the same reports. Hence, using the dictionary name here seems like a good idea.

Importing Reports from a TXR File

RightReports can import reports that were created using Clarion's Report Writer with ease. To enable this feature, you need to take the following steps: This procedure merely opens a window asking the user to specify the relevant TXR file before importing all the reports in that TXR into the RightReports report database. These reports then become available in the RightReportsBrowse, and can be edited and printed as usual RightReports reports from this point on.

Advanced: Embed Points

Embed Points for the Enthusiastic Coder

The RightReportsPrint class generates a number of procedures into the RightReportsPrint procedure where you can embed some of your own code.

Method Name When Called Examples of Uses
AddCustomFunctions In general code will be generated into this procedure by the template. See the Section on Functions and Variables.. You can embed code here if you want to add some custom functions to make available to the user.
AfterInitalise This method is called after all the initialization for printing is complete. Place any of your own initialization code here.
AfterPrinting This method is called once all the printing is done and the preview has been displayed.
AfterWaitWindowOpen Embed any code in here you would like to execute after the Progress Window has opened. For example, if you want to make changes to the window to suit your applications, e.g. adding Makeover, now would be the time.
BeforeAssigningSource Before the records of a data source are processed, certain actions may need to be performed on that data source. Embed code to do that here. This method is called after the source was opened, but before a set (with a key) has been done on it. A queue that may be of interest here is the SavQ. This would be a good time to save the state of your data source should you want to do this. Your embed code would look like this:

if lower(self.SavQ.savFileName) = 'employee'
  self.SavQ.savState = Access:Employee.SaveFile()
end
NextRecordFound This gets called every time a new record to process has been successfully fetched. These record have survived testing against all the filters, including the primary and secondary report filters. This is your last opportunity to filter this record out, and you can do this by setting the return value to 1.
BeforePoppingSource This gets called just before the data source currently being processed gets popped off the SavQ stack.
BeforePrintFileStart This is called after the print button is pressed but before the actual processing of the data sources starts. This method is called before the data sources for this report are opened, but after the output type (as chosen by the user on the window) has been determined.
BeforeOutputCase After the print button is pressed, RightReports determines which printing option is called. This procedure is called before this case statement.
BeforeViewOpen As the name suggests, this method is called before a data source that is a view is opened. If the user has chosen a key for the primary file of the view, it is passed as a parameter. The parent call then sets the primary file with this key - you do not have to do this yourself (provided the user chose a key in the editor).

Remember that in the print procedure, all Files are handled as Views - see the section on Files and Views in the Print Procedure.
You can place any of your own code to prepare the view or the primary file of the view here.
CallNextRecord RightReports uses this procedure to call the NextRecord procedure, which fetches the next record in the current data source. If NextRecord returns a value > 0, it means the fetch failed, and contains the error code. 1 means that some internal error occurred while trying to access the data source in RightReports. In either case it will be assumed that the end of the data source was reached.

NNote that, unlike in the case of NextRecordFound, the report filter has not yet been applied to this record (although all server-side and SQL filters have).
If the fetch is successful, you can use this procedure to filter out any unwanted records. An if statement is generated with embed points for each of your data sources. You can check any fields in your data source and cycle should you want this record to be skipped.
Initalise This procedure is called to do some routine initialization tasks when the print window is opened. Place any of your own initialization code here. Placing code after the parent call is the same as placing code in the AfterInitalise procedure.
InNextLoop After CallNextRecord has returned its value to the Print procedure, the return value is evaluated. If the return value is 0, this record will continue to be processed. InNextLoop is called before any processing on the record continues.

Note that, unlike in the case of NextRecordFound, the report filter has not yet been applied to this record (although all server-side and SQL filters have).

PostShowPriSortQueue This method is called after the Primary Sort Queue is displayed. The latter will only appear if the user has chosen 'User Selects' for the Primary Sort. Embed code here if you want to move some controls around on the Print Window.
PostInitalise This method is called during (towards the end of) the Initialize method. It is called before AfterInitalise. Mostly for internal use. Code to prime the user variable prompts and load the classification queue is generated into this method.
PreInitalise This is called before the Initialize method is called. Embedding code here has the same effect as embedding code before the parent call in Initialize.
PrimeUserPromptsAuto When the Print Window is opened, the prompts for the user report variables are populated. If the second character of a report variable's picture is 'G', this procedure is called. No user prompts or entries for such a variable will appear on the print window. You may have placed a prompt and entry of your own on the window. If this is the case, now is the time to populate the prompt and entry with your desired values.

Only for very advanced programming.
RRBind This procedure binds the functions listed on the Global Functions Tab - code is generated to do this. If for some reason you want to bind some of your own functions, or even application variables (see the FAQ item on this topic) for use in reports, you may do this here. Don't forget to unbind them using RRUnbind below.
RRUnbind This procedure unbinds the functions listed on the Global Functions Tab - code is generated to do this. Unbind whatever you bound yourself using RRBind above.
SaveCRISCHUserPrompts Internal use.
SetClassification Used for classification purposes, not yet implemented.
ShowPriSortQueue This method contains generated code that handles the display settings for the Primary Sort Queue on the print window. This dropdown only appears if the user has chosen 'User Selects' for the Primary Sort. Embed code here should you wish to make any changes to the contents of the PriSortQ or the way it is displayed.

Class Properties of Interest

Field Name Type Description
savQ Queue This queue is a member of the RightReportsPrint class, responsible for printing the report. It acts as a stack onto which and from which the data sources of your report are pushed and popped. Thus, the primary source will be the first record, and the data source currently being read is at position records(self.SavQ).. When all the records in the relationship have been processed, the data source is popped off. When the next record in the parent file is read, this data source will be pushed back onto the stack and all the related records read. This stack directly resembles the Report Structure Tree you see in the editor, except that it only contains the data sources before the current one, not the ones after.
savFileName string(20) Name of the data source.
savLevel short Level at which this data source is. Level 0 is a primary file, a secondary loop would be at level 1, a secondary loop with the latter as parent will be at level 2, etc.
savofq long Internal use.
savFilter string(1024) The report filter you entered for this data source (see Primary or Secondary filter)
savHostName string(25) The name of the parent data source.
savRange string(1024) Internal use.
savState ushort The Save State of this data source. You can set this by embedding code in BeforeAssigningSource.
SavServerFilter string(1024) The server-side filter for this data source. Only for files and views.
SavServerOrder string(1024) The server-side order fields for this data source. Only for files and views.
SavSQLFilter string(1024) The SQL filter for this data source. Only for files and views.
SavSQLOrder string(1024) The SQL order fields for this data source. Only for files and views.

end

Files and Views in the Print Procedures

It may be of interest to note that for the editor, a data source of type file remains a file. However, in the Print Procedure, a view is declared with the file as primary file, and this view is used to print the report. This is to allow the user to specify a server-side filter and order fields for the file, without having to create a new key.

If your file's name is MyFile, the view will be called RRDFView:MyFile. However, the name of the data source will still be the same as that of the original file, namely MyFile. Hence, for example, should you need to access the data source in the SavQ stack, you will still need to use MyFile as the data source name.

It is also important to note that all files will be treated as views in the Print Procedure. For example, BeforeViewOpen will be called for every View AND File.

Tips & FAQ

Question Summary

I'm getting Compile Errors or Runtime Errors

Importing Issues (Procedure and TXD issues) Programming Issues Writing Reports

Getting Started: Check out ClarionLive webinar 136 Printing Reports Runtime Errors Compile Errors

Importing Issues (Procedure and TXD issues)

Programming Issues

Old Global Embed Point(s) New Location(s)
AddCustomFunctions Can be found in the local AddCustomFunctions procedure in both the Print and the Update procedures. Fortunately, you no longer need to hand-code these additions - you can add them on the Global Custom Functions Tab. This also removes the need to do it twice.
RightReportsNextSavFile Can be found in the local CallNextRecord procedure in the Print procedure.
RightReportsBuildLookupList Can be found in the local BuildLookupList procedures in both the Print and Update procedures.
RightReportsBuildOrderList Can be found in the local BuildOrderList procedures in both the Print and Update procedures.
RightReportsBuildSecondaryList Can be found in the local BuildSecondaryList procedures in both the Print and Update procedures.
RightReportsSetRangePrompts Can be found in the local SetRangePrompts procedures in both the Print and Update procedures.
RightReportsSetFilePosProc Can be found in the local SetSecondary procedures in the Print procedure.
RightReportsBind Can be found in the local RRBind procedure in the Print procedure.
RightReportsUnbind Can be found in the local RRUnbind procedure in the Print procedure.
RRDFN:DefnCode = 3
Access:RRDefinition.Fetch(RRDFN:CodeKey)
RightReportsPrint(0)

Writing Reports

Printing Reports

Runtime Errors

Compile Errors

Check out general product CompilerErrors.

License & Copyright

This template is copyright 2007-2024 by CapeSoft Software. None of the included files may be distributed. Your programs which use RightReports can be distributed without any RightReports royalties.

Each developer needs his own license to use RightReports (need to buy more licenses?).

This product is provided as-is. CapeSoft Software and CapeSoft Electronics (collectively trading as CapeSoft), their employees and dealers explicitly accept no liability for any loss or damages which may occur from using this package. Use of this package constitutes agreement with this license. This package is used entirely at your own risk.

Use of this product implies your acceptance of this, along with the recognition of the copyright stated above. In no way will CapeSoft , their employees or affiliates be liable in any way for any damages or business losses you may incur as a direct or indirect result of using this product.

For the full EULA see https://capesoft.com/eula.html

Support

CapeSoft Support
Email
Telephone 087 828 0123
+27 87 828 0123


 Version History

Download latest version here.

You should be using at least version 4.35 of Draw.
Download the latest Draw here.

Version 2.09 - 5 February 2024 Version 2.08 - 20 October 2022 Version 2.07 - 11 February 2022 Version 2.06 - 25 May 2021 Version 2.05 - 3 November 2020 Version 2.04 - 8 September 2020 Version 2.03 - 12 August 2020 Version 2.02 - 12 March 2020 Version 2.01 - 18 December 2019 Version 2.00 - 25 March 2019 Version 1.99 - 18 February 2019

 

Version 1.98 - 16 February 2017 Version 1.97 GOLD 25 February 2015 Version 1.96 GOLD 11 July 2014
Version 1.95 GOLD 14 May 2014


NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier.

    Embed points standardized (was generating in different orders each time). This may mean that your embed code in the RightReportsUpdate code (in the derived methods) has changed. So for example, you may have had some code in the local procedure:

this now needs to be moved to the correct position.



The way to determine the correct position, is to save a copy of your generated clw file, and then compare the generated file to the saved copy and move the embeds until the code is generated in the correct order as it was before.

Fix for evaluating a numeric calculation (when assigning a runtime field calculated variable's value - where the value is a formula containing other runtime variables).

Version 1.94 GOLD 31 March 2014

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier.
Version 1.93 GOLD 10 February 2014
Version 1.92 GOLD 29 October 2013
Version 1.91 GOLD ...

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier.
Version 1.90 GOLD ... 8 August 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.89 GOLD ... 3 July 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.88 GOLD ... 2 May 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.87 GOLD ... 6 March 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.86 GOLD ... 5 March 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.85 GOLD ... 7 February 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.84 GOLD ... 6 February 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.83 GOLD ... 4 January 2013

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.82 GOLD ... 4 December 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.81 GOLD ... 27 November 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.80 GOLD ... 8 October 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.79 GOLD ... 17 August 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.78 GOLD ... 14 February 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.77 GOLD ... 11 January 2012

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.76 GOLD ... 30 November 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.75 GOLD ... 22 November 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.74 GOLD ... 18 November 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.73 GOLD ... 25 October 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.72 GOLD ... 16 September 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. Version 1.71 beta ... 9 September 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on some fixes when using Global variables in the report designer. Version 1.70 beta ... 13 July 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on some fixes when using Global variables in the report designer. Version 1.69 beta ... 20 June 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on some fixes when using Global variables in the report designer. Version 1.68 beta ... 9 June 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on some fixes to the Editor. Useful for the report designer, but no impact on the end user (for printing). Version 1.67 beta ... 7 June 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on some fixes to the Editor. Useful for the report designer, but no impact on the end user (for printing). Version 1.66 beta ... 3 June 2011

NOTE: See note from 1.65 if you are upgrading from 1.64 or earlier. This release focuses on optimization (thanks to our trusty Profiler) - running reports, and loading the printreport option page. Also some general cleanup. EIP template is moved to a class. Version 1.65 beta ... 23 May 2011

NOTE: You must delete the 4 instances of the Edit InPlace extension template on the RightReportsUpdate window. EIP is now handled in the class (not the additional template). This release focuses on optimization (thanks to our trusty Profiler) - running reports, and loading the printreport option page. Also some general cleanup. EIP template is moved to a class. Version 1.64 beta ... 25 February 2011 Version 1.63 beta ... 8 September 2010 Version 1.62 beta ... 17 August 2010 Version 1.61 beta ... 26 May 2010 Version 1.60 beta ... 12 May 2010 See Note for 1.59. This version just contains a workaround for the template in clarion 7.1.

Version 1.59 beta ... 11 May 2010
Note: NO TXA import required if upgrading from 1.53 (although re-import of the previewer is recommended for additional report output file type support - see Add outputs to the Previewer window).
Note: You can create a lookup for a user variable on the PrintOptions window to enable the user to select a value for the user variable from a selection. See The_RightReportsPrintControls_Control_template for details. General changes: Template Changes: Class changes: Version 1.58 beta ... 21 April 2010 Note: NO TXA import required if upgrading from 1.53 Template changes: Class changes: Version 1.57 beta ... 31 March 2010 Note: NO TXA import required if upgrading from 1.53 Template changes: Class changes: Version 1.56 beta ... 29 March 2010 Note: NO TXA import required if upgrading from 1.53 Template changes: Class changes: Version 1.55 beta ... 4 March 2010 Note: NO TXA import required if upgrading from 1.53 Template changes: Class changes: Version 1.54 beta ... 26 February 2010 Note: NO TXA import required if upgrading from 1.53 Template changes: Class changes: Version 1.53 beta ... 9 December 2009 (NB: TXA import required)

Note: 1.53a includes the assert to warn of a xFiles upgrade requirement.

Note: You must re-import the TXAs. Unfortunately due to a Clarion bug, there's no way to avoid a compile error now that the templates need to start using the use variables for previously imported windows' populated controls. The new TXAs force a valid use variable in the controls that allow you (well RightReports actually) to use those use variables in code.

Summary: Lots of little changes - but moved code from template to class, removed tna code, added description feature (for table select). Also fixed the date user lookup regression (from 1.52). Fix report import and import: Was not consistently importing reports correctly (Requires xFiles 2.00). Template changes: Class Changes: Version 1.52 beta ... 22 October 2009 No TXA import is necessary if you are upgrading from 1.50. This release is primarily to integrate the version of RightReports used in TNA with the current version. Template changes: RightReports class changes: Version 1.51 beta ... 13 October 2009

No TXA import is necessary if you are upgrading from 1.50 Version 1.50 beta ... 9 October 2009

A re-import of the RightReports txas is recommended for this release (should be the last one. Version 1.29 beta ... 6 October 2009

A re-import of the RightReports txas is recommended for this release. Version 1.28 beta ... 5 October 2009

NB - see release notes for 1.27 Version 1.27 beta ... 5 October 2009

A re-import of the RightReports windows is recommended in this release.
This release requires Draw version 2.79 or higher. Version 1.26 beta ... 25 May 2009 Version 1.24 beta ... 17 April 2009 Version 1.23 beta ... 8 January 2009 Summary: Fixed - printing blank reports when file previously opened. Version 1.22 beta ... 23 December 2008 Summary: Fixed non-dispose of Draw object. Requires Draw 2.74 (so kill isn't called if init isn't called). Added translation ability (of messages). Version 1.21 beta ... 2 December 2008 Summary: Regression in 1.20 - causing GPF when deleting a report. Version 1.20 beta ... 1 December 2008 Summary: Solve memory leak (causing Editor to fail to draw controls), Resizing issue in the editor (cursor not tracking the resize bar correctly). RightReportsPreviewer has PgUp, PgDown, End, Home keys associated with the relevant buttons in the TXAs. Version 1.19 beta ... 19 November 2008 Version 1.18 beta ... 12 November 2008 Version 1.17 beta ... 10 November 2008 Version 1.16 beta - 27 October 2008 Version 1.15 beta - 22 October 2008 RRDefinition:               ServerFilter     string (1024)
                                 ServerOrder    string (1024)

RRDefnSecond:           ServerFilter      string (1024)
                                 ServerOrder     string(1024)

RRDefnFields:            NoEdit              long

See the FAQ on making RR table changes for tips on how the implement these changes. Also, if you are using FM2 or FM3, don't forget to increase your table version numbers. Version 1.14 beta - 5 September 2008 Version 1.13 beta - 22 August 2008 Version 1.12 beta - 19 August 2008 Version 1.11 beta - 19 August 2008 Version 1.10 beta - 15 August 2008 Version 1.09 beta - 15 August 2008 Version 1.08 beta - 24 April 2008 Version 1.07 beta - 16 April 2008 Version 1.06 beta - 29 February 2008 In the latter case you will also need to import RightReportsPrint.TXA to incorporate these changes into the hand-coded RightReportsPrint procedure. Version 1.05 beta - 15 February 2008 Version 1.04 beta - 24 January 2008 Version 1.03 beta - 30 November 2007 Version 1.02 beta - 16 November 2007 Version 1.01 beta - 12 November 2007 Version 1.00 beta - 17 September 2007 Version 0.07 alpha - 27 August 2007 Version 0.06 alpha - 20 July 2007 Version 0.05 alpha - 11 July 2007 Version 0.04 alpha - 10 July 2007 Version 0.01 alpha - 1 May 2007