Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

I cannot get this textbox to right align

I have 4 tablix in this report.  This particular column appears in 3 of the tables.  If I set the TextAlign property to left alignment, it works fine.  But if I set it to Right alignment then it become centered.  This data field is from a dataset and it's a char(10) field.  I then set the Format property to Trim(field) and that didn't make any difference either.  I then set Direction property to RightToLeft and that didn't work either.  Can anyone suggest something to fix this.  Thanks.
Avatar of Erick37
Erick37
Flag of United States of America image

Is it possible to modify the SELECT statement to include a RTRIM() on your char(10) column to get rid of the trailing spaces?
Apparently, someone else has similar issue as you.

Please see their recommended solutions and see if it works for you.
http://stackoverflow.com/questions/531383/reporting-services-right-item-alignment

Good luck
Avatar of lapucca
lapucca

ASKER

Sammy, This is for the text in this textbox.  My other textboxes in all 4 table are right aligned with no problem except this one and it's just mind boggling!  
Eric, I already use trim in the Format property of the report but I will apply Rtrim to the sp and let you know if that works.  
thank you.
Avatar of lapucca

ASKER

Modify sp to

rtrim(ltrim(r.EmpAccountNo))

and that didn't make a difference either.  Very frustrating becuase all the other textboxes in all 4 tables formats to the right alignment except this textbox.  I've also tried deleting the column and then insert the new column and add the data field to it and that doesn't work either.

Thanks.
That's strange that RTRIM did not work, I tried it on a sample report and it managed to remove trailing spaces and align the text to the right.

Another way to do this is to open the Placeholder Properties box by double clicking the textbox and modify function [fx] for the value to include the Trim.

e.g.
=Trim(Fields!EmpAccountNo.Value)
Avatar of lapucca

ASKER

Hi,  I had that formula to trim in the textbox's "Format" property and that didn't make any difference atl all.
This is a textbox that is in a cell of a tablix.  The TextAlign property of the textbox is set to "Right".  The triming and convert is done on the sp side.  I had a formt expression to trim the field blank spaces but now I removed it.  The padding to left and right was 6 ,now I set it to 2.  
I don't know what function[fx] property are you referring to.
With all that, the column text is still "Center".  Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca

ASKER

OMG, finally that worked.  I don't have to do this for other textboxes and why this one?  Btw, I'm developing this report in B.I. .net 3.5.  And, also, that I have already apply trim to my sp select statement.  Very odd!  rtrim (ltrim( CONVERT(nvarchar(10), r.EmpAccountNo))) as EmpAccountNo
Thank you.
I found that Trim worked to fix things for centering and CanGrow issues as well that popped up after converting SSRS 2005 reports to 2010.  All of the fields had looked fine when they were displaying on the screen, but they were different when the report was printed.