17

I have a report with many fields that I'm trying to get down to 1 page horizontally (I don't care whether it's 2 or 200 pages vertically... just don't want to have to deal with 2 pages wide by x pages long train-wreck). That said, it deals with contact information.

My idea was to do:

Name:      Address:   City:      State:    ...
Jon Doe    Addr1      ThisTown    XX       ...    
           Addr2
           Addr3
-----------------------------------------------
Jane Doe   Addr1      ThisTown    XX       ...
           Addr2
           Addr3
-----------------------------------------------

Is there some way to set a textbox to be multi-line (or the SQL result)? Have I missed something bloody obvious?


The CanGrow Property is on by default, and I've double checked that this is true. My problem is that I don't know how to force a line-break. I get the 3 address fields that just fills a line, then wraps to another. I've tried /n, \n (since I can never remember which is the correct slash to put), <br>, <br /> (since the report will be viewed in a ReportViewer control in an ASP.NET website). I can't think of any other ways to wrap the text.

Is there some way to get the results from the database as 3 lines of text/characters? ­­­­­­­­­­­­­­­­­­­­­­­­­­­

ɢʀᴜɴᴛ
  • 32,025
  • 15
  • 116
  • 110
Pulsehead
  • 5,050
  • 9
  • 33
  • 37

8 Answers8

24

Alter the report's text box to:

= Fields!Addr1.Value + VbCrLf + 
  Fields!Addr2.Value + VbCrLf + 
  Fields!Addr3.Value
Mosha Pasumansky
  • 13,206
  • 5
  • 32
  • 55
Pulsehead
  • 5,050
  • 9
  • 33
  • 37
6

I had an additional problem after putting in the chr(10) into the database.

In the field (within the report) add in:

=REPLACE(Fields!Addr1.Value, CHR(10), vbCrLf)
Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
Sam
  • 61
  • 1
  • 1
5

My data was captured in a SL application, needed this for the field expression

=REPLACE(Fields!Text.Value, CHR(13), vbCrLf)
Adriaan Davel
  • 710
  • 1
  • 11
  • 25
  • the [post](http://stackoverflow.com/a/3582842/1993545) from Sam says already the same thing, so -1 for repeating – WiiMaxx Jul 02 '14 at 10:50
  • Used `System.Environment.NewLine` instead of `vbCrLf` as noted in another comment, other than that this worked perfect for me! – sǝɯɐſ Oct 16 '19 at 20:16
4

Hitting Shift+Enter while typing in the textbox creates a line break.

James An
  • 1,383
  • 1
  • 10
  • 16
2

I believe you need to set the CanGrow property to true on the Textbox. See http://msdn.microsoft.com/en-us/library/ms159116(SQL.90).aspx for some details.

Sean Carpenter
  • 7,681
  • 3
  • 37
  • 38
1

link break do this

chr(10)

zhengokusa
  • 11
  • 1
0

Try this one :

= Fields!Field1.Value + System.Environment.NewLine + Fields!Field2.Value
0

In RDLC reports, you can convert a textbox to placehoder. Then right click that textbox placeholder, select placehoder properties and select HTML. Then for multiline to take effect, you have to insert <br/> tag between those lines.

Hemal
  • 3,682
  • 1
  • 23
  • 54