简体   繁体   中英

Display rdlc report with more than one dataset -c#

I have a desktop app (winforms) with an embedded Local Database SQL CE .

I have 2 tables in my database: Customers and Orders.

In Customers table I have : customerID , customerName.

In Orders table I have : CustomerID , OrderID, OrderName.

I want to display a report with : CustomerID , CustomerName , OrderName.

How can I get the value for customerName that matches the customerID in ordersTable.

Any help would be appriciated.

SELECT Customers.CustomerID, Customers.CustomersName, Orders.OrderName
FROM Customers
INNER JOIN Orders
ON Customers.CustomerID=Orders.CustomerID;

If you're using local report (*.rdlc types) it is not possible to set custom query for report. you can create a report table and insert searched records in it and make a local report for report table!! or use dynamic query dataset.

I had this problem before: see more

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM