- Print
- PDF
Best Practices for Lasernet FO Connector
This article highlights the best practices for the following Lasernet FO Connector features:
Replacement reports
Tables/Fields
Subreports
Group by/calculations
Size of the XML file
Replacement Reports
Use a replacement report instead of an SSRS report. The replacement report often provides better performance and offers the features of the Query wizard.
Follow these steps:
On the Replacement report page, click CREATE NEW to name the replacement report.
Info
The prefix of the report name should be the same as the SSRS report name. This way, they will be close to each other in the report list and easily identifiable.
A new Query report is created (the setup from the SSRS such as Form links and Archive is all copied). On the SSRS report, you can see it is replaced by your replacement report. You can now forward your work with the replacement/query report.
Select Data sources and delete all the tables you wish to delete. Use Query wizard to add necessary tables.
Tables/Fields
Add tables and fields within the Query wizard and avoid using Data sources to add tables.
Avoid adding fields using the Structure option. Your manually created fields are displayed in yellow; delete these and add them again by using the Query wizard.
Subreports
Instead of using a subreport, create a new Query using the Query wizard.
Note
This is only possible starting from Lasernet FO Connector 6.1.
Example - How to Add Table=CompanyInfo
Open the Query wizard, then click Next, and then Next again.
Place your cursor on the table where you want to add a new Query and click the + button.
Give the Query a name, add Table=CompanyInfo and set up/check relations.
Add fields as normal, and the result will appear:
Group By
Note
This is only possible starting from Lasernet FO Connector 6.1.
Consider whether this feature will help reduce the size of the XML file and perform the calculations from the Lasernet Connector.
Navigate to Tables in the Query wizard and add a new Query.
Set the property Group by to Yes.
Add the table you want to group by.
Add the fields you want to group by.
This will provide one record per Itemid and DatePhysical.
Result:
Calculations
Note
This is only possible starting from Lasernet FO Connector 6.1.
It is also possible to calculate your fields. Navigate to the Selected fields section in the Query wizard and add the field you wish to calculate. You can set up your calculation within the PROPERTIES section.
It is also possible to write Direct SQL by choosing Custom in the property Group by function: SELECT SUM(SalesLine.QtyOrdered) FROM SalesLine WHERE SalesLine.ItemId=InventTable.itemId
Result:
The sum is for all legal entities/companies.
To obtain the sum by legal entities/companies, follow these steps:
Add Field=DataAreaId to your table using the right arrow button.
The following dialog will be displayed. Click Yes.
Change your Direct SQL to include DataAreaId in your WHERE clause: SELECT SUM(salesLine.QtyOrdered) FROM SalesLine WHERE SalesLine.ItemId=InventTable.itemId AND SalesLine.DataAreaId=InventTable.DataAreaId
Result:
Size of the XML File
The smaller the XML/Grab file is, the better the performance will be. Try as much as possible to set up your structure and calculations in the Lasernet Connector. Follow these steps as a guide:
Delete unused Tables and Fields in the Query wizard.
Test your report with real and sufficient data.
Check your table relations to ensure that you do not get unnecessary data/structures.
Use the Lasernet Connector to group and calculate data; it is often faster than, for example, using an XML transformer in Lasernet Developer.