f_o_o_k_y
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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)
paragraph.png
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
Chr(10)
Chr(13)
or
VbCrLf