在RDLC报告中使用外键 [英] Use Foreign key in RDLC Report

查看:99
本文介绍了在RDLC报告中使用外键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个数据集

1:产品

2:产品详细信息

i在报告中有表,它的数据集是ProductDetails 。在此表中有一列具有产品ID。

i想要显示ProductName而不是ProductID。



i''我正在寻找表达式,就像在rdlc报告中这样:



I have 2 DataSets
1: Products
2: ProductsDetails
i have table in the report which it''s dataset is ProductDetails. in this table there is a column which has the product id.
i want to show the ProductName instead of the ProductID.

i''m looking for the expression, sth like this in rdlc report:

DBDataContext db = new DBDataContext();
this.currentCellValue = db.tbl_Products.Where(p => p.ID == CurrentCellValue).First().Name;



谢谢


Thanks

推荐答案





您需要先从数据库中检索正确的数据,然后在报告中显示。我建议修改你的查询。
Hi,

You need to retrieve the correct data from your DB first and then show it on the report. I suggest amending your query.


我创建了一个视图并将其传递给报告
I created a view and the passed it to the report


这篇关于在RDLC报告中使用外键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆