Muhammad Noman
Muhammad Noman

Reputation: 35

How to concatenate string values and int values in one text box using rdlc report expression in c#

I have a table called patientRegistration, I want to show multiple values in just one text box.

When I concatenate string values with

"="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")"

its working fine and showing well.

But If add an int value with strings like this

"="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")"

then I got "error" in textbox while report print preview.

So my question is that how we can concatenate string and int values in one textbox?

Any help will be appreciated.

Upvotes: 2

Views: 3012

Answers (1)

Leandro Bardelli
Leandro Bardelli

Reputation: 11608

Use & to concatenate int as string, or convert the parameter before passing it.

Upvotes: 2

Related Questions