Solved

I cannot get this textbox to right align

Posted on 2010-11-24
9
1,419 Views
Last Modified: 2014-08-06
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.
0
Comment
Question by:lapucca
9 Comments
 
LVL 32

Expert Comment

by:Erick37
Comment Utility
Is it possible to modify the SELECT statement to include a RTRIM() on your char(10) column to get rid of the trailing spaces?
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
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
0
 

Author Comment

by:lapucca
Comment Utility
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.
0
 

Author Comment

by:lapucca
Comment Utility
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.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 32

Expert Comment

by:Erick37
Comment Utility
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)
0
 

Author Comment

by:lapucca
Comment Utility
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.
0
 
LVL 32

Accepted Solution

by:
Erick37 earned 500 total points
Comment Utility
In your Tablix, double click on the textbox you need to format and the Properties box will display.
From there you click on the button next to the Value box to enter the Expression.  See attached.

Alternatively, right click the textbox and select Expression...

Include the Trim function in the existing expression. Placeholder Properties
0
 

Author Closing Comment

by:lapucca
Comment Utility
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.
0
 

Expert Comment

by:EDCTECH
Comment Utility
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.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now