Click here to Skip to main content
15,886,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a rdlc report. And Iam trying to show the Serial No. for the field Itm_description is available column.....If the field itm_description is null, then the serial no has to be null... Is it possible?

When I give the below command for Sl_No column expression,
VB
IIf((Fields!itm_description.Value.ToString().Trim().Length=0), "",RowNumber(nothing))

IIf((Fields!itm_description.Value.ToString().Trim().Length=0), Nothing,RowNumber(nothing))

Output
======
1
2
3
4
#error
#error
#error

So how to solve this error...
Posted
Updated 18-Aug-14 6:52am
v2

I believe using the IsNothing function is what you'll need to use. It can test for NULL.

See http://social.msdn.microsoft.com/Forums/en-US/cbed4e88-16d4-4d4b-821a-7a7e728c7e34/testing-for-null-in-rdlc-report-field?forum=vsreportcontrols[^]
 
Share this answer
 
From your tips, I succeeded by the following expression
C#
=IIf((Convert.ToString(Fields!itm_description.Value).Trim().Length=0), "", RowNumber(nothing))

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900