Ariel Crotty
Ariel Crotty

Reputation: 3

How do I add a character at the end of a field to get the total to 100 characters?

I'm writing an SSRS report for an Association directory. They would like each line to look like this: Title...........Name

The characters from the Value of Title and the dots should equal 100 characters.

This is what I have tried so far:

=Left(Fields!TITLE.Value & ".", 100) & Fields!Name.Value

=Fields!TITLE.Value & StrDup(100 - Len(Fields!TITLE.Value), ".") & Fields!Name.Value

Neither of those worked. Does anyone know how to do this?

Upvotes: 0

Views: 21

Answers (1)

Alan Schofield
Alan Schofield

Reputation: 21703

This is untested as I can't try it right now but the following should work.

=Fields!TITLE.Value & StrDup(100 - (Len(Fields!TITLE.Value) + Len(Fields!Name.Value)), ".") & Fields!Name.Value

If this does not work, please edit your question and supply some sample data. You may have to wrap all the field references in a TRIM() is there are any leading/trailing spaces in the title or name fields. e.g. all instances of Fields!TITLE.Value would become TRIM(Fields!TITLE.Value)

Upvotes: 0

Related Questions