|
<< Click to Display Table of Contents >> Navigation: Xpert-Timer Manual > Printing reports > Customize invoice template |
With this report, you can influence all areas of the printout. Be careful not to change the SQL commands, as this may cause your template to no longer work. To be on the safe side, make a backup copy of the working template before making any changes.
It is best to create three invoice items for testing purposes when designing the template. Save the invoice and then click on "Edit template." This will give you data in your template and allow you to test the appearance much better.

If you change column information, make sure that all 3 lines are changed accordingly so that the data is still displayed correctly.
The data itself, i.e., the SQL commands and data bands, should be left as they are. If you delete a field, e.g., sqlinvoice."discountpercentage" (discount), you will receive an error message because this field is still referenced in the "Code" tab. It is better to set the fields you do not need to "Visible" -> False. This will prevent this area from being displayed. Remember to set the corresponding area to "Visible" -> False in all three rows so that the layout is correct when the invoice is printed.
|
Note |
|---|---|
The fields will still be displayed in the FastReport preview. When you view the preview from the Xpert-Timer invoice dialog, the fields will be hidden as expected. |
|

You can change the labels by double-clicking on them.
Press F9 to display the preview and make any further adjustments.
If you change data, you may receive an error message like this:

This means that you have deleted a field in the template that can no longer be accessed in the "code." Therefore, comment out the corresponding program line.

Press F9 again and comment out until you see your preview again.
You can now insert line breaks with the /n command using the XTParseLinefeeds function. To do this, specify the function here:

In the invoice text, you must then specify /n at the appropriate place to obtain the line break. /r or <br> also works for line breaks.

In the invoice dialog, you can use user-defined fields to include in your invoice. You can find these in the "invoices" table. The columns are named accordingly: userdefined1 to userdefinded10:

To integrate these fields into your invoice template:
- Switch to the "Data" tab. There you will find the SQL query "sqlInvoice". Simply click on this query box to get the properties of the box. If you now click on the "FieldAliases" field in the properties, you should see the userdefined fields. If not, click on "Refresh". Only when your user-defined fields are listed here will they be available in the report.

In the next step, insert a text field in the "Page 1" tab by clicking on the text field marker. Then click again on the place in your report where you want to display the user-defined field. Double-click the field so that you can enter data and enter [sqlInvoice."userdefined1"]. You can do this with all fields from 1 to 9. Press F9 to check your changes.

You can also make the text field two lines long. Double-click in your text field again and adjust it accordingly:

Now the display looks much better:

Every time you click on an object in the template, you will see the properties for that object on the left-hand side. You can also customize these accordingly.

The data itself, i.e., the SQL commands and data bands, should be left as they are. If you delete a field, e.g., sqlinvoice."discountpercentage" (discount), you will receive an error message because this field is still referenced in the "Code" tab. It is better to set the fields you do not need to "Visible" -> False. This will hide this area. Remember to set the corresponding area to "Visible" -> False in all three lines so that the layout is correct when printing the invoice.

Save the template as XTINVOICE_* so that it appears in your invoice templates.