Sapphire Custom Report - Advanced Reporting Made Simple

  • Sapphire Custom Report Overview
  • SapphireOne Array Items
  • Texim field variables
  • Variables used in the Header/Footer Area
  • Commonly used variables with shortcuts
  • Other Values.
  • Statements
  • Start Scripts - General details
  • Transactions > Custom Report

    The user should note that the Sapphire Tools menu from Query by Formula, through to Custom List Report has the same tools on it throughout SapphireOne when any list is being displayed. These are referred to as Common tools.

    Sapphire Custom Report Overview

    The Sapphire Custom Report feature, accessible from all tool menus in SapphireOne, offers a versatile and powerful reporting solution. Notably, the Sapphire Tools menu, from Query by Formula to Custom List Report, remains consistent throughout SapphireOne when displaying any list. These are known as Common tools.

    Sapphire Custom Report enables users to generate a wide variety of reports using data tables and fields from within SapphireOne. This feature allows customisation of both the presentation and the data displayed in a report to meet an organisation’s unique requirements. SapphireOne provides unrestricted access to your entire data set, and, when combined with robust custom scripting features, Sapphire Custom Report offers virtually limitless additional customisation options. This is particularly useful for incorporating arithmetic functions in data visualisation output, identifying changes in patterns, and for ranking, sorting, and filtering.

    In terms of design capabilities, Sapphire Custom Reports offer pixel-perfect layouts that facilitate the creation of consistent report layouts that align with your organisation’s branding or style guidelines.

    Create specific reports tailored to your business needs, such as Sales Quotes, Sales Orders, Sales Invoices, Purchase Order Invoices, Receipts, Remittances, Payslips, Human Resource Reports, and Financial Reports, among many others.

    To modify existing Custom Reports, users can navigate to Utilities > Controls > Custom Reports. However, creating new reports is not allowed in this section. Instead, new Sapphire Custom Reports can be generated from most print dialog screens in SapphireOne. They are labeled as Custom Report in the list, and when selected, SapphireOne will prompt the user to provide a name for the new Custom Report.

    Sapphire Custom Reports Function

    Utilising Sapphire Custom Report Layouts

    The SapphireOne Custom Reports List, displayed on the left, showcases the currently available reports prepared for customisation in SapphireOne.

    Within this Custom Reports list, users will discover a blank Custom Report for each of the more than 40 Custom Reports available for personalisation.

    As users navigate through SapphireOne’s various modes and categories, they will encounter multiple reports under a ‘Reports’ subcategory within the Print dropdown menus.

    In these ‘Reports’ subcategories, users will find Custom Report -1 and Custom Report 2 listed. These reports are directly linked to the Custom Reports in the list on the left.


    Sapphire Custom Report Query In Page

    Upon selecting a report for editing or customisation, the user will be presented with the Sapphire Custom Report Query In Page. This interface enables the user to construct a custom query for desired items, facilitating the testing of the report.

    Scripts play a crucial role in setting up custom reports in SapphireOne. These scripts offer unlimited potential, but if written incorrectly, they can jeopardise your data file. To ensure data safety, do not use your live data file when creating or configuring Custom Reports. Instead, make a copy of an existing data file and operate it in single-user mode.

    Sapphire Report Editor Page

    Once the user has finalised their custom query selections, they will be directed to the Sapphire Report Editor Page, as shown below. Here, the user has complete control over the report’s design.

    The following report was generated using the Custom Report Editor, configured as described above.

    Utilities-Controls-Custom Report Layouts

    Main Menu Toolbar Custom Report

    The main editor toolbar features several items, including File, Edit, Insert, and Test. The options available within these dropdown menus are detailed below.

    File Menu

    • New – Choosing this option initiates the creation of a new Custom Report with a blank page.
    • Open – This option prompts your operating system to search or browse for a file, allowing you to import an existing report saved as an XML file into a Custom Report. This can be used as a template for a new Custom Report or to replace (overwrite) an existing one.
    • Save – By selecting this option, SapphireOne saves the report directly into the data file. After saving, the document history will no longer be accessible using the undo command.
    • Save to Disk – This option instructs the operating system to display the save function, enabling the user to select a location to save the currently displayed Custom Report. The report will be saved in XML format.
    • Revert to Original – Choosing this option directs SapphireOne to revert the report back to its original state when first opened.
    • Close – When selected, SapphireOne displays an alert asking to save any changes. This alert will also appear when the red ‘close’ button in the top corner of the screen is selected on either a Mac or Windows device.

    If you encounter an issue that cannot be resolved, select the ‘No’ option mentioned above, and all changes made since the report was first accessed will be discarded. By choosing ‘Yes’, the report will be saved in its current state. The ‘Revert to Original’ option performs a similar function but does not close the report editor window, enabling you to continue working without needing to reopen the editor.

    Edit Menu

    The Edit menu in SapphireOne is similar to those found in various functions of both Mac and Windows operating systems, offering options such as undo, redo, cut, copy, and paste. It is important to note that if you encounter difficulties performing one of these actions from another menu in SapphireOne, try selecting the action from the Edit menu instead.

    Insert Menu

    This menu facilitates the addition of extra Header and Footer sections to the report.

    Exercise caution when inserting additional sections into the Sapphire Custom report, as once they are added, they cannot be removed. While it is possible to set their height to zero, making them invisible or hidden, keep in mind that they cannot be deleted once inserted.

    A new report has the following sections by default.

    • Header – Positioned at the top of the report, the Header typically contains elements such as addresses, logos, customer, and vendor details, among others.
    • Body – The Body of the Custom Report generally comprises the lines that form the report’s content.
    • Footer – The Footer is where banking details and other items related to the Custom Report can be printed.
    • Multiple Items – This menu allows for the addition of multiple headers, break headers, footers, and break footers. It is the only menu where these items can be added.

    Test Menu

    SapphireOne requires a transaction to display details on a page, enabling the user to check the accuracy and placement of various elements on the printed page. The four items on this menu allow for the selection and viewing of data placement on the printed page as follows:

    • Query Record – Although SapphireOne offers users the opportunity to perform a detailed query when initially opening the custom report, users can also select a transaction or record for testing by navigating to the Test menu and choosing the Query Record item. SapphireOne will then display the Detailed Query function, allowing users to select the record for testing and viewing. If no record is selected, a warning will appear, notifying users that it will open a certain number of records, which could potentially be in the hundreds.
    • Print – For Windows users, this option creates a PDF for viewing and checking. The user will need a few additional mouse clicks to view the PDF. (See “Do not use Print Preview” below).
    • Print Preview – For Mac users, this option provides the preview function immediately, without requiring additional mouse clicks.
    • Test HTML – Upon selecting this option, SapphireOne generates an HTML version of the report and opens the default web browser on your system to preview the report in HTML format. This is typically used for email distribution.

    New Custom Report Page Layout

    The Sapphire Custom Report feature empowers users to create their own reports from a blank template. This provides users with complete control over customisation, offering hundreds of customisable features.


     

    Custom Report Tools Panel

    On the left side of the screen, you’ll find tools for placing and modifying various object types in the Custom Report. These tools are consistent across all areas of the editor and do not change when different sections of the report are selected. Each object has attributes that can be set using the Object Attributes available on the right side of the editor. These Object Attributes from the right side of the editor will be detailed in the following sections.

    There are three groups of buttons on the left-hand side of the editor. The top group is used for selecting the type of object to be placed in the report. The middle group is for aligning each object, while the last group is for pixel-perfect placement of objects on the printed page.

    Custom Report Object Types

    Various objects are available for users to customise and control within the Sapphire Custom Report interface. By combining different options, users can create hundreds of unique combinations and develop reports tailored to their specific needs.

    Custom Report Select Object

    The white Arrow (Select) button is used to position the cursor on the report. To place an object on the report:

    1. Select the appropriate button. It will turn dark, indicating that it has been selected.
    2. Draw a frame for the object on the Custom Report. As soon as you release the mouse, the previously selected button will revert to its normal color. SapphireOne will then automatically return the cursor to the Select option, which is the standard pointer.

    Custom Report Text Object

    When the Text button is selected, it allows users to insert a text object by dragging out a rectangular marquee on the editor. Text can be entered into the object using the data entry field on the right-hand side of the editor. Standard attributes can be set up for the text in the marquee, as well as the background color. Note that text objects have a red border around the object itself and the object attributes area for easy identification.

    The Text Object Attributes are as follows:

    • Type – This field displays the selected object type, which is not user-modifiable (Text).
    • Visible Checkbox – By default, the object is set to visible. Objects can be made invisible if needed.
    • Object Behaviour Menu – This menu offers three behavior options for the object on the page:
      • Normal – The default setting with no additional behavior for the object.
      • Repeat – Some objects require a repeating attribute, mainly used in the body area for reports with multiple lines, like a list of transactions. The report prints each line until all lines are printed or it breaks to the next page, continuing there. Headers and footers can be set up differently for page breaks and the final page.
        • Offset – This method adds spacing between rows of repeated data. Increasing the number here spaces out the rows, which can be for cosmetic reasons or to prevent overlapping.
      • Grow To Bottom – When selected, the object will grow to fill the page if space permits.
    • Content – Enter the content for your text object here. Standard formatting procedures are accepted, and a carriage return is used for multiple lines.
    • Hyper Link Checkbox – Select this checkbox if the text box should be a hyperlink.
    • Multi Style – Consult with the SapphireOne support team before using this feature.
    • Auto Grow Checkbox – If checked, the editor will extend the object downwards if space permits.
    • Font & Size Selection – Font, font size, and text color options are consistent with most word processor applications and therefore will not be documented in detail here.
    • Object Background Colour – You can also select background colors for the text object.
    • Transparent Checkbox – If the text object is in front of another object with a background color, selecting this checkbox makes the background of the text object transparent.
    • Script – If needed, an individual script can be added to any Text Objects in the report.

    Custom Report Variable Object

    Selecting the New Variable button allows users to insert an object that can be linked to a variable. This variable can then be linked to an array or chosen from the menu associated with the Source data entry field. For most variable items, some data entry formatting will be required in the Format data entry field. For more information on number formatting, please refer to the subsequent section on formatting numbers. Note that Variable objects have a red border around both the object itself and the Object Attributes area for easy identification.

    The Variable Object Attributes are defined as follows:

    • Type – This field displays the type of object that has been selected (Var) and is not user-modifiable.
    • Visible Checkbox – By default, this is set to visible. Objects can be set to invisible if required.
    • Object Behavior Menu – This menu offers three options for the object in the Custom Report:
      • Normal – The default setting, which provides no additional behavior for the object.
      • Repeat – Some objects require a repeating attribute, mainly used in the body area when there are multiple lines in the report, such as a list of transactions. The report prints each line until all lines are printed or until it breaks to the next page, continuing to print lines there. This is why footers and headers have various options for printing on specific pages.
        • Offset – This method adds spacing between rows of data when a line is repeated. Increasing the number here results in rows being printed further apart, either for cosmetic reasons or if rows overlap and additional spacing is needed.
      • Grow To Bottom – When selected, the object will grow to fill the page if space permits.
    • Source – This can be an array from the list provided, or users can select a table from the left-hand dropdown menu (arrow) and then choose a cell from that table.
    • Format – Four options are available for this item:
      • Date – Ten options for selecting the date format.
      • Time – Ten options for selecting the time format.
      • Picture – Six options for inserting a picture.
      • Number – Several options for formatting numbers. Please read the additional information provided.
    • Multi Style – Consult SapphireOne support team before using this feature.
    • Auto Grow Checkbox – Ticking this checkbox allows the editor to extend the object downwards if space permits.
    • Font & Size Selection – Font, Font Size, and Text color options are consistent with most word processor applications and won’t be documented in detail here.
    • Object Background Color – Users can also select background colors for the text object.
    • Transparent Checkbox – When the text object is in front of another object and its background color is to be printed, users can select this checkbox to make the background of this object transparent. This is useful when the object is in front of a colored box determining the background for the object.
    • Script – If needed, users can add an individual script to any Text Objects in the report.

    Field Object

    When the Field button is selected, users can insert an object that displays a predefined field from a cell in their data file. This is primarily used for fields that do not usually change in a report, such as address and delivery details.

    Scripts can also be written so that this field displays dynamic text. For instance, a single report could be used for Quotes, Orders, and Invoices by writing a script that changes the text in a few of these fields. Note that Field objects have an Orange border around the object itself and the Object Attributes area for easy identification.

    The Field Object Attributes are as follows.

    • Type – This field displays the type of object that has been selected (Field) and is not user modifiable.
    • Visible Checkbox – By default, the object is set as visible. However, objects can be made invisible if required.
    • Object Behavior Menu – This menu offers three options for the object in the Custom Report:
      • Normal – The default setting with no additional behavior for the object.
      • Repeat – Some objects require a repeating attribute, selected from a drop-down menu. These are mainly used in the body area when multiple lines are present in the report (e.g., a list of transactions). The report prints each line until all lines have been printed or it breaks to the next page and continues printing.
        • Offset – This option allows for adding spacing between rows of data by increasing the number value. This can be for cosmetic reasons or to address overlapping rows.
      • Grow To Bottom – When selected, the object will grow to fill the page if space permits.
    • Source – Users can select from an array list or choose a table and cell from the drop-down menu.
    • Format – There are four options for formatting:
      • Date – Ten options for selecting the date format.
      • Time – Ten options for selecting the time format.
      • Picture – Six options for inserting a picture.
      • Number – Various options for formatting numbers.
    • Multi Style – Please consult the SapphireOne support team before using this feature.
    • Auto Grow Checkbox – If checked, the editor will extend the object downwards if space permits.
    • Font & Size Selection – Font, font size, and text color options are consistent with most word processor applications and therefore will not be documented in detail here.
    • Object Background Color – Users can select background colors for the text object.
    • Transparent Checkbox – If a text object is in front of another object and its background color is to be printed, users can make the background of the text object transparent by selecting the checkbox.
    • Script – Users can add individual scripts to any text objects in the report if required.

    Rectangle Object

    When the Rectangle button is selected, users can insert a rectangle as a design element. The lines of the rectangle can be set as visible or invisible, non-printing. Line color and thickness can be adjusted according to user preferences. A fill color may also be selected. A common use is to create a colored rectangle and place objects on top of it, resulting in a colored background with other text fields (such as headings) positioned above it.

    The Rectangle Object Attributes are as follows:

    • Type – This field displays the type of object that has been selected and cannot be modified by the user. (Rect)
    • Visible Checkbox – By default, the object is set to visible. However, objects can be made invisible if required.
    • Object Behaviour Menu – This menu has three options, as follows, for the object in the Custom Report:
      • Normal – This is the default setting with no additional behavior for the object.
      • Repeat – This attribute is selected from a drop-down menu for objects that must be repeated in the body area, such as when there are multiple lines in the report. For example, a list of transactions.
        • The report prints each line in the report until it has printed them all, or it breaks to the next page and continues printing the lines there until all lines in the report have been printed. This is one reason why footers and headers have a number of options for printing on certain pages.
        • If SapphireOne breaks the page, a different header and footer may be set up on the page break, and a final footer for the last page only in the report.
          • Offset – When a line is repeated, there has to be a method of adding spacing between rows of data. By increasing the number here, the rows of data will be printed further apart. This could be for cosmetic reasons or if the rows of data overlap and additional spacing is required.
      • Grow To Bottom – When this is selected, the object will grow to the bottom if space permits.
    • Line Colour – Click on the box next to the heading. A Choose Color for Line option will be displayed, enabling the user to select a color for the line.
    • Line Thickness – Select and enter a number for the line thickness.
    • Fill Checkbox – By default, this is not selected, so the rectangle will be transparent. When the checkbox is selected, the rectangle will be filled with a black color by default.
    • Fill Colour – Click on the box next to the heading. A Choose Color for Fill alert will be displayed, enabling the user to select a color for the fill.

    Oval Object

    When the Oval button is selected, the user may insert a circle or oval that has the exact same attributes as the rectangle object documented earlier. The only difference is that the Type will be set as Oval.

    Line Object

    When the Line button is selected, the user may insert a line that has the exact same attributes as the rectangle object documented earlier. The only difference is that the Type will be set as Line. This object is useful for drawing separators, underlines, or any other type of lines that may be required in the report. The line color and thickness can be set, and it can also be made visible or invisible depending on the user’s preference.

    Horizontal and vertical lines can be added to the custom report by selecting the Line tool and then adjusting the line width to either 1 or 0 in the precision alignment area located in the bottom left-hand corner of the report. A line width of 1 will create a visible line, while a line width of 0 will create an invisible line, essentially creating a horizontal or vertical divider. This can be useful for separating sections or data within the report.

    Picture Object

    When the Picture button is selected, the user may insert a box that will contain a picture. They would then select the Load From Disk button , and the operating system will prompt for the location of the picture file. Most common formats such as JPEG, TIFF, etc. may be used, but some limitations apply, particularly to size.

    The Picture Object Attributes are as follows.

    • Type – This field displays the type of object that has been selected and is not user modifiable. (Pic)
    • Visible Checkbox – This checkbox is set to visible by default. Objects may be made invisible if required.
    • Object Behavior Menu – This menu has 3 options for the object in the Custom Report:
      • Normal – The default setting with no additional behavior for the object.
      • Repeat – Some objects must have a repeating attribute selected from a drop-down menu. These are mainly used in the body are and are used when there are multiple lines are in the report. A list of transactions for example.
        • The report prints each line in the report until it has printed them all, or it breaks to the next page and continues printing the lines there until all lines in the report have been printed.This is one reason why footers and headers have a number of options for printing on certain pages.
        • If SapphireOne breaks the page, a different header and footer may be setup on the page beak and a final footer for the last page only in the report.
          • Offset – When a line is repeated, spacing must be added between rows of data. By increasing the number here, the rows of data will be printed further apart. This could be for cosmetic reasons or if the rows of data overlap and additional spacing is required.
    • Grow To Bottom – When this option is selected, the object will grow to the bottom if space permits.
    • Load from Disk – To load a new picture, select this button. Your operating platform will display a search for file option enabling the user to select the picture that is to be installed in the new picture object.
    • Save to Disk – This option enables the user to save the current picture in the picture object to disk.
    • Picture Original Dimensions – The editor displays in pixels the dimensions of the current picture in the object.
    • Format – Some care must be taken as some of these options will scale the picture according to the dimensions of the Picture Object, so the aspect ratio may be distorted. Select the item that works best for you:
    • Truncated Centered – SapphireOne will truncate and center the picture.
    • Scaled to Fit – SapphireOne will scale the picture to fit in the picture object. Watch the aspect ratio.
      • On Background – The image will be in the object, but any background will be transparent.
      • Scaled to fit Proportional – The picture will be scaled to fit the shortest direction in the object.
      • Scaled to fit Prop Centered – The picture will be scaled to fit but will be centered.

    Object Alignment

    • Object Layering Management – This group of button performs the task of aligning groups of objects and managing the way they are stacked on top of each other. Initially, the overlay of objects is determined by the order in which they are added to SapphireOne. Objects that are added first will be at the back, while objects that are added last will be at the top level.
    • Forwards – Selecting this Forward button will bring the selected object forward one level at a time, in front of other objects.
    • Backwards – Selecting this Backwards button will send the selected object behind other objects one level at a time. This allows for easy management of the layering of objects and their position in the report.
    • Alignment – The remaining buttons in this group are used to align objects.
      1. Multiple Objects – To align multiple objects in the Custom Report, first select them by holding down the Shift key and then using the mouse to select the objects that are to be aligned.
      2. Button Selection – Next, click on the appropriate button to perform the desired action. The options available are Left, Top, Centered Vertically, Centered Horizontally, Right, and Bottom. These buttons can be found in the Object Layering Management group of buttons.

    Object Precision Positioning

    • Numerical Size for Distance – It is important to note that all measurements used in Sapphire Reports are in points, with an A4 page being 842 by 595 points. When precise adjustment of objects is required, this area can be used.
      • Single Object – For example, if a single object is selected and the first button at the top is clicked, the object’s left side will be positioned as entered, a number of points from the left side of the report. If a group of objects all of the same type are selected, SapphireOne will place them all the same number of points from the left of the report. Note that they must all be the same type.
      • Common uses – One of the most common uses of a button in this area is the second button, distance to top option. This will set all the selected objects the same number of points from the top of the Sapphire Report. This is very handy when doing a final precision alignment of a group of objects in the Body section.
    • Position Fields – Each of these buttons performs a point by point setting for objects on the page as follows:
      • This field sets the distance to the Left side of the page for the selected object or objects.
      • This field sets the distance to the Top of the page for the selected object or objects.
      • This field sets the distance to the Right side of the page for the selected object or objects.
      • This field sets the distance to the left of the page for the selected object or objects.
      • This field sets the overall Width of the selected object or objects.
    • Zoom Buttons – The two Magnification buttons are for resizing the editor itself. When it is difficult to get exact alignment, the user can make the editor much larger, making it easier to precisely place objects on the page, or to read the report. It is also useful when searching for objects that have been moved off the page.

    Formatting Numbers

    The formatting options for numbers in Custom Reports are now consistent with the currency settings in SapphireOne. By default, the currency symbol will be set to the one used in your country, typically the $ symbol. However, other currency symbols are also available in SapphireOne to accommodate different regions and currencies.

    There are several default formatting options available for numbers in Custom Reports. Choosing one of these options will tell SapphireOne to print the data entered into the report in the specified format. In addition, you can also create your own custom number formatting if needed. This feature simplifies the process of setting up number formatting in your reports, saving you time and effort. The following are some examples:

    1. ###,###,##0.00;-###,###,##0.00;0.00 will print 123,456,789.00 or -123,456,789.00
    2. ###,###,###;-###,###,###; will print 123,456,789 or -123,456,789
    3. $###,###,##0.00;($###,###,##0.00);0.00 will print $123,456,789.00 or (123,456.789.00)
    4. $###,###,###;($###,###,###); will print $123,456,789 or ($123,456,789)
    5. ###0.00%;-###0.00%; will print 12.34% or -12.34%
    6. ###0%;-###0%; will print 12% or -12%

    The available formatting options can be used as is or can be customised according to the user’s needs. However, some minor modifications might still be required, as these options are mainly intended to be used as templates to assist the user in setting up the report formatting.

    When formatting numbers, SapphireOne replaces the # symbols with data or values from the data file, while all other characters entered will be printed as they are entered into the formatting data entry field. The semicolon (;) symbol is used by SapphireOne to determine how to print the values for positive, negative, or zero values. The first group before the semicolon represents positive values, the second represents negative values, and the last group after the semicolon represents zero values or values after the decimal point.

    Formatting Zero Values or balances

    The user can choose what to print when a zero balance is encountered. By default, SapphireOne prints 0.00. However, anything can be entered after the second semicolon, such as Zero, None, nnnn, or any other desired text.

    When a value is zero, SapphireOne prints it as entered after the second semicolon. For instance, entering $0.00 will print as entered $0.00. If the user wants SapphireOne to print nothing at all, they can leave all characters after the second semicolon blank. For example, if the formatting option is $###,###,##0.00;($###,###,##0.00);, SapphireOne will print values to the second decimal point for positive and negative values, but when a zero balance is encountered, it will print nothing.

    Sapphire Custom Reports Properties Panel

    The right-hand side of the editor displays data entry fields that are used for the currently selected section of the report. These sections include Report Properties, Header, Break Header, Body, Totals, Footer, and Break Footer.

    When opening any Custom Report, the editor will display the Report Properties option by default. All reports have a Header, Body, and Footer areas by default. To return to these default options for the report as a whole, select the Report Properties option at the top of the table.

    Individual Objects

    Once each area has been selected and opened, all objects under the Report Properties item can be seen in the list. Each area can be expanded to show a list of all objects in the selected area. They are listed in the order they will be printed, and every single object is listed.

    These objects can be selected from this window and will be displayed in the same manner as when selected with the mouse. The handles on each corner and center line will appear as eight dots. This is particularly useful when an object has become hidden below other objects and needs to be located and selected. It is also a means of checking that there are no hidden items in the report that may cause print errors.

    The documentation will commence with the Report Properties attributes and then document each object individually. The user will note that for every object, there will be common attributes plus some specific attributes.

    Report Properties Attributes

    When the Report Properties section is displayed, SapphireOne shows attributes for the Custom Report as a whole. The user must set up attributes specific to their operating platform (MacOS or Windows) to ensure that the Custom Report prints correctly. A Starting Script is always required, and Scripts may be entered for the Body as well as an End Script which runs post-printing. To return to these properties, select the Report Properties folder in the top right-hand corner of the editor.

    The Report Properties include:

    • Record per page checkbox – Please contact the SapphireOne support team for information on this function.
    • Source – There are three available options:
      • Table – This is the default option, which enables a second list to be displayed, allowing the selection of a table.
      • Array – This option indicates that an array is to be entered.
      • Fixed –
    • Paper – The data entered here dictates to SapphireOne the desired print settings as follows.
      • Paper Dimensions – For portrait printing, the default paper dimensions are 595 (width) by 842 (height), while for landscape printing, the dimensions are 842 (width) by 595 (height).
      • Margins – The margins around the edges of the page can be set in pixels for the top, bottom, left, and right.
    • Setup – It is important to note the “Setup” button . When a new report is being used for the first time or imported into SapphireOne, the user should select this button and check the print properties for their operating system. This includes selecting the printer from the drop-down menu, choosing between portrait or landscape modes, and setting any additional parameters required by the printer. It is also recommended that the user prints at least one report to PDF to visually check the printer settings.
      1. Select the printer from the drop-down menu, then Landscape or Portrait modes, and any other parameters for your printer that will be required.
      2. It is then highly recommend the user print at least one report out to PDF. It is not until a report is actually printed that the printer settings can be visually checked.
    • Scripts – If the user needs to modify a script, it is recommended that they copy the entire script, paste it into a text or code editor, edit it, and then paste it back into the report. There are three script areas provided:
      • Start Script – Loads with the document.
      • Body script – Runs after the report has loaded in the editor.
      • End Script – Runs after the report has printed.
    • Sections – Each Custom Report includes a Header, Body, Total, and Footer. Optional sections include a Break Header and additional Footers.
      • Printing Sections – Some sections have check box options to dictate that they are to be printed on to the, First Page, Odd .Pages, Even Pages and the Last Page. Typically for Headers the most common option would be the First Page only, and for Footers to print on the Last Page only.
    • Multiple Headers and Footers – Multiple Headers and Footers are allowed.
      • The user has four checkboxes that dictate exactly what page or pages these headers and footers are to be printed on.

    Header Section Attributes

    This section displays objects that are currently in the header. These may include cells displaying data or custom design/branding elements such as images, or simple shapes such as a rectangle, circle, or line. If you are searching for a hidden object, scroll through each item in the list until the handles (8 dots) appear, indicating its selection in the editor.

    • Header Attributes – This section displays attributes that the user can set for the header section.
      • Type – This displays the currently selected section type, which is the header.
      • Visible Checkbox – Tick this checkbox if the header should be visible (default selected). This checkbox is primarily used when the section is not needed. Remember to set its height to 0.
      • Fixed Height Checkbox – Tick this checkbox if the header should have a fixed height (default not selected).
      • Break On – Choose from the menu if the report should break at a specific point.
      • Script – Enter any required script for this header.

    Custom Report Break Header Section Attributes

    When inserted from the main menu, this break header will be positioned before the selected item in the top right-hand corner of the editor.

    This section shows objects that are currently in the break header, which can include cells displaying data or custom design/branding elements such as images, as well as simple shapes like rectangles, circles, or lines. To locate a hidden object, scroll through each object in the list until the handles (8 dots) appear, indicating its selection in the editor.

    • Break Header Attributes – This section displays attributes that the user can set for the break header section.
      • Type – This displays the currently selected section type, which is BreakHeader.
      • Visible Checkbox – Tick this checkbox if the Break Header should be visible (default selected). This checkbox is primarily used when the section is not needed. Remember to set its height to 0.
      • Fixed Height Checkbox – Tick this checkbox if the Break Header should have a fixed height (default not selected).
      • Break On – Choose from the menu if the custom report should break at a specific point.
      • Script – Enter any required script for this Break Header.

    Body Section Attributes

    This section displays objects that are currently in the body section, which can include cells displaying data or custom design/branding elements such as images, as well as simple shapes like rectangles, circles, or lines. To locate a hidden object, scroll through each object in the list until the handles (8 dots) appear, indicating its selection in the editor.

    • Header Attributes – This section displays attributes that the user can set for the body section.
      • Type – This displays the currently selected section type, which is Body.
      • Visible Checkbox – Tick this checkbox if the body section should be visible (default selected).
      • Fixed Height Checkbox – Tick this checkbox if the body section should have a fixed height (default not selected).
      • Break On – Not allowed for the body section.
      • Script – Enter any required script for this body section.

    Totals Section Attributes

    This section displays objects that are currently in the totals section and can be set by the user. These objects may include cells displaying data or custom design/branding elements such as images, as well as simple shapes like rectangles, circles, or lines. If you are searching for a hidden object, scroll through each object in the list until the handles (8 dots) appear, indicating its selection in the editor.

    • Totals Attributes – This section displays attributes for the Totals section.
      • Type – This displays the attributes that can be set for the Totals section.
      • Visible Checkbox – Tick this checkbox if the Totals section should be visible (default selected).
      • Fixed Height Checkbox – Tick this checkbox if the Totals section should have a fixed height (default not selected).
      • Bind to Bottom Checkbox – Tick this checkbox if the Totals section should be bound to the bottom of the page.

    Custom Report Break Footer Section Attributes

    When inserted from the main menu, this break footer will be placed before the tools section in the top right-hand corner of the editor.

    This section displays attributes that can be set by the user for the Break Footer section. The Break Footer section typically contains totals for the transaction, and if the report breaks over several pages, it may be set up to display subtotals. Placing a line in this section will cause the editor to draw the line under the last item in multi-page reports.

    • Break Footer Attributes – This section displays attributes that can be set for the Break Footer section by the user.
      • Type – This displays the type of section that is currently selected, BreakFooter.
      • Visible Checkbox – Tick this checkbox if the Break Footer should be visible (default selected). This checkbox is mainly used when the section is not needed. Set its height to 0 to ensure correct printing.
      • Fixed Height Checkbox – Tick this checkbox if the Break Footer should have a fixed height (default not selected).
      • Break On – Choose from the menu if the report should break at a selected point.
      • Script – Enter any required script for this Break Footer.

    Custom Report Footer Section Attributes

    This section displays attributes that can be set by the user for the Footer section. The Footer section usually contains totals for the transaction and, if the report breaks over several pages, may be set up to display subtotals. Ensure that the layout of the Footer section is optimised, and all objects are visible and well-organised to enhance the presentation of the report.

    • Footer Attributes – This section displays attributes that can be set by the user for the Footer section.
      • Type – This displays the type of section that is currently selected, which is Footer.
      • Visible Checkbox – Tick this checkbox if the Footer section should be visible (default selected). This checkbox is mainly used when the section is not needed. Set its height to 0 to ensure correct printing.
      • Fixed Height Checkbox – Tick this checkbox if the Footer section should have a fixed height (default not selected).
      • Bind to Bottom Checkbox – Tick this checkbox if the Footer section should be bound to the bottom of the page.
    • Printing On – This section may be set up to only print on certain pages of the report. The Footer section usually contains totals for the transaction and, if the report breaks over several pages, may be set up to display subtotals. Placing a line in this section will cause the editor to draw the line under the last item in multi-page reports.
      • First Page Check box – Tick this checkbox to only print this footer on the first page of a report.
      • Odd Pages Checkbox – Tick this checkbox to only print this footer on odd pages in the report.
      • Even Pages Checkbox – Tick this checkbox to only print this footer on even pages in the report.
      • Last Page Checkbox – Tick this checkbox to only print this footer on the very last page in the report.

    Custom Report Object Types

    The attributes for each type of object have been documented earlier in this article as part of the documentation for the tools on the left side of the work area, and therefore will not be repeated here. The objects available in the Custom Report module are:

    • Object Selector
    • New Text
    • New Variable
    • New Field
    • New Line
    • New Picture

    Each of these objects can be used to customise the report and add different types of content to the sections of the report.

    Importing A New Custom Report

    If you need to import multiple custom reports, you can follow the steps below for each report. It’s recommended to preview the report after each change to ensure the desired result is achieved. More detailed instructions are available later in this article.

    The following steps outline how to import a SapphireOne custom report with minimal difficulty. For example, if the SapphireOne support team provides you with a custom report that is ready for importing into your data file, you can follow these steps to import it and then make any necessary minor modifications in your live data file. The procedure is as follows:

    • Transaction Selection – Choose a transaction to use for testing the custom report, and select a unique attribute within it, such as Sequence, Internal, or External reference numbers. Remember to write it down.
    • Locating the Old Custom Report – Find and take note of the name of the existing custom report you want to modify or create from scratch from the print dialog location on your computer.ou want to modify or create from scratch from the print dialog location on your computer.
    • Open Custom Report Layouts – Navigate to Utilities > Controls > Custom Report Layouts in SapphireOne, and select the Custom Report that corresponds with the one you noted down.
    • Open the Custom Report – Double-click on the required Custom Report, and the Query function will open with two options.
      1. This option is not required however these details will have to be entered at step 10 as SapphireOne will not have a record to perform a test print of the report against.
      2. Alternately enter the details that you have written down at step 1 above.
    • One of two things will occur.
      1. If there is an existing Custom Report SapphireOne will immediately open the report ready for editing.
      2. If there is no data in the selected report, SapphireOne will display an alert asking the user to choose between a Blank, Label or List Wizard report layouts.
    • Creating Modify or Import -The Custom Report is now ready to create, modify, or import an XML file to overwrite the existing Custom Report. The user has the following options:
      1. Create a new Custom Report.
      2. Modify an existing Custom Report.
      3. Import an xml file to overwrite this Custom Report as follows.
        1. Open from the File menu.
        2. when the find function is displayed for your Mac or Windows, find the new xml file and select it to import it.
    • Paper Size – After importing the new file, ensure the paper size’s width and height are correct (595 by 842 for A4 portrait and 842 by 595 for A4 landscape) on the right-hand side of the editor.
    • Printer Selection – Select the Setup button on the right-hand side of the editor and ensure the new Custom Report in SapphireOne is associated with the correct printer in your system.
    • Query Record – If not done previously, go to the Test menu and select Query Record, entering the details selected in step 1. SapphireOne will now only use that record or group of records for testing.
    • Printing –The printing functionality is slightly different between a MacOS and Windows.
      • For a MacOS select the Print Preview option
      • For a Windows select the Print option.

    SapphireOne allows for unlimited companies within a single report data file. It is important to note that reports can be specific to the Master Login, so users may need to log in to each company in turn to view or modify reports. Alternatively, users can use a master login to access all reports in the data file, but entering financial data is prevented in this mode. It is not recommended to view or modify Sapphire Reports using a master login, as they can become specific to the Master Login. Users should remember to log out and edit reports using a specific company login.

    Saving A New Sapphire Custom Report

    After saving the new Custom Report in SapphireOne, it will be accessible from the Print menu drop-down list, which is located next to the print button. This allows users to select and print the report as needed.

    It’s important to note that multiple Custom Reports can be created and saved in SapphireOne. Therefore, users should carefully consider the naming conventions they use for Custom Reports to ensure easy identification and accessibility from any location in the software.

    Printing A Sapphire Custom Report

    To print from a list of transactions on screen in SapphireOne:

    1. Select the desired transaction(s) from the list.
    2. Click on the arrow to the right of the print button.
    3. A print menu will appear, displaying any newly created Sapphire Custom Reports.
    4. Select the appropriate Custom Report to use for this print job.
    5. Follow the standard printing prompts for your operating system (MacOS or Windows).

    Individual Transactions – Once a transaction has been opened utilising Look or Modify.

    1. Select the transaction(s) you want to print from the list on screen.
    2. Click on the arrow next to the print button, located in the toolbar or menu.
    3. From the list of printing options that appears, select “Custom”.
    4. A print menu will be displayed, showing any new Sapphire Custom Reports that have been set up.
    5. Select the appropriate Custom Report that you want to use for this print job.
    6. Follow the normal system prompts for your operating system (Mac or Windows) to complete the printing process.

    By clicking on the print button directly in SapphireOne, the software will use the default printing option associated with the currently active function. However, to access additional printing options, the user needs to select the arrow located to the right of the print button.

    Problem Solving

    Printing Errors

    To locate any objects that may be causing printing errors, follow these steps:

    1. Open the Custom Report layout in question.
    2. Select the “Show Grid” option in the “View” menu.
    3. Zoom out using the “Zoom Out” option in the “View” menu.
    4. Scroll through each page of the report to locate any objects that are outside the bounds of the page or work area.
    5. Once an object has been located, move it back within the work area and adjust its size or position as needed.
    6. Repeat this process for any other objects that may be causing printing errors.
    7. After all objects have been adjusted, deselect the “Show Grid” option in the “View” menu.
    8. Preview and print the report to ensure that all objects are now within the bounds of the page and that there are no more printing errors.

    Pagination and Printers

    The editor in SapphireOne measures distances on the page in points, which is a unit of measurement commonly used in printing and publishing. One point is equivalent to 1/72 of an inch or 0.35 millimeters. This is important to keep in mind when designing and formatting custom reports, as it allows for precise placement of objects and ensures that they are properly aligned and spaced.

    Portrait or Landscape

    An A4 sheet of paper for Portrait is 297mm high by 210mm wide in size and this should be the size selected for most reports unless it is for a different size of paper. Landscape is 210mm by 297mm.

    • New Reports – When creating a new report, the first item to select is whether the report should be in portrait or landscape orientation. It’s possible to print reports on any size paper, including rolls used in Point of Sale (POS) systems.
    • Printer Behavior – Different printers may behave differently, so each report may need to be set up individually for each printer. This is especially important if the report was created on a different printer and is being imported into a different data file.
    • Printer Page Size – When creating a new report or modifying an existing one, pay close attention to the page size and margins.
      • After completing the report, always double-check that the paper size and margins are correct.
      • Incorrectly setting the page size in a report can affect how the printer handles the page, so it’s important to avoid this mistake.
    • Printer Margins – Before printing a report, it’s a good idea to print it to a PDF and review it to ensure it looks the way you want it to.
    • Print a pdf – For a final check, print the report to a PDF and see how the report looks.
    • First Print – For the first print, select the page orientation and all printer selections, and then choose Print Preview.

    Test Menu & Printing

    • Test Transaction or Transactions – Before commencing to set up any Sapphire Report, the user needs a transaction currently in SapphireOne to print a preview of the report they are setting up.
      • It’s important to note that what the user sees in the editor may not be exactly what gets printed.
      • When creating the report, the user needs to constantly go to the Test dropdown in the SapphireOne menu and preview the report to see how it will look when printed.
      • To do this, they need to execute a transaction inquiry from the area that the report is intended for and make a note of one or more of the following: the Internal or External reference number, or the Sequence number (if it is unique to a single transaction or a small group of transactions).
    • Editor Query – When a report is selected for editing, SapphireOne will ask for a transaction to test with. The recommended options are the Internal or External reference number, or the Sequence number. However, any cell in the table may be used as long as the data entered is uniquely applicable to the single transaction or a small number of transactions.
      • If nothing is entered, the user should be aware that when asked to print preview, SapphireOne will try to print a pdf on screen of every transaction in the list.
    • Test Menu – This menu has three options. The User should note the following:
      • If the user has forgotten to query for a record or they want to use a different transaction for testing, they may select Query Record and then select a new record for testing.
      • The Sequence number option is not always on the query on entry function, but when the detailed query is accessed from within the report, it is usually at the top of the list, which makes it easier to find.
    • Printing MacOS and Windows – If the user wants to preview or print to a printer, they should select one of the Print options. The first one, Print, is for Windows users, while the Print Preview option is for MacOS users.
      • For Windows – Select the Print option, and this will take the user through the normal print alert menus, enabling the selection of an option to display a pdf on the screen. This will not work on MacOS.
      • For MacOS – Select the Print Preview option, and SapphireOne will immediately display the preview function with the pdf just asked for. Note that this will not work on Windows.

    SapphireOne Array Items

    Arrays and Direct access to the Database

    Array – An array is a variable that provides a concise way to access data with multiple dimensions. These dimensions can store values, with their size specified. Arrays can be used in Sapphire Custom Reports, with the option to substitute additional lines of code to reuse arrays for specific purposes. A complete list of original arrays is provided later in this article.

    Direct access to a Cell – Direct access to a cell is another method available in Sapphire Custom Reports, allowing the user to select any cell from any table in the data file. However, defining which table and cell to access can be challenging. Therefore, these arrays are documented, and the programming already exists in SapphireOne.

    New Custom Reports – SapphireOne now supports both array and direct access methods in New Custom Reports. While direct access may be easier for some common items, arrays can still be used for others, providing a simpler solution than searching for the correct cell in a specific table.

    What are Array items?

    The arrays mentioned earlier are similar to shortcuts on both Mac and Windows operating systems. These shortcuts were created by programmers for commonly used cells when creating reports using the old Page Pro report editors. However, since the creation of Sapphire Reports, these shortcuts have become somewhat redundant.

    • Array Procedure – Instead of selecting the Source data entry field and searching for the Stock Breakdown Quantity cell, the user can directly enter the variable aReala, which establishes a link to the cell.
      • These shortcuts depend on the SR_PreLoad used to set up the report.
      • For example, when aReala is entered for Invoices, it is linked to [Invoices]Stock_Breakdown’Quantity. Note the table and the cell.
      • [Invoices]Stock_Breakdown’Quantity. Note the table and the cell.
    • Source Procedure – For most other cells in the table, the user can go to the Source drop-down menu in the Sapphire Report editor and navigate to the required cell. However, this drop-down list can be very long at times.

    Array Names used in the Body Section of a Custom Report

    atextm [Invoices]Stock Breakdown’Description, Reads the Inventory name/description as entered into an Inventory Inquiry. If it is altered in an Invoice it will read the altered name/description as entered by the user. You can alter the description in an Invoice With pack tally turned on, will it print ‘Pack(s)‘ before the batch number on each consecutive line.
    Atextn [Invoices]Stock Breakdown’Serial Number Serial number attached to the Inventory item.  It will be in the format Serial No, Serial No, across the page
    aReala [Invoices]Stock Breakdown’Quantity
    aRealb [Invoices]Stock Breakdown’Rate Average cost of the item as set by the inventory rules
    aRealc [Invoices]Stock Breakdown’Newrate The above Breakdown’Rate but after discounts are applied.
    ATemp2a25 [Invoices]Stock Breakdown’Discount Code
    aReald [Invoices]Stock Breakdown’Discount Percentage
    aReale [Invoices]Stock Breakdown’Amount
    aRealf [Invoices]Stock Breakdown’Tax
    aRealg [Invoices]Stock Breakdown’Total
    ATemp3A25 [Invoices]Stock Breakdown’Tax code The tax code assigned to the line item
    aRealh [Invoices]Stock Breakdown’Tax Rate Normally the Tax Rate is locked to the Tax Code above but some tax codes are variable and may be entered here.
    aReali [Invoices]Stock Breakdown’Backordered The Quantity Backordered
    aRealj [Invoices]Stock Breakdown’Ordered The quantity Ordered
    aTemp4A25 [Invoices]Stock BreakdownProject LK The Project Data entry field
    atexta [Invoices]Stock Breakdown’IVBAlpha1_20 Custom Page cell in a QCI OCI or SCI
    atextb [Invoices]Stock Breakdown’IVBAplha2_20 Custom Page cell in a QCI OCI or SCI
    atextc [Invoices]Stock Breakdown’IVBAplha3_30 Custom Page cell in a QCI OCI or SCI
    atextd [Invoices]Stock Breakdown’IVBAlpha4_30 Custom Page cell in a QCI OCI or SCI
    atexte [Invoices]Stock Breakdown’IVBAlpha5_10 Custom Page cell in a QCI OCI or SCI
    aRealaa [Invoices_Stock_Breakdown]Weight
    aRealab [Invoices_Stock_Breakdown]Pallet
    aRealac [Invoices_Stock_Breakdown]Carton
    ArealAE [Invoices_Stock_Breakdown]Wet_Tax      very last item in the very long list
    ALongE [Invoices]Stock Breakdown’LineNumbering, Starts at 1 and increments by 1 for each line in the transaction.  1 for the first line then 2 for the second line and so on.
    Atexto [Invoices]Stock Breakdown’UDF1 Displays data entered into UDF1 field’
    atextf [Invoices]Stock Breakdown’BBSupPCode
    atextg [Invoices]Stock Breakdown’BBRef
    aRealm [Invoices]Stock Breakdown’IVBReal1
    aDate [Invoices]Stock Breakdown’IVBDate1
    atextz [Invoices]Stock Breakdown’BinText
    atextt [Invoices]Stock Breakdown’Unit 
    atextu [Invoices]Stock Breakdown’Transfer Inv Lk
    aRealq [Invoices]Stock Breakdown’UnitQ
    aReals [Invoices]Stock Breakdown’Org_Lamount
    aRealu [Invoices]Stock Breakdown’Org_Ltax
    aRealv [Invoices]Stock Breakdown’Org_Ltotal
    aRealw [Invoices]Stock Breakdown’Org_Lrate
    aRealx [Invoices]Stock Breakdown’Org_LnewRate
    alongd [Invoices]Stock Breakdown’Record Order
    s_fxtax [Invoices]Stock Breakdown’Org_Ltax (in [Invoices]FX_Format)
    s_fxTotal [Invoices]Stock Breakdown’Org_Ltotal (in [Invoices]FX_Format)
    s_fxAmount [Invoices]Stock Breakdown’Org_Lamount (in [Invoices]FX_Format)
    s_fxrate [Invoices]Stock Breakdown’Org_Lrate (in [Invoices]FX_Format)
    ATEMPJ [Invoices]Stock Breakdown     Line Rate per item, OVI
    ATEMPK [Invoices]Stock Breakdown     Line Amount number of items, OVI
    ATEMPL [Invoices]Stock Breakdown     Line Tax for the line, OVI
    ATEMPM [Invoices]Stock Breakdown     Line Total including Tax for the line, OVI
    atextq SSCC No in a company inquiry. The SSCC number in the shipping page of an invoice
     

    Texim field variables

    It is recommended to avoid using numbers that have already been assigned for texim variables in SapphireOne to prevent conflicts with existing reports. Numbers between 120 and 200 are generally safe to use if they have not been used before.

    Texim variables are useful for setting up reports that can be used with multiple types of transactions by allowing for different text to be displayed depending on the transaction type. For instance, reports for OCI and SCI transactions may have similar content but require different text labels, which can be achieved through the use of texim variables.

    Some commonly used texim numbers are texim110 to texim113 for balances and a few others are listed in tables below.

    Variables used in the Header/Footer Area

    This preload command must be entered first and may vary according to the table accessed.  I for Invoice and C for Clients. There would be others V for Vendor for example ?? SR_PreLoad(“I”) SR_PreLoad(“C”)
    ?????? SR_packingInventory:=False
    Enter the maximum N⁰ of characters. This then forces word wrap for the entire report at the N°, numbr entered. 70 in the example to the right. SR_MAXLENGTH:=70   
    This script converts an Invoice to Table layout styles. TablePrintA(1)
    This will enter the current date from the computers clock. srdate
    This will enter in the current page number in the Custom report. srdate
    This will enter in the total number of pages in the Custom Report. srdates

    Commonly used variables with shortcuts

    With the new Sapphire Custom Reports, users have the ability to select any cell from any table in the data file when creating a custom report. This eliminates the need for manually writing scripts to link variables and fields, making the report creation process much simpler and more efficient. Additionally, the list of available fields to select from is extensive, providing users with a wide range of options to choose from when designing their custom reports. Of note is the six in the table below.

    Tbal10 in AUD or local [Invoices]Amount Texim300 FX currency [Invoices]Org_Amount
    Tbal11 in AUD or local [Invoices]Tax Texim301 FX Currency [Invoices]Org_Tax
    Tbal12 in AUD or local [Invoices]Total Texim302 FX currency [Invoices]Org_Total

    tbal10 [Invoices]Amount Variable usually the Amount Without Tax
    tBal11 [Invoices]Tax Variable usually the Tax only, in Australia the GST
    tBal12 [Invoices]Total  Variable usually the  Amount plus Tax Included
    Texim100 Company Address, ABN etc Variable
    Texim102 Transaction Type in Word Format Variable
       
    Texim300 [Invoices]Org_Amount In FX Format
    Texim301 [Invoices]Org_Tax In FX Format
    Texim302 [Invoices]Org_Total In FX Format
    texim143  
    tdiscmess Prompt Payment Discount Message
       
    Clients Mail Address [Invoices] Mailing Address
    Clients Del Address [Invoices] Delivery_Address
    Clients ID [Invoices] Client _LK
    Delivery Date [Invoices] Delivery_Date
    Customer Order No [Invoices] External_Ref
    Date Due [Invoices] Date_Due
    Invoice No [Invoices] Internal_Ref
    Text Details [Invoices] Text    Text Details on the More Detail Page

    Other Values.

    Texim102 Stores the paper type.
    Texim140 Loads the mailing details from System Defaults for SapphireOne. Company Inquiry
    Texim141 Loads the Tax File number from System Defaults. Company Inquiry
    tdiscmess Stores the prompt discount message. Company Inquiry Reports Page

    Statements

    Arrays Used in the Body Section

    aTexta Transaction Type in word format
    atextn [Transactions]Internal Ref
    atextm [Transactions]External Ref
    aTextb [Transactions]Internal Ref
    adate [Transactions]Date In
    aReala Running Total
    aRealb [Transactions]Allocated Amt
    aRealc [Transactions]Total
    aReald Amount still unallocated
    aRealf aReald if greater than 0
    aTextc “*” (overdue)

    Other Values

    tCLPerDate Statement Date
    tlTotal Running Total
    tBal10 Overdue Balance based upon due date.
    tbalancea Current amount Owing
    tbalanceb 30 days Owing
    tbalancec 32-60 days owing
    Tbalanced 61+ days owing

    Cheque & Remittance

    Remember that remittances cannot be test printed directly from utilities mode as the linking from the VP to the invoice or VI is not established. An existing remittance will have to be re-printed from accounts mode. To do this select the payment’s option from the Payables drop down menu in Accounts mode.

    The user will only be able to create the report with no lines displayed in utilities mode.
    To test fully, the user will have to go back to the payments function and select the new report from there to display the actual lines in the transaction.

    atemp “*” fully paid
    adate [Transactions]Date in
    ainvoice [Transactions]Internal Ref
    aext [Transactions]External ref
    adesc [Transactions]Notes
    atotal [Transactions]Total
    tatotal Credit Memo Value excluding Discounts, but including PPS Tax
    taamount Discount Value
    tatax Payment value
    areale PPS Value
    Calcmoneywords ??? In addition to the 2 below there are other versions of this function.
    Calcmoneywords Converts numerals in dollars followed by the word Dollars Then the cent numerals in words as well followed by the word Cents. Four Thousand Four hundred twenty dollars ten five cents.
    CalcmoneywordsNumcent As above but the numerals in cents remain as numerals. Four Thousand Four hundred twenty dollars 15 cents.
    tStart1 Cheque number as it can be different to the internal reference number. There is an option to enter the check numbers manually so thats why.

    Start Scripts – General details

    These scripts have been copied from various Sapphire Reports and will be provided at the end of this article. They were taken from reports that use scripts of various types.

    The most challenging part of creating a Sapphire Report is determining the layout and the components that will make up that layout. Even though the reports may have different appearances, the underlying structure and the cells that will be printed in the report are largely the same.

    Invoices, for example, have a start script that manages the loading of the arrays and other functions. The command to preload the arrays for Invoices is SR_PreLoad(“I”), where “I” stands for Invoices. Similarly, the command to preload the arrays for Statements is SR_PreLoad(“C”), where “C” stands for Clients.

    By calling the SR_Roll_Up function in the start script after SR_Preload, the lines for items with the same description and rate (discounted) are collapsed. This enables multiple lines for the same product to be entered, but for different projects to be displayed as one line.

    TablePrintA(1) in the start script converts an Invoice to Table layout styles.

    Some start scripts have been copied from existing Sapphire Custom Reports, and they are included in this folder. The user will notice that there are similarities between them, as all of the reports follow a common format.

    Sales Invoice-1

    SR_PreLoad("I")
    texim143:=[Invoices]Footer
    tBal10:=[Invoices]Amount
    tBal11:=[Invoices]Tax
    tBal12:=[Invoices]Total
    tBal20:=0
    tBal30:=0
    array text(ATEMPA;size of array(ATemp1A25))
    array text(ATEMPB;size of array(ATemp1A25))
    array text(ATEMPC;size of array(ATemp1A25))
    array text(ATEMPD;size of array(ATemp1A25))
    array text(ATEMPE;size of array(ATemp1A25))
    array text(ATEMPF;size of array(ATemp1A25))
    array text(ATEMPG;size of array(ATemp1A25))
    array text(ATEMPH;size of array(ATemp1A25))
    array text(ATEMPI;size of array(ATemp1A25))
    array text(ATEMPJ;size of array(ATemp1A25))
    array text(ATEMPK;size of array(ATemp1A25))
    array text(ATEMPL;size of array(ATemp1A25))
    array text(ATEMPM;size of array(ATemp1A25))
    array text(ATEMPN;size of array(ATemp1A25))
    array real(arealac;size of array(ATemp1A25))
    array real(arealae;size of array(ATemp1A25))
    array real(arealad;size of array(ATemp1A25))
    array real(arealaf;size of array(ATemp1A25))
    array real(arealag;size of array(ATemp1A25))
    array real(arealah;size of array(ATemp1A25))
    array real(arealai;size of array(ATemp1A25))
    array real(arealaj;size of array(ATemp1A25))
    for(i;1;size of array(ATemp1A25))
    query([inventory];[inventory]id=ATemp1A25{i})
    if(records in selection([inventory])=1)
    ATEMPA{i}:=[inventory]UDF1
    ATEMPB{i}:=[inventory]Alpha_3_20
    ATEMPC{i}:=string([inventory]real_6)
    ATEMPD{i}:=string([inventory]real_1)
    Page 30 Sapphire Tools
    Page 30 © SapphireOne Pty Ltd 2021
    arealac{i}:=[inventory]real_2areala{i} ATEMPE{i}:=string(arealac{i};"###,###.## KG;(###,###.## KG)") arealad{i}:=[inventory]real_8areala{i}
    ATEMPF{i}:=string(arealad{i})
    ATEMPG{i}:=[inventory]UDF2
    ATEMPH{i}:=string([inventory]real_2;"###,###.## KG;(###,###.## KG)")
    arealae{i}:=arealb{i}/[inventory]real_2
    ATEMPI{i}:=string(arealae{i};"$###,##0.00;($###,##0.00)")
    arealaf{i}:=arealb{i}1 ATEMPJ{i}:=string(arealaf{i};"$###,##0.00;($###,##0.00)") arealag{i}:=areale{i}1
    ATEMPK{i}:=string(arealag{i};"$###,##0.00;($###,##0.00)")
    arealah{i}:=arealf{i}1 ATEMPL{i}:=string(arealah{i};"$###,##0.00;($###,##0.00)") arealai{i}:=arealg{i}1
    ATEMPM{i}:=string(arealai{i};"$###,##0.00;($###,##0.00)")
    arealaj{i}:=areald{i}*1
    ATEMPN{i}:=string(arealaj{i};"###.##%;(###.##%)")
    tBal20:=tBal20+arealac{i}
    tBal30:=tBal30+arealad{i}
    else
    ATEMPA{i}:=""
    ATEMPB{i}:=""
    ATEMPC{i}:=""
    ATEMPD{i}:=""
    ATEMPE{i}:=""
    ATEMPF{i}:=""
    ATEMPG{i}:=""
    ATEMPH{i}:=""
    ATEMPI{i}:=""
    ATEMPJ{i}:=""
    ATEMPK{i}:=""
    ATEMPL{i}:=""
    ATEMPM{i}:=""
    ATEMPN{i}:=""
    end if
    end for
    i:=0

    Packing Slip-1

    SR_PreLoad("I")
    texim143:=[Invoices]Footer
    tBal10:=[Invoices]Amount
    tBal11:=[Invoices]Tax
    tBal12:=[Invoices]Total
    tBal20:=0
    tBal30:=0
    array text(ATEMPA;size of array(ATemp1A25))
    array text(ATEMPB;size of array(ATemp1A25))
    array text(ATEMPC;size of array(ATemp1A25))
    array text(ATEMPD;size of array(ATemp1A25))
    array text(ATEMPE;size of array(ATemp1A25))
    array text(ATEMPF;size of array(ATemp1A25))
    array text(ATEMPG;size of array(ATemp1A25))
    array text(ATEMPH;size of array(ATemp1A25))
    array text(ATEMPI;size of array(ATemp1A25))
    array text(ATEMPJ;size of array(ATemp1A25))
    array text(ATEMPK;size of array(ATemp1A25))
    array text(ATEMPL;size of array(ATemp1A25))
    array text(ATEMPM;size of array(ATemp1A25))
    array real(arealac;size of array(ATemp1A25))
    array real(arealae;size of array(ATemp1A25))
    array real(arealad;size of array(ATemp1A25))
    array real(arealaf;size of array(ATemp1A25))
    array real(arealag;size of array(ATemp1A25))
    array real(arealah;size of array(ATemp1A25))
    array real(arealai;size of array(ATemp1A25))
    for(i;1;size of array(ATemp1A25))
    query([inventory];[inventory]id=ATemp1A25{i})
    if(records in selection([inventory])=1)
    ATEMPA{i}:=[inventory]Alpha_8_80
    ATEMPB{i}:=[inventory]Alpha_3_20
    ATEMPC{i}:=string([inventory]real_6)
    ATEMPD{i}:=string([inventory]real_1)
    arealac{i}:=[inventory]real_2areala{i} ATEMPE{i}:=string(arealac{i}) Page 32 Sapphire Tools Page 32 © SapphireOne Pty Ltd 2021 arealad{i}:=[inventory]real_8areala{i}
    ATEMPF{i}:=string(arealad{i})
    ATEMPG{i}:=[inventory]UDF2
    ATEMPH{i}:=string([inventory]real_2)
    arealae{i}:=arealb{i}/[inventory]real_2
    ATEMPI{i}:=string(arealae{i})
    arealaf{i}:=arealb{i}1 ATEMPJ{i}:=string(arealaf{i}) arealag{i}:=areale{i}1
    ATEMPK{i}:=string(arealag{i})
    arealah{i}:=arealf{i}1 ATEMPL{i}:=string(arealah{i}) arealai{i}:=arealg{i}1
    ATEMPM{i}:=string(arealai{i})
    tBal20:=tBal20+arealac{i}
    tBal30:=tBal30+arealad{i}
    else
    ATEMPA{i}:=""
    ATEMPB{i}:=""
    ATEMPC{i}:=""
    ATEMPD{i}:=""
    arealac{i}:=0
    arealad{i}:=0
    ATEMPG{i}:=""
    ATEMPH{i}:=""
    ATEMPI{i}:=""
    ATEMPJ{i}:=""
    arealag{i}:=0
    ATEMPL{i}:=""
    ATEMPM{i}:=""
    end if
    end for
    i:=0

    Statement-1

    SR_PreLoad("C")
    texim130:=[Clients]Name
    texim131:=[Clients]Address1
    texim132:=[Clients]Address2
    texim133:=[Clients]City
    texim134:=[Clients]State
    texim135:=[Clients]Zip_Code
    texim138:=[Clients]ID
    texim139:=[Clients]Contact1
    texim137:=[Clients]UDF1
    Tltotal:=[Clients]Total_Due
    tBal10:=[Clients]Balance1
    tBal35:=[Clients]Balance2
    tBal36:=[Clients]Balance3
    tBal37:=([Clients]Balance4+[Clients]Balance5+[Clients]Overdue)

    Invoice-1

    SR_packingInventory:=False
    SR_MAXLENGTH:=70 Note this sets the number of characters in all fields before forcing wordwrap
    SR_Preload ("I")
    texim143:=[Invoices]Footer
    tbal10:=[Invoices]Amount
    tbal11:=[Invoices]Tax
    tbal12:=[Invoices]Total
    tbal13:=[Invoices]Payment_V
    tbal14:=[Invoices]Total-[Invoices]Payment_V
    QUERY([Contacts];[Contacts]CN_ID=[Invoices]Contact_lk)
    RELATE ONE([Invoices]Client_LK)
    QUERY([Department];[Department]ID_Code=[Clients]Department_LK)
    tbal13:=[Invoices]Card_V+[Invoices]Cheq_V+[Invoices]Cash_V+[Invoices]Account_V
    tbal14:=Round(tbal12-tbal13;2)
    Case of
    : ([Invoices]Type="SCC")
    texim200:="CREDIT"
    texim201:="Credit No."
    : ([Invoices]Type="JCC")
    texim200:="CREDIT"
    texim201:="Credit No."
    : ([Invoices]Type="OCI")
    texim200:="ORDER"
    texim201:="Order No."
    Else
    texim200:="TAX INVOICE

    Statement

    SR_Preload ("C")
    texim130:=[Clients]Name
    texim131:=[Clients]Address1
    texim132:=[Clients]Address2
    texim133:=[Clients]City
    texim134:=[Clients]State
    texim135:=[Clients]Zip_Code
    texim138:=[Clients]ID
    texim139:=[Clients]Contact1
    texim137:=[Clients]UDF1
    tbal99:=tbalanceb+tbalancec+tbalanced
    Case of
    : ([Clients]Payment_Terms=1)
    texim105:="7 days"
    : ([Clients]Payment_Terms=2)
    texim105:="14 days"
    : ([Clients]Payment_Terms=3)
    texim105:="21 days"
    : ([Clients]Payment_Terms=4)
    texim105:="Cash on Delivery"
    : ([Clients]Payment_Terms=5)
    texim105:="20th Month following"
    Else
    texim105:=String([Clients]Due_Days)+" days"
    End case
    ARRAY REAL(arealz;0)
    While (Not(End selection([Transactions])))
    APPEND TO ARRAY(arealz;[Transactions]Total-[Transactions]Allocated_Amt)
    NEXT RECORD([Transactions])
    End while
    FIRST RECORD([Transactions])

    You can review our Blog and YouTube channel for additional information and resources on SapphireOne ERP, CRM and Business Accounting software.

    Was this helpful?

    Previous Article

    4D View Pro