all groups > sql server reporting services > september 2007 >
You're in the

sql server reporting services

group:

SOMEBODY MUST KNOW


SOMEBODY MUST KNOW pcrtrg
9/6/2007 7:54:07 AM
sql server reporting services:
Everyone,

I am getting a recordset being sent through to SSRS that may or maynot have
cell data in it, if I set it up as raw data, i.e. set no data conversion,
CDEC(Fields!value.value) everything works fine, but when I export to excel
the numbers are formatted as text and it is a requirement of the project
that the Numbers / Decimal values have to be formatted as numbers.

When I place the conversion, CDEC(Fields!value.value), into the value of the
text box AND no data is returned for the entire column in question I get a
repetitive "#Error" displayed in the cells the entire length of the column.
I have tried to place conditional iif statements and all sorts of things
that include different and NO formatting values in the FORMAT attribute and
it still displays, "#Error".

Due to the nature of the export it is not possible to place any values in
the columns that display the errors.

Can anyone help me with this issue or suggest an alternative.

Cheers guys


Paul

Re: SOMEBODY MUST KNOW EMartinez
9/7/2007 2:28:50 AM
[quoted text, click to view]


Have you tried an expression similar to the following?
=iif(Fields!Value.value = Nothing, CDec(Nothing), CDec(Fields!
Value.value))
Of course, you will get a zero for all values in the column. but it
will return a decimal in Excel. Also, I would suggest that you don't
set a report cell format unless you have to.
Hope this helps.

Regards,

Enrique Martinez
Sr. Software Consultant
RE: SOMEBODY MUST KNOW pcrtrg
9/7/2007 3:40:00 AM
Thank you to EMartinez who put me on the right track.

If you encounter a similar problem then this is how I sorted the "#Error" on
data conversion.

Create a function in the RDL Report Template,

Public Function [FUNCTION_NAME](ByVal TextField As String) As object

Dim rtn as object = nothing

If TextField = nothing Then

rtn = System.DBNull.Value

Else

rtn = cdbl(TextField)

End If


RETURN rtn

End Function

This has sorted out the issues with NULL or Blank ("") fields returned from
the dataset.

[quoted text, click to view]
Re: SOMEBODY MUST KNOW EMartinez
9/8/2007 1:06:19 AM
[quoted text, click to view]


You're welcome. I'm glad you figured it out.

Regards,

Enrique Martinez
Sr. Software Consultant
AddThis Social Bookmark Button