Solved

Automatically adjust text size in report field

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

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)

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

863 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

22 Experts available now in Live!

Get 1:1 Help Now