Note: this is an advanced topic designed for programmers.
Reporting4Act! knows all about your Act! database because it has a data dictionary. A data dictionary defines the fields and tables in a database, providing features such as descriptive names so you don't have to know the real names, how tables are connected, or joined, together, and calculated values such as extended price that aren't normally stored in the database.
However, you may need to customize the Reporting4Act! data dictionary to report on other databases you have linked to your Act! database. There are two ways you can do this: with scripting or using the Stonefield Query Software Development Kit (SDK).
Scripting
You can use a "script" file to programmatically customize Reporting4Act!. After Reporting4Act! sets up its data environment (which it does only one time after a particular database has been chosen), it looks for a file named SETUP.SQS and executes the code in that file if it exists.
To create a script file, create a text file called SETUP.SQS, either in the directory where Reporting4Act!'s data files are stored or in the Reporting4Act! program directory. Edit this file using any text editor (not a word processor, such as Microsoft Word, which stores binary files, but an editor such as Notepad that stores text files).
Although script code can be used for anything, the most common use is to change information in the Reporting4Act! data dictionary.
Here's an example that makes the Contact ID field in the Contact table non-reportable, so it will no longer appear in the list of fields you can select.
Field = SQApplication.DataEngine.Fields.Item('CONTACT.CONTACTID')
store .F. to Field.Reportable
In previous versions of Reporting4Act!, scripting was used to create your own calculated fields. However, that's no longer necessary because you can use the Formula Editor to do that.
Here are the properties of field objects:
Name | Data Type | Description |
---|---|---|
AllowValues | Boolean | True if the Values button in Reporting4Act! is enabled for this field. |
Calculated | Boolean | True if this is a calculated field. If the SQExpression property of a calculated field is False, set this property to False as well. |
Caption | Character | The caption for the field. |
Comment | Character | The comment for the field. |
Decimals | Numeric | The number of places after the decimal. |
Expression | Character | The expression to determine the value of this field if it's a calculated field. |
FieldList | Character | A comma-delimited list of aliased field names used to calculate the value of this field if it's a calculated field. Leave this property blank if SQExpression is False. |
FieldName | Character | The aliased name of the field. You don't have to fill in this property because that's done automatically when you add the field to the collection. |
Filterable | Boolean | True if the user can filter on this field. |
Format | Character | This indicates how the value of the field is formatted. Enter one of the following characters:
|
Heading | Character | The default column heading for this field in a report. |
Length | Numeric | The width of the field. |
OutputLength | Numeric | The output width of the field. You don't have to fill in this property unless it's different than Length. |
OutputType | Character | The output data type of the field; see "Type" below for a list of valid data types. You don't have to fill in this property unless it's different than Type. Note setting this doesn't mean Reporting4Act! converts the values in the data to the specified type; you are simply informing Reporting4Act! what the data type of Expression is. |
Picture | Character | This property indicates how each character in the field's value is displayed. For each position in the value, enter one of the following characters:
For example, "9,999,999.99" indicates that values are formatted with thousands separators (such as commas) up to seven places before the decimal and have two decimal places. |
Reportable | Boolean | True if the user can report on this field. |
Roles | Character | A comma-delimited list of roles that can access the field (blank means everyone can access it). |
Sortable | Boolean | True if the user can sort on this field. |
SQExpression | Boolean | True if this calculated field uses a Reporting4Act! expression; False if the expression is sent as is to the database engine. |
Type | Character | A single character representing the data type of the field:
|
Stonefield Query SDK
It's much easier to customize the Reporting4Act! data dictionary using the Stonefield Query SDK than it is via scripting. For one thing, you don't have to know how to write code. Also, if a lot of customization is required (for example, there are several new tables with many fields in each one), you'd have to write a lot of code if you used a script. Also, if the structures of the tables change, you'd have to change the code.
The Stonefield Query SDK provides Stonefield Query Studio, the same tool Stonefield Software used to create the Reporting4Act! data dictionary in the first place. Using this tool, you can easily add new tables or fields to the data dictionary, customize existing fields any way you need, and define new calculated fields. For more information about the Stonefield Query SDK, please visit www.stonefieldquery.com. For information on how to use Stonefield Query Studio, please see the Stonefield Query SDK documentation.
The Reporting4Act! data dictionary is in a table called REPMETA.DBF. When you add tables or fields using the Stonefield Query SDK, you'll be adding them to a different table. The reason for a separate data dictionary table is to protect your changes when a new version of Reporting4Act! is released. Since that new version's REPMETA table would overwrite yours, your customization would be lost. So, using a different table for your custom changes means that your work won't be lost when you install a new version.
By default, the name of the custom table is CUSTOMMETA.DBF. However, if you want to change that name, edit SFQuery.INI in the Reporting4Act! program directory and change the name specified in the "file2" line in the [Meta Data] section. If you wish to create your own custom scripts, add a new line with "file2" as the key in the Scripting section. Here's an example:
[Meta Data]
file1=qwmeta.dbf
file2=repmeta.dbf
file3=custommeta.dbf
[Scripting]
file1=qwscript.dbf;BuiltIn
file2=sfscript.dbf;BuiltIn
file3=customscript.dbf
Don't change any of the other lines in SFQuery.INI or Reporting4Act! may not work properly!
If you are working with Stonefield Query Studio in one folder but using Reporting4Act! in a different folder (for example, you are customizing the data dictionary for someone else, such as a client), you will need to copy SFQuery.INI and your custom table (for example, CustomMeta.DBF, CustomMeta.CDX, and CustomMeta.FPT) to the Reporting4Act! program folder. Also, if you created any custom scripts, copy the custom script table (CustomScript.DBF, CustomScript.CDX, and CustomScript.FPT) as well.
Note: There are no Configuration and Scripts panels in Studio because the Reporting4Act! configuration information is built-in and can't be changed.
© Keystroke.ca, 2024 • Updated: 01/18/22
Comment or report problem with topic