Solved

Automatically adjust text size in report field

Posted on 2006-11-07
5
228 Views
Last Modified: 2006-11-18
Not sure if this is the correct area for this question.  If it isn't, please let me know where it should be posted.

We have an SQL 2005 database, and we use MS Visual Studio 2005 Pro for (RDL) report design.  I am relatively new to Visual Studio, and was hoping I could get some assistance with a small problem.  I have a textbox field on a particular report that has a fixed size, and cannot shrink or grow.  The size and position of the textbox must remain constant.  However, frequently the data in the field at report time is larger than the field constraints, and so it appears cut off.  I was hoping there was a way I could get the the text in the field to automatically resize if it's too big for the textbox.  Any ideas?
0
Comment
Question by:internetcreations
[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
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:regbes
ID: 17890834
Hi internetcreations,

just a thought add a text box to the report with a len function of the field displayed then put conditional formatting ( i dont know if RS supports that ) on the text box you want resize dependant on the value of the len function

0
 
LVL 1

Author Comment

by:internetcreations
ID: 17891109
regbes,

Yeah,  I was figuring on using a conditional of the sort:

If Len(Fields!shname.Value) > 24 Then
    Text3.FontSize = "10pt"
Else
    Text3.FontSize = "14pt"
End If

But I'm not sure how/where to implement the conditional in my report design....
0
 
LVL 11

Expert Comment

by:regbes
ID: 17891581
cant check right now as im at home will check tomorrow and get back to you
0
 
LVL 1

Accepted Solution

by:
internetcreations earned 0 total points
ID: 17893626
Never mind, I figured it out myself.  The conditional function is 'Iif(booleanexpression, trueresult, falseresult)'.  So in my case, I set the FontSize of the Text3 object equal to 'Iif(Len(Fields!shname.Value) > 24, "10pt", "14pt")'.  That did it.

Thanks for trying to help though!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

717 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