Page 1 of 1

How was the join Report

Posted: Wed Jun 01, 2016 5:12 pm
by loei

Code: Select all

 var query = from r in mydb.tblInvoices
                        join a in mydb.tblAddInvoices on r.invoice_ID equals a.invadd_invoiceID
                        join s in mydb.tblStores on a.invadd_storeID equals s.store_ID
                        join u in mydb.tblUsers on r.invoice_userID equals u.user_ID
                        where r.invoice_ID == Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value)
                        orderby r.invoice_ID descending
                        select new { r.invoice_ID, r.invoice_date, r.invoice_desc, r.invoice_off, r.invoice_tax, u.user_fullname, u.user_address, u.user_tell, s.store_name, a.invadd_price, a.invadd_qulity, a.invadd_stock, a.invadd_sumprice };
Hi,

This is my code and LINQ multiple tables, but the report Join I'd had failed because only one table

Code: Select all

// show report
            StiReport rep = new StiReport();
            rep.Load(Application.StartupPath + "\\fatcktorprint2.mrt");
            rep.Dictionary.Clear();
rep.RegData("tblInvoice", query);
            rep.Dictionary.Synchronize();
            rep.Compile();
            rep.Show();
How can all the tables were reports؟

Re: How was the join Report

Posted: Wed Jun 01, 2016 5:57 pm
by Jan
Hello,

Please remove following line of the code:

Code: Select all

rep.Dictionary.Synchronize();
Let me know about results.

Thank you.

Re: How was the join Report

Posted: Wed Jun 01, 2016 7:09 pm
by loei
Was fouled again
The name 'tblInvoice' does not exist in the current contextc:

Re: How was the join Report

Posted: Thu Jun 02, 2016 6:03 am
by HighAley
Hello.

Please, send us a sample project that reproduces the issue.

Thank you.