RpReports Customization

RpReports Customization explains how to create a new project for RpReports .

Customization is performed by modifying four external database files:

  1. Project settings - such as the name of the project and client settings.
  2. Attribute Definitions - define sach attribute, type, whether the user can modify it, and whether it appears on the reports.
  3. Attribute Level Files - define which attributes are visible at each Porject level.
  4. Default Attributes - assign the initial attributes for each component based on component name.

Note:In this article PROJECT refers to the code name of your project. It should not contain any spaces, dots or other special characters (underscore or dash are OK). (e.g. Acme_Furniture). The actual project name, defined in the PROJECT_settings.csv file can contain spaces.

Contents

How to proceed

  1. Read through this article to understand the customization files.
  2. Modify and load the RpReports_Demo project stored in the RpReports_Demo folder of the location where you installed RpReports.
  3. Proceed to Setting up a project (below) to create and test your own project.

Beta testers: Be prepared for things to go wrong. Let us know what problems you are having and we will create new versions for testing.

File Names

The three setup files have names which all start with the project name. If your project name was PROJECT, the three files would be called:

These files are all stored in the same folder as the PROJECT_settings.csv file.

Project setup and options

The Project setup and options file (PROJECT_settings.csv) is CSV format file which describes certain options in your project.

Tip: Your dictionary_name should contain some unique word or characters to help identify it. For instance call it Acme_Inventory instead of just Inventory to avoid conflicts with our vendor's projects. See each section:

Project_settings.csv file sections

See each section for data definitions and a sample.

See Also

Attribute Definitions

The attribute definitions file is a .CSV (comma separated value) file, PROJECT_attdef.csv which describes the attributes in your project.

For each Attribute, define the following:

The first line must be as follows:

Attribute,Label,Type,Decimal,MinWidth,Blank,Show,Edit,Report,Substitutions,Calculation,Alignment,Comment

If you have a line which starts with #Defaults, then it defines defaults for blank values in subsequent lines. You can have more than one #Defaults line in your file.

Attribute Definitions being edited as a .CSV file in Excel
Attribute Definitions being edited as a .CSV file in Excel


For help in creating a .CSV file, see: Creating .CSV file from .SKP file names .

Substitutions

In the fields marked for substitution (Substitutions = y), you can enter values which will be replaced by the size of the component. This is done by using special codes, such as %w% in the description.

Substitution codes

Note: The string which receives the substitutions is the value stored on the component.

Sample

This lets you use a generic description for several components, which will be modified by the actual size of the component.

e.g.: "%w% x %d% table" will appear on reports as: 36" x 48 1/2" table

For width, depth, or height substitutions, you can also add an amount, in inches, which you would like to add or subtract from the actual size. e.g. %w-3" will subtract 3" from the width.

Calculations

Fields may be calculates based on values in other fields.

  1. Use %field% to represent the value from another field.
  2. Use #QTY# to include quantity in a calculation: e.g. %Base Price% * #QTY#
  3. The fields used for calculations must be defined, in previous fields, before the field being calculated. This is because the field being used for calculations may also have calculations.
  4. Floating point numbers must be preceded by a 0. For example, if you want to calculate a 17.5% tax, use a calculation like: %Base Price% * 0.175

Extended prices and costs

To include extended prices or costs in your report:

  1. Add an additional field, e.g. 'Extended Cost. This must come after the cost field being extended.
  2. Set the new field to total
  3. Set the original cost field not to total.
  4. Put a calculation in the extended field, e.g. %Cost% * #QTY#

Attribute Levels

These .CSV files define which attributes appear at each report level.

Ther is a PROJECT_attdefX.csv file for each attribute level.


Default attributes

The default attribute file is a .CSV (comma separated value) file, PROJECT_attributes.csv which describes the default attributes for components in your project.

The first line must contain the names of your attributes. For example:

Component,Manufacturer,Part Number,Description,Cost,Private,Read Only,test bad,Date,Time

If you have a line which starts with #Defaults, then it defines defaults for blank values in subsequent lines. You can have more than one #Defaults line in your file.

Attribute defaults being edited as a .CSV file in Excel
Attribute defaults being edited as a .CSV file in Excel


Attribute Defaults viewed as an ASCII text file.

Component,Manufacturer,Part Number,Description,Cost,Private,Read Only,test bad,Date,Time
#Defaults,test_mfgr,,,,,,,,
test1,,pn1,desc1,1.11,private 1,ro 1,test_bad,3/14/2006,
test2,,pn2,desc2,2.22,private 2,ro 2,,,12:00
test3,,pn3,desc3,3.33,,,,,


Special Values for long integers

Excel does not handle long integer values properly - such as 4003982032485, so you must put a less than sign (<) in fron of long integer values so Excel will treat them as a string.

In the .CSV file, use <4003982032485. The < will automatically be stripped off when reporting the attribute value.

Auto Generate Attributes from Component Names

On the RpReports OEM Dialog , there is a function Auto Generate attributes from Component Names.

This creates an empty .CSV spreadsheet with component names which you can use to define your attributes.

Embed Attributes into Components

You can distributes your project, either with a ..._attributes.csv file to define the attributes, or by embedding the attributes into the .SKP files directly.

On the RpReports OEM Dialog there is a function Embed Attributes into Components

This adds your attributes directly to the .SKP files to define your components.

Automatic attributes

The description field can be automatically set by the component definition name or the component instance name.

If there are not default values for this field and if the user has not set the values using Edit Attributes, then the values will be obtained from the component instance or the component definition.

You specify which field receives these automatic values by specifying:

in the ini file.



Component naming

The Component field matches the component name up to the first pound (#) sign.

These will both get their attributes from 24" cabinet.

If the user has overridden the instance name, then this will be used instead of the component name.

Setting up a project

Step 1 - Definition files

Step 2 - Load the Project

Step 3 - Verify load


Status reports

There are some status reports available under the Plugins/RpReports menu to help you debug your project.

Show Component Attributes
This show the attributes for the selected component instance.


Show All Attribute Definitions


Problems

If these steps do not work properly. Load the Ruby Console (Windows/Ruby Console) and reload your project. If any error messages appear send them to Render Plus so we can wee what has gone wrong.

Load a Client Project

See Load a Client Project for information on loading the client project.

See also