W
W
White_Bambie2020-07-17 13:26:56
MySQL
White_Bambie, 2020-07-17 13:26:56

How to run a FastReport .NET report in Visual Studio?

I created report1 on the form, bound it to the database in phpmyadmin. When a row is selected in the ListBox, a preview of the report is launched. How can I filter the data in the report so that the fields in the report are filled in by the ID that was selected in the ListBox? I understand that it is necessary to write in the code so that the data is filtered before the report is launched, but I did not find information on how to do this in FR.

private void MyListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            MySqlConnection con = new MySqlConnection(AppSetting.ConnectonString());
            DataTable dt = new DataTable();
            MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM patients WHERE id='" + MyListBox.SelectedValue + "';", con);
            da.Fill(dt);
           // report1.Show();
         }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question