Para conectarse a una base de datos Firebird, en el diseñador FastReport.Net hay un complemento conector.
Tiene que precompilar el proyecto:
С:\Program Files (x86)\FastReports\FastReport.Net\Extras\Connections\FastReport.Firebird
Luego, tiene que conectar el complemento en el diseñador de informe en el menú <File → Options>:
Después, hay que reiniciar el diseñador de informes.
Antes de crear una fuente de datos en el informe, asegúrese de que su servidor FireBird está configurado apropiadamente. Es que FireBird 3 a la hora de concectarse a una base de datos con la biblioteca FireBirdSql.Data.FirebirdClient (que se utiliza en el complemento) es muy probable que verá el error "connection rejected by remote interface". Tiene que activar cifrado de cable y el tipo de autentificación Legacy.
Para ello, abra el archivo de configuración firebird.conf. Descomente y cambie la línea:
AuthServer = Srp, Legacy_Auth
UserManager = Srp, Legacy_Auth
WireCrypt = Enabled
Ahora podemos empezar a crear una fuente de datos. Seleccione el tipo de conexión “FireBirdconnection”:
As a result, the connection line will look like this:
initial catalog="J:\Program Files\Firebird\Firebird_3_0\examples\empbuild\EMPLOYEE.FDB";user id=sysdba;password=masterkey
Next, we can choose the tables needed for the report:
But also, we have the opportunity to write the SQL query. Let's look at this opportunity. Push the button "Add SQL query ...". We set the table name, which is obtained as a result of the query:
Then let’s write SQL request itself:
This request is in the condition parameter. With the help of a double vertical line, we perform a concatation. As a result of this inquiry, we will be presented employees whose names begin with a certain letter or phrase. In the next step we create a parameter with the same name, which we have defined in a SQL query:
As a setting value, we can use any expression: report setting, function, variable. Let's use the report variable. By this point it should have been created:
Choose it in the expression editor which will open when you click Expression in the window of making the parameter request:
As a result, we will get the selection of these employees whose name starts with K: