Hello,

I try to print data from firebird database in a Visual Studio 2012 
winforms App.
I want to use the ReportViewer component.

I create a form with a ReportViewer and a DataGrid. When I run the 
solution, Data appears in the grid but nothing in the reportviewer.

I do theses steps =>

I create an XSD named "Bulletin" with a DataTable "BulletinPaie" and two 
fields.
After, I create an RDLC report (Bulletin.rdlc), and I add a new dataset 
Dataset1.
I link Dataset1 to Bulletin for the connection, and BulletinPaie for the 
datasource.

In a winform, I drop a reportViewer component and I link it to Bulletin.rdlc

On the form load event I write this code :

         private void ImpressionPreview_Load(object sender, EventArgs e)
         {

             Bulletin b = new Bulletin();  //bulletin is the XSD élement

             string strsql = "SELECT  NUMORDRE,  LIBELLE FROM 
profil_detail";

             FbCommand cmd = new FbCommand(strsql, 
mainForm.fbConnectionPaie);
             FbDataAdapter adapter = new FbDataAdapter(cmd);

             adapter.Fill(b, b.Tables[0].TableName);
             ReportDataSource rds = new ReportDataSource("BulletinPaie", 
b.Tables[0]);

             this.reportViewer1.LocalReport.DataSources.Clear();
             this.reportViewer1.LocalReport.DataSources.Add(rds);
             this.reportViewer1.LocalReport.Refresh();
             this.reportViewer1.Refresh();


             dataGridView1.DataSource = b.Tables[0];
         }

Thanks for your help,

Vincent.

------------------------------------------------------------------------------
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to