How to use MSSQL tables as a data source
1. Open the Data Source Add Wizard by clicking Data->add Data Source menu item in Fastreport Designer.
2. Add a new data connection.
Click New Connection to open the Data Connection dialog box.
(1) Select the data connection type: MS SQL connection;
(2) Select the database service (if it is the default instance, enter it directly. or (local));
(3) Select login account;
(4) Select the default database.
Finally, you can click "Test Connection" to test the connection.
After a successful creation, you can modify the data connection name and see the resulting data connection string.
3. Select the data table you want to add.
Take the student elective course as an example, including student table (student), Curriculum (course), Course selection Relationship form (SC)
4. Finally, you can see the selected data source in the Data source window
How to use the MSSQL custom query as a data source
1. Click Connection_test Data Source to edit the data view and go to the datasheet selection screen.
2.
In the third step of the table select interface, click on the "Add SQL Query" button to enter the Query Add Wizard.
You can modify the query resource name by default to table.
3. Add the SQL query statement.
SELECT SC. StudentID as ' study number ', St.name as ' name ', CourseID as ' account number ', Co.name as ' account name '
From SC SC
JOIN Student St on SC. Studentid=st.id
JOIN Course CO on SC. Courseid=co.id
The Query Builder is also available, click "Query Builder" to enter.
4. Set the incoming parameters, which is used without a parameter query, skip this step directly
5. Set the query column.
The interface shows the columns generated by the query statement, which can be modified, added to the computed column, and so on.
Then, the table data source that you just added is more in the data source selection interface. Select the data source.
Fastreport.net using: [2] Add MSSQL data Source One