The process to add the Company dataset and to add the references data fields from the tables to the report, is basically as follows:

1.Add the COMANYDATA Dataset 

2.Add the SQL for the Company information to be available in the dataset. 

3.Add or drag the fields (columns) from the COMPANY Dataset onto the report.

4.Add labels describing data fields (Expressions) on the report.

In this topic of the documentation, the Static text - is dealt with to add plain text labels.

You may add Expressions which is translatable labels to reference the language id. This will use the language files to translate the labels the languages are changed (Switch language on the Start ribbon).  

5.Tidy the report - Format expressions and labels, insert a horizontal lines, etc. 

Add COMANYDATA Dataset

The company data SQL consists of two (2) tables (i.e. SYSVARS and SYSVARSEXT) tables in the Database. 

To write SQL is actually very simple, for example, “select data from table”,  where data is a valid field name (e.g. ScompanyName Company name) in the table and table is a valid table name (e.g. Sysvars). To call the company name and Fax number (as entered in the Company info (Setup ribbon) (it is stored in the sysvars table)), you may simply write select SCompanyName CompanyName, SFaxNumber Fax from Sysvars.  

To add the Company Dataset:

1.On the "Report man" screen, select a report. In this example, the "Copy of New.rep" is selected. 

2.On the "Report manager designer" screen for the selected report, click on the Database connections and datasets icon.

3.On the click on the "Database connections and datasets" screen, select Datasets tab and click on the Add icon.

reportman-company-dataset-add

4.On the "New dataset" screen, Enter "COMAPNTDATA" as the Alias Name and click Ok

The next step is to add the SQL for the data in the SYSVARS and the SYSVARSEXT tables. 


ADD COMPANYDATA SQL

The next step is to add the SQL for the data in the SYSVARS and the SYSVARSEXT tables. The data as stored in these two tables is mainly added in the Company info (Setup ribbon) and the Reporting groups names as set in the Groups (Setup ribbon). 

To add SQL for the Company Dataset:

1.On the click on the "Database connections and datasets" screen, select Datasets tab and select the "COMPANYDATA" dataset. 

2.The "COMPANYDATA" dataset is empty at this stage.

reportman-company-dataset-add-sql

3.To add the tables, copy or enter the following SQL in the SQL box:

Select a.*, SCompanyName  ,
SCompanyRegNo ,
SEmailAddress ,
SAddress1 ,
SAddress2 ,
SAddress3 ,
SPostCode ,
SPhoneNumber ,
SFaxNumber ,
STaxRegNo ,
BLOBLOGO,
SAccountReportName1 ,
SAccountReportName2 ,
SDebtorReportName1 ,
SDebtorReportName2 ,
SCreditorReportName1 ,
SCreditorReportName2 ,
SStockReportName1 ,
SStockReportName2 ,
SBANKNAME1, 
SBANKNAME2, 
SBANKNUMBER2, 
SBANKNUMBER1, 
SBANKSWIFT1, 
SBANKIBAN1, 
SBANKSWIFT2,
SBANKIBAN2,
SBANKACCOUNTNAME1,
SBANKACCOUNTNAME2,
SBANKBIC1,
SBANKBIC2
from Sysvars
, sysvarsext a

4.Click on the Show data button. The data should be displayed correctly.

reportman-companydata-dataset-show-data

5.Close the "Data" screen. 

6.Click OK on the "Database connections and datasets" screen.

The next step is to add or drag the data from the SYSVARS and the SYSVARSEXT tables onto the report (Page header as in this example. 

7.If you close the "Report manager designer" screen, remember to Save the report. 

Whenever you close the "Report manager designer" screen, after editing your report, remember save the report. If you click on No, on the "Save report?" confirmation message, your changes will be discarded (lost).


Add Expressions (fields from tables)

Once you have added the Company data dataset, the tables of the SYSVARS and SYSVARSEXT will be available. 

To print the data from these tables, you need to drag these to the Page header. 

To add Expressions from the COMPANYDATA Dataset to the Page header:

1.Click on the Data tab and select the COMPANYDATA Dataset. 

2.Click on the "Detail" section of the report structure and drag it downwards to add space for the Page header. 

reportman-company-dataset-resize-page-header

3.Select and drag (drag and drop) the data Expressions you wish to display (print) on the Page header section of the report.

reportman-company-dataset-add-data-to-header

When selecting the String Data type the default number of characters (including spaces and Special characters (e.g. the Ampersand & , The Underscore _ , etc. will be counted for a character). This is the field length and the size is indicated with a numeric value in brackets (e.g. (30), etc.). This will by default determine the width of the field when data is dragged and dropped on the section of the report. 

4.Drag all the fields from the Company dataset, you need to print on the Report header.  

5.Once all required data expressions is added, you may click on the Print preview icon. 

reportman-company-dataset-test-data-to-header

On the report there are a lot of different numbers displayed (e.g. Telephone and Fax number as well as the Company registration number). 

This may be confusing to the end-user of the report. You may need to add some labels to explain what these numbers mean.

6.Take note of the labels you wish to add to describe the data on the printed report, where necessary.

7.Close the "Print preview" screen.

The next step is to add labels, describing the data, to print on the report where necessary.

Add labels to the report

The labels will add a description to the fields (data) printed in the Page header. 

There are 2 methods of adding labels to a report:

Static text - Add plain text labels.

Expressions - Add translatable expression labels to reference the language id. This will use the language files to translate the labels the languages are changed (Switch language on the Start ribbon).  

Add COMPANYDATA Static text labels

All reports and most of the document layout files is translatable via the language files. 

The static text labels is used in the following layout files:

Invoice test (TRN_906190)

Invoice English (15 code) (TRN_906191)

To add static labels to the report:

1.Move and drag the data fields to create some space for the text labels.

2.Select the Text icon to insert static text. 

3.Click and drag it to the required size and space on the report (e.g. Page header).

reportman-companydata-dataset-add-labels

4.On the Label tab, enter the Text you need to display for the field (e.g. Telephone).

5.Repeat the process for all labels. 

6.Click on the Print preview icon to view if the labels do not overlap, etc. 

reportman-companydata-dataset-preview-labels

7.Take note of the layout and presentation on the "Print preview" screen.

8.Close the "Print preview" screen and do the necessary changes, if required.


Format text

You may wish to set the Text properties (e.g. Font, font size, bold, italic, etc.) for specific expressions (fields).

On the Text tab, you may set the alignment, fonts, etc. You may click on the "WFont Name" or "Font Style" field to set the font properties.

reportman-companydata-dataset-format-labels

Insert a Simple drawing Horizontal line

To insert a Simple drawing (horizontal line), select the Simple drawing icon.

On the the required section, click and draw the length of the shape. By default rectangle shape will be inserted.  

On the Shape field, select Horizontal line. 

reportman-companydata-dataset-add-line


Tidy the Page header - You may need to stretch and move the expressions and labels around, until you are happy with the layout. 

You may click on the Print preview icon and save your report in the available output formats (select Save (Ctrl+S) - “Save Metafile As” screen). You may open the saved report in your systems default associated program (app) to check how the report will be displayed in the selected file format. For example, if you wish to use the report in a the Html format to display in web browsers, some expressions and labels may not be displayed correctly. You then may need to move or stretch the objects (labels, expressions). 

Whenever you close the "Report manager designer" screen, after editing your report, remember save the report. If you click on No, on the "Save report?" confirmation message, your changes will be discarded (lost).