February 2, 2012 at 12:57 pm
In my report I am using the following expression that displays the days of the week from a multi select parameter and concatenating it with a single select parameter that shows the time.
=Join(Parameters!DelDay.Label, space(20) + Parameters!time.Label + vbcrlf)+ space(20) + Parameters!time.Label
When I run the report, the time is not aligned properly. I need it to look like what's highlighted in blue.
February 2, 2012 at 1:01 pm
This is just an idea, have you tried trimming the leading and trailing spaces using LTRIM or RTRIM ?
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
February 2, 2012 at 1:07 pm
Not sure how that would work. Perhaps you can provide an example.
February 2, 2012 at 1:09 pm
something like this..
LTRIM(RTRIM(Parameters!time.Label)
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
February 2, 2012 at 2:35 pm
Is this what you are referring to:
=Join(Parameters!DelDay.Label, Space(20) + LTrim(RTrim(Parameters!time.Label + vbcrlf)))+ space(20) + LTrim(RTrim(Parameters!time.Label))
This is the result I get:
February 2, 2012 at 2:52 pm
What happens if you change the font to Courier New, or another non-proportional font?
Dave
February 2, 2012 at 5:20 pm
Well I think, I understood what is wrong with your code that is causing this format. After each day of the week, you are adding 20 space values and that is what is causing it. If you look at the output, the line for Wednesday is longer, where as for Monday, (since it is 3 characters shorter than Wednesday), the 9 AM in the output is aligned that much left to that of Wednesday's 9 AM.
In order to get this straight, I can give a suggestion in logic that needs you to work on the code (I am a DBA, not a developer,so I am little bad on coding).
Here is what I can suggest..
Before you join the weekday, space and the time, get the length of the day, subtract it from a certain value (20), so that you add those spaces and the time value..
So for Monday it would be 14 Spaces (Length of Monday is 6, deduct it from 20 = 14, so add 14 spaces)
for Wednesday it would be 11 Spaces.
All the Best..
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
February 2, 2012 at 6:15 pm
I ended up just right justifying the cell and it aligned properly. The justification of the day of the week does not need to be left justified. Thanks to both for you input.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply