Hi all,
I've got 5
DataTable
s being initialized and filled in the
reportviewer1_Load
method, contained in a Windows Form
FReport
.
DataTable dtInvoiceDetails = new DataTable();
DataTable dtInvoiceDescriptionDetails = new DataTable();
DataTable dtClientDetails = new DataTable();
DataTable dtPaymentTypeDetails = new DataTable();
DataTable dtDocumentTypeDetails = new DataTable();
MySqlCommand mscInvoiceDetails = new MySqlCommand("SELECT invoice_code, dt_invoice, total_value, observation FROM tb_invoices WHERE invoice_code = \'" + _invoiceNumber + "\';", bdConn);
MySqlCommand mscInvoiceDescriptionDetails = new MySqlCommand("SELECT detail_description, detail_value, ind_taxible FROM tb_doc_details WHERE tb_invoices_id_invoice = (SELECT id_invoice FROM tb_invoices WHERE invoice_code = \'" + _invoiceNumber + "\');", bdConn);
MySqlCommand mscClientDetails = new MySqlCommand("SELECT company_name, company_registration, address, corporate_name FROM tb_client WHERE id = (SELECT tb_client_id FROM tb_invoices WHERE invoice_code = \'" + _invoiceNumber + "\');", bdConn);
MySqlCommand mscPaymentTypeDetails = new MySqlCommand("SELECT payment_type_name, payment_type_description FROM tb_payment_type WHERE id = (SELECT tb_payment_type_id FROM tb_invoices WHERE invoice_code = \'" + _invoiceNumber + "\');", bdConn);
MySqlCommand mscDocumentTypeDetails = new MySqlCommand("SELECT doc_type_cd FROM tb_doc_type WHERE id_doc_type = (SELECT tb_doc_type_id_doc_type FROM tb_invoices WHERE invoice_code = \'" + _invoiceNumber + "\');", bdConn);
MySqlDataAdapter mscDAdtInvoiceDetails = new MySqlDataAdapter(mscInvoiceDetails);
mscDAdtInvoiceDetails.Fill(dtInvoiceDetails);
MySqlDataAdapter mscDAdtInvoiceDescriptionDetails = new MySqlDataAdapter(mscInvoiceDescriptionDetails);
mscDAdtInvoiceDescriptionDetails.Fill(dtInvoiceDescriptionDetails);
MySqlDataAdapter mscDAdtClientDetails = new MySqlDataAdapter(mscClientDetails);
mscDAdtClientDetails.Fill(dtClientDetails);
MySqlDataAdapter mscDAdtPaymentTypeDetails = new MySqlDataAdapter(mscPaymentTypeDetails);
mscDAdtPaymentTypeDetails.Fill(dtPaymentTypeDetails);
MySqlDataAdapter mscDAdtDocumentTypeDetails = new MySqlDataAdapter(mscDocumentTypeDetails);
mscDAdtDocumentTypeDetails.Fill(dtDocumentTypeDetails);
I created a Microsoft Report Viewer, named
reportViewer1
, inside a windows Form named RepF, that contain a report named Report1.rdlc.
Inside this reportViewer1 code, in
private void reportViewer1_Load(object sender, EventArgs e) { ... }
is the code posted above which creates the
DataTables
and fill them.
In my report (Report1.rdlc), I have some fields like 4 Text Boxes, which will contain data stored in 4
DataTables
, and 1 Table, which will contains data stored in 1 of the 5
DataTables
.
what I don't know is: How can I make these fields in my Report1.rdlc, show the information I collected in those initializes and full
DataTables
?
I need to print the data contained in those
DataTables
through a Microsoft Report Viewer report, in my case, Report1.rdlc. This report is already configured with the properly design. I just need to feed them.
PS: I am not using a DataSet. I only have those 5 DataTables. If it is really necessary to use a DataSet, how can I create a DataSet and Include those 5 DataTables into it
Thanks in advance! :)