Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Sunday, March 11, 2012

Add spaces to a string value in a cell

Hi,

I am trying to add spaces to a string value in a cell but when I run the report the value is trimmed.
Any ideas?
Here is the expression I am using:
=Fields!strVal.Value & " "

Thanks,
Igor

Igor,

Try using a calculated field on your dataset, In the expression, use =" number of spaces wanted" save field name like Space5. You can then use this field in your expressions.

Ham

|||I tried and it still comes out trimmed.|||

Igor,

Can you wrap a LEN around your expression? I used this to verify that the spaces where actually there. If the spaces are there then you made have some other issue.

Ham

|||the Len function returns the correct number of characters (including the empty spaces) but the spaces just don't show up.|||

Igor,

What type of formatting are you trying to accomplish? Are you trying to align text, columns?

Ham

|||I am trying to move some of the values a little to the left but still keeping them right-justified.|||
Igor,
You can try a couple of different things (what you have should work, but if not I can only suggest these)....

=Cstr(Fields!strVal.Value) & Space(5)
or
=Cstr(Fields!strVal.Value) + Space(5)

In Data you could try Cast or Convert on the field to force it to a certain number of characters as well.|||

Igor,

Why not use your "Left-Alignment" properties on your textbox?

Ham

|||

Hello Igor,

Can you try something like this in your field's expression:

=Fields!FIELD1.Value & StrDup(5, " ")

Hope this helps.

Jarret

Add Spaces before text

Hi,

I want to add some extra spaces before a text value. I'm using the below expression

=IIF(Fields!ParentLevel.Value=2or Fields!ParentLevel.Value=1,Space(4) & UCase(Fields!Business_Unit_Name.Value),(Fields!Business_Unit_Name.Value))

Spaces are added when I preveiw the report in VS.NET IDE. However, If I deploy the report on Report Server and view the report in Browser (IE7) I'm not able to see extra spaces that I'm seeing in preview.

Is there anything I'm missing here?

Quick help is highly appreciated.

Thanks and Regards,
Chakra

Hi,
This will more than likely be a html render "issue" as opposed to your code.
Instead of inserting spaces try inserting 4 non-breaking spaces...