How to Resolve "Cannot Pass More Than 100 Arguments to a Function" Error in Bold Reports with PostgreSQL
When using Bold Reports with PostgreSQL as the data source, you may encounter an issue when trying to send over a hundred parameter values for dataset filtering. This problem appears in the report viewer with the error message: cannot pass more than 100 arguments to a function, as shown in the provided screenshot.
To avoid this error, concatenate the parameter values into a single string and then split them in the query. Follow the steps below to resolve the issue:
-
Identify the parameter causing the error in your Bold Reports query designer.
-
Modify the parameter value using an expression to concatenate the parameter values into a comma-separated string, you can use the following expression:
Expression: =Join(Parameters!ID.Value, “,”)
-
Modify the query in the Query Designer using the unnest function as shown in the code snippet below:
SELECT "public"."example"."id", "public"."example"."name", "public"."example"."age" FROM "public"."example" WHERE "public"."example"."id" IN ( SELECT unnest(STRING_TO_ARRAY(@ID,',')::int[]) )
-
Save the changes made in the Query Designer and parameter values, then re-run the report to ensure that the issue has been successfully resolved.