Link to home
Start Free TrialLog in
Avatar of f_o_o_k_y
f_o_o_k_yFlag for Poland

asked on

How to make line break in CrystalReports?

Hello
I'm developing application in VB.NET
I have crated crystalReport with TextObject "Header".
Now I need to change text in "Header" based on what I get from database.
I also need to break the text in specified places.
So if I have in my database:     "This is my Header \n New line is here"
I need to break line on "\n"
I tried Replace("string", "\n",NewLine) but its not working.
How can I break line in crystalreport?

Best Regards
FooKy
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Have you tried to use all this:

Chr(10)
Chr(13)
or
VbCrLf

ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of f_o_o_k_y

ASKER

Hello,
Sorry for delay but there was a power cut-off in my neighbourhood due to strong winds.

Below I attach code with description of what I'm trying to do.

I also looked at format field -> paragraph tab but there was nothing about text interpretation (maybe because its not full version of CrystalReports but only this what is VS 2005 TeamSuite)
See screenshot.

Best Regards
FooKy
Dim rtxt As CrystalDecisions.CrystalReports.Engine.TextObject = CType(rpt1.ReportDefinition.ReportObjects.Item("TextHeader"), CrystalDecisions.CrystalReports.Engine.TextObject)
 
rtxt.Text = Replace(dr2("header"), "\n", vbNewLine)
'Also tryed 
rtxt.Text = Replace(dr2("header"), "\n", Chr(10) & Chr(13))
rtxt.Text = Replace(dr2("header"), "\n", "<br>")
rtxt.Text = Replace(dr2("header"), "\n", "<br />")
rtxt.Text = Replace(dr2("header"), "\n", vbCrLf)

Open in new window

paragraph.png
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.
Both answers were accurate.
First i thought that mlmcc was taking about text object but TEXT INTERPRETATION is only in parameter field.
so I used it and code from jpaulino and replaced \n to

Best Regards
FooKy