When running a report, users will sometimes get the following error message:
'Query filter cannot be specified on a query that are split into multiple queries dues to 1:n fetch mode.'
This error message is also shown in Lasernet Connector version 6 when configuring the Query. (Within the Query-wizard > Dialog-setup > Default ranges in the Form Links).
It is similar to the error message '1:N Fetch Mode is not allowed on Datasource having join condition with node other than its immediate parent.'
The error is caused when adding a Filter Query-Wizard, Dialog-setup and/or the Default ranges. The issue only exists if the Query contains two or more data-source-structures having at least one of the Fetch Mode/Fetch set to 1:N (One2Many).
The following is an example containing two data-source-structures:
A. Containing the datasources/tables CustTable and SalesTable
B. Containing the datasources/tables CustTable, DlvTerm and LanguageTxt
Data-source structure A is containing the tables CustTable and SalesTable:
Data-source structure B are containing the tables CustTable, DlvTerm and LanguageTxt:
Adding a Filter in Lasernet FO Connector version 6 would display the following error message:
'Query filter cannot be specified on a query that is split into multiple queries dues to 1:n fetch mode.'
A similar error is shown in Lasernet FO Connector version 5 when running the report.
There are three ways to resolve the issue, as follows:
Change the query-structure
Restructure the Query-structure as it should be possible to have all the required data sources within the same data-source structure like the following:
Having all data sources in the same structure wouldn't throw the error when using 1:N in the Fetch Mode/Mode.
This approach also avoids the issue in relation to the row size when having a lot of data sources/tables (issue caused by 1:1).
Change 1:N to 1:1
Change 1:N to 1:1 in the Fetch Mode/Fetch, but this could cause the following error if many tables are joined together.
'[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot create a row of size 8061 which is greater than the allowable maximum row size of 8060.'
This error is only displayed if the query contains a lot of data sources/tables and why Fetch Mode/Fetch 1:1 works in most cases.
Add a Range instead of a Filter (LAC365FO version 6)
Lasernet FO Connector version 6 contains the option to add a Range instead of Filter by clearing the Filter checkbox in the Ranges in the Dialog-setup, Ranges in the Form-links and/or in the ranges in the Query-Wizard.
Clearing the Filter checkbox will fix the issue and makes it possible to have multiple-query structures with 1:N in the Fetch Mode/Fetch.