Hi,
This works fine when I see the report inside ReportViewer (Actually the Web version since I'm working in ASP.NET) in the sense that I can see First Name and Last Name on two different lines, but when I export it to PDF format I see the plain text...including the HTML TAG !
I'm trying to format the content to visualized inside a cell of my CrossTab (....which is actually as Table) so that it is disposed in two lines:
Ex.
=Fields.FirstName + "<br>" + Fields.LastName |
How can I achieve a "newline" that works in PDF also ?
Many Thanks
Lorenzo
8 Answers, 1 is accepted
0
Hi Lorenzo Raimondi,
Using a <br> as a new line would work in the web viewer as it is the browser that handles the HTML. Using enter in your expression value would generate a new line for you, which in code behind would be serialized as
textBox1.Value = "line1\r\nline2";
and would be respected in all supported export formats.
All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Using a <br> as a new line would work in the web viewer as it is the browser that handles the HTML. Using enter in your expression value would generate a new line for you, which in code behind would be serialized as
textBox1.Value = "line1\r\nline2";
and would be respected in all supported export formats.
All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Lorenzo
Top achievements
Rank 1
answered on 11 Mar 2010, 11:42 AM
Hi, sorry for late response, I was away.
In all cases I get en error:
I've tried this morning but without success.
The attempts I made inside the .Designer.vb were:
Me.TextBox6.Value = "=Fields.ProfFamily\r\nFields.Knowledge" |
Me.TextBox6.Value = "=Fields.ProfFamily \r\n Fields.Knowledge" |
Me.TextBox6.Value = "Fields.ProfFamily\r\nFields.Knowledge" |
An error has occurred while processing TextBox 'TextBox6': |
Missing operand before \r operand. |
no luck !
0
Hi Lorenzo Raimondi,
What you have tried is incorrect as you cannot display the values of two different fields directly in an expression. To achieve this you should either concatenate the values i.e.:
Me.TextBox6.Value = "=Fields.ProfFamily + \"\r\n\" + Fields.Knowledge"
or use embedded expression:
Me.TextBox6.Value = "{Fields.ProfFamily}\r\n{Fields.Knowledge}"
Sincerely yours,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
What you have tried is incorrect as you cannot display the values of two different fields directly in an expression. To achieve this you should either concatenate the values i.e.:
Me.TextBox6.Value = "=Fields.ProfFamily + \"\r\n\" + Fields.Knowledge"
or use embedded expression:
Me.TextBox6.Value = "{Fields.ProfFamily}\r\n{Fields.Knowledge}"
Sincerely yours,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Brad Younge
Top achievements
Rank 1
answered on 27 Oct 2010, 10:05 PM
I'm trying to get a NewLine into a textbox using the Expression Editor in the Designer and can't get it to work. I've tried the following:
=Fields.Street1 + "\r\n" + Fields.Street2
=Fields.Street1 + "\\r\\n" + Fields.Street2
=Fields.Street1 + "<br>" + Fields.Street2
The third one works in the Report Viewer, but not when Exported to PDF.
Please Help.
Thanks!
=Fields.Street1 + "\r\n" + Fields.Street2
=Fields.Street1 + "\\r\\n" + Fields.Street2
=Fields.Street1 + "<br>" + Fields.Street2
The third one works in the Report Viewer, but not when Exported to PDF.
Please Help.
Thanks!
0
Hi Brad,
You have not tried neither of my suggestions from previous post which both work as expected. Note that they are the actual code generated for the Value property and not the actual value set in the expression editor.
Best wishes,
Steve
the Telerik team
You have not tried neither of my suggestions from previous post which both work as expected. Note that they are the actual code generated for the Value property and not the actual value set in the expression editor.
Best wishes,
Steve
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Ken Lewis
Top achievements
Rank 1
answered on 24 Jan 2011, 11:46 PM
I got this to work using the "embedded expression" example in the ItemDataBinding event. Is it possible to get the same result using the expression editor or do we have to use code?
Thanks,
Ken
Thanks,
Ken
0
Hi Ken,
The code I've provided in my post from 3/12/2010 is taken from the InitializeComponent method which as you probably know is auto generated by the report designer i.e. I have entered those expressions in the expression editor of the textBox item. Sample video is attached to clear any further confusion on this topic.
Best wishes,
Steve
the Telerik team
The code I've provided in my post from 3/12/2010 is taken from the InitializeComponent method which as you probably know is auto generated by the report designer i.e. I have entered those expressions in the expression editor of the textBox item. Sample video is attached to clear any further confusion on this topic.
Best wishes,
Steve
the Telerik team
0
Ken Lewis
Top achievements
Rank 1
answered on 25 Jan 2011, 03:44 PM
Hi Steve,
The video helped a lot. What I wasn't getting was that I could simply use the enter key in the expression editor. (I missed that in Peter's March 5, 2010 post.)
Thanks!
Ken
The video helped a lot. What I wasn't getting was that I could simply use the enter key in the expression editor. (I missed that in Peter's March 5, 2010 post.)
Thanks!
Ken