Solved

Automatically adjust text size in report field

Posted on 2006-11-07
5
226 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

825 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