[英]In C# How to concatenate values with strings in RDLC IIf condition expression?
[英]How to concatenate string values and int values in one text box using rdlc report expression in c#
我有一個名為patientRegistration 的表,我想在一個文本框中顯示多個值。
當我將字符串值與
"="Patient Name: " + First(Fields!Patient_Name.Value, "DataSetEchoPDetails") + " " + First(Fields!SO.Value, "DataSetEchoPDetails") + " " + First(Fields!Guardian_Name.Value, "DataSetEchoPDetails") + " Gender: " + First(Fields!Sex.Value, "DataSetEchoPDetails")"
它工作正常並且顯示良好。
但是如果用這樣的字符串添加一個 int 值
"="Patient Name: " + First(Fields!Patient_Name.Value, "DataSetEchoPDetails") + " " + First(Fields!SO.Value, "DataSetEchoPDetails") + " " + First(Fields!Guardian_Name.Value, "DataSetEchoPDetails") + " Gender: " + First(Fields!Sex.Value, "DataSetEchoPDetails") + " Age: " + Sum(Fields!Age.Value.GetType().ToString(), "DataSetEchoPDetails")"
然后我在報告打印預覽時在文本框中收到“錯誤”。
所以我的問題是我們如何在一個文本框中連接 string 和 int 值?
任何幫助將不勝感激。
使用&
將int
連接為string
,或在傳遞之前轉換參數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.