I think that the SQL command should be in the report template, and not dynamically, unless it is used only to create the report file.
i use this:
FReport.SetParameterValue("SQL_rysys", ConnectionString); if (FReport.Dictionary.Connections.Count > 0) { FReport.Dictionary.Connections[0].ConnectionString = ConnectionString; FReport.Dictionary.Connections[0].ConnectionStringExpression = "[SQL_rysys]"; FReport.Dictionary.Connections[0].CommandTimeout = 60; }
This code assigns a value to the parameter "SQL_rysys" (SQL_connection in English), I pass the SQL connection string. Also, if there are any connections in the data dictionary, I assign the connection string to the first.
This way, my reports always get the correct connection string, but the SQL query is already included in the report. The reason is that there is no other way to create a report in the designer without using a query to retrieve data, and this query is saved in the XML report file (frx).
I asked fastreport support how to assign a request, but their AWFUL and noobs support work there.
source share