Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

I cannot get this textbox to right align

Posted on 2010-11-24
9
Medium Priority
?
2,045 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
ID: 34207586
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 29

Expert Comment

by:sammySeltzer
ID: 34207605
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
ID: 34207899
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lapucca
ID: 34207960
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
 
LVL 32

Expert Comment

by:Erick37
ID: 34208254
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
ID: 34208378
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 2000 total points
ID: 34208522
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
ID: 34209871
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
ID: 40245010
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 your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

972 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