x
login about faq Site discussion (meta-askssc)

How to check for #error when using Split in textbox expression

Hello all,

I have a dataset in a report that is returning a field which contains a comma-separated list of values. I want to display the first value in textbox1, the second value oin textbox2 and so on.

In textbox1 I use the expression

=Split(Fields!CSVList.Value, ",")(0)

In textbox2 I use the expression

=Split(Fields!CSVList.Value, ",")(1)

However, when the data in the field CSVList only contains one value, then Textbox2 displays #ERROR when the report is run.

How can I avoid displaying this error when there is no corresponding value in the Split array?

Thanks in advance.

more ▼

asked Feb 22 '12 at 01:01 PM in Default

xnl28 gravatar image

xnl28
765 45 49 56

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

@xnl28 Unfortunately, you are not doing it the right way. This seems to be the typical requirement of the matrix. Send the dynamic data from the SQL Server and handle it in SSRS with a Matrix.

Following are the links to help you out for the matrix implementation

http://sonalimendis.blogspot.com/2011/07/dynamic-column-rdls.html

http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/dynamic-column-names-and-fields-in-ssrs-

more ▼

answered Feb 22 '12 at 03:27 PM

robbin gravatar image

robbin
1.6k 1 3 5

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x95

asked: Feb 22 '12 at 01:01 PM

Seen: 555 times

Last Updated: Feb 22 '12 at 03:54 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.