Use different field when business object ist null

Stimulsoft Reports.NET discussion
Post Reply
HowieD
Posts: 27
Joined: Fri Sep 17, 2010 8:29 am

Use different field when business object ist null

Post by HowieD »

Hi All,
in my Report I want to print a different field when a business object is null.
Here is a sample (pseudo) code:

Code: Select all

[Address].BankInfo == null ? [Address].IBAN : [Address].BankInfo.IBAN
But the code doesn't work in the Report.

How can I achive this?

Best Regards!
HowieD
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Use different field when business object ist null

Post by Alex K. »

Hello,

Please try to use the following code

Code: Select all

Address["BankInfo"] == DBNull.Value ? [Address].IBAN : [Address].BankInfo.IBAN
Thank you.
HowieD
Posts: 27
Joined: Fri Sep 17, 2010 8:29 am

Re: Use different field when business object ist null

Post by HowieD »

Hi Aleksey,
unfortunately your code doesn't work here.
Could I pass you a copy (an when how) of the Report so that you can check it on your side?

Best Regards
HowieD
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Use different field when business object ist null

Post by HighAley »

Hello.

Please, send us a sample project which reproduces the issue for analysis.

Thank you.
Post Reply