This is a migrated thread and some comments may be shown as answers.

Merge Two Fields

2 Answers 40 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
n/a
Top achievements
Rank 1
Iron
n/a asked on 05 Mar 2021, 10:47 AM

Hello everyone,

Please, I need a little help with Report Designer. I have 2 fields(Name and CompanyID) and I want to concatenate them. Some rows from column Name are populated with company name and other are blank. All rows from CompanyID are populated with guids. I tried something like {Fields.Name}{Fields.CompanyId}, but all rows which are populated with the company name, also added guids. I want all the rows that are populated with the company name not to add guids, too.

Thanks in Advance!

2 Answers, 1 is accepted

Sort by
0
Accepted
Mads
Telerik team
answered on 10 Mar 2021, 09:07 AM

Hello Marcel,

From my understanding you want to display the field 'Name'. If this field is empty, you instead want to display the field 'CompanyId'.

We can use the conditional function IIF( ) to check if the field 'Name' is blank. But blank can both mean that the field is null, and that the field is an empty string, so we need to check for both. I suggest using the following expression:

= IIf(Fields.Name Is Null Or Fields.Name Like "",Fields.CompanyId,Fields.Name)

This will check if the field 'Name' is Null or is like "" (empty string), then use 'CompanyId' if either of these is true.

I hope this information is useful. Let me know if I understood your requirements correctly and if I answered your question. If you have any other questions, please let me know.

Regards, Mads Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
n/a
Top achievements
Rank 1
Iron
answered on 15 Mar 2021, 07:04 AM
Thank you, this is what I needed.
Tags
Report Designer (standalone)
Asked by
n/a
Top achievements
Rank 1
Iron
Answers by
Mads
Telerik team
n/a
Top achievements
Rank 1
Iron
Share this question
or