This article is aimed at advanced users and developers.
If there has been any code change to the XtraReports Invoice, Quotation or Request PO templates (eg. New Field introduced, scripts changed) then the process to roll out to the saved standard templates is as follows:-
1. In Visual Studio, make the required changes to the document templates reports and test.
2. If you have made changes to the scripts, view the script and save into the Standard Folder\Scripts and XSD\?????Template_Script.txt file for use when updating the templates at each client installation.
3. If you have made changes to the dataset (XSD), update the DataSourceSchema definition on the report
Once you've made the changes to the XSD, update the DataSourceSchema. Click on the ellipsis on the DataSourceSchema and in the next box, check the Use Visual Studio Data Class and selected Insight.dsInvoiceMasterDetail.
HINT: As the InvoiceMasterDetail Database is complicated, it's easier to manually edit the fields as shown below
4. Save the XML Schema. Click into the DataSourceSchema Field and select all the contents and save to the Standard Folder\Templates\Scripts and XSD\dsInvoiceMasterDetail_Schema.xml file
To Update each Client Installation with new Template changes
1. Publish the New Scripts & XSD folder with a new update of Insight
2. Edit the Template and update the Script and Schema using the published Standard Folder\Scripts and XSD files
3. Make any client specific changes to the templates to use the new scripts / fields
Other Important Notes
Invoice, Quotation and Request for PO
The Quotation and Request for PO templates (xrpTemplate_Quotation & xrpTemplate_RequestPO) are an exact copy of xrpTemplate_Invoice - Any changes here must be made to xrpTemplate_Quotation , xrpTemplate_RequestPO and xrpTemplate_Invoice
Fields that are ALWAYS required: (as they are referenced in the scripts)
In the Header: (and in that order) - MUST be to Visible. If not required to be printed, set to size to 0
Invoice Number (lblInvoiceNumber)
Client ID (lblClientID)
NB: Fields in tables are printed at end end, so ensure that both the Invoice Number and the Client ID are both in the same table or both not in a table
In the Detail:
Invoice Date (lblLineDate)
In the group footer (SectionFooter)
Sum of NET - Sub Total (lblSubTotal)
Sum of VAT - VAT (lblTotalVAT)
Sum of Gross - Total (lblTotal)
Total Paid - lblTotalPaid - Can be set to Invisible if not needed
Total Paid - lblTotalOustanding - Can be set to Invisible if not needed
There must always be a Page Break at the end of the group footer (SectionFooter or PaymentFooter) as this is required to split the bulk invoices generated.
Payments and Outstanding Amount
The field lblTotalOustanding is available that contains that balance to pay. This should be added to the Invoice after the TOTAL Paid (lblTotalPaid) field.
If you re-create the dataset dsPurchaseOrderMasterDetail don't forget to manually add the WHERE filter for @ID (also make sure that the relation name is "Detail")
On the vwPurchaseOrderHeaderTableAdapter
SELECT PurchaseOrderNumber, OurReference, ..... ApproverFax FROM dbo.vwPurchaseOrderHeader WHERE PurchaseOrderNumber = @ID
and on vwPurchaseOrderDetailTableAdapter
SELECT HeaderID, OurProductCode, BarcodeNumber, AlternativeID FROM dbo.vwPurchaseOrderDetail WHERE HeaderID = @ID
Editing Report Templates using the End User Report Designer (EUD)
You should only edit the same type of document templates (eg. Invoices, Quotations, Purchase Orders) in one 'session'. If you want to edit more than one type, then please close the report designer and open again.
If you try and open a different type of report to the one you currently have open, you'll get the following message.
Please click No and close the report designer. Now open again and select the different type of report/template to edit.
In the Report designer the DataAdapter setting should set to (None) on the Smart Tag for the report as well as each detail section. This will ensure that the data isn't automatically populated when the report class is instantiated. You can manually fill the DataAdapter in the BeforePrint method of the report. Eg.