Solved

I cannot get this textbox to right align

Posted on 2010-11-24
9
1,722 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 500 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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