Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Wednesday, March 7, 2012

newline in pdf lost

I'd like to format a textfield with newline. In Preview everything looks ok. After exporting to pdf all newlines are gone. I use the following text inside the textbox:
+++
=controlchars.Newline &
controlchars.Newline &
controlchars.Newline &
controlchars.Newline &
First(Fields!NameKunde.Value, "Absender") & vbnewline &
First(Fields!Ort.Value, "Absender") & vbnewline &
First(Fields!BenutzerAnmeldename.Value, "Absender") & vbnewline &
First(Fields!Vorname.Value, "Absender") & " " & First(Fields!Name.Value, "Absender") & vbnewline &
today
+++
As you see, I tried controlchars.Newline, vbnewline. No differenc in pdf.
Thanks for help
NickiThis looks like a bug. As a workaround you could handle the formatting
using a rectangle that contains a series of textboxes. The sample report at
the end of this posting demonstrates how to accomplish this.
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Nicki" <Nicki@.discussions.microsoft.com> wrote in message
news:4AF42D93-C526-4235-80A7-DF83133A1A48@.microsoft.com...
> I'd like to format a textfield with newline. In Preview everything looks
ok. After exporting to pdf all newlines are gone. I use the following text
inside the textbox:
> +++
> =controlchars.Newline &
> controlchars.Newline &
> controlchars.Newline &
> controlchars.Newline &
> First(Fields!NameKunde.Value, "Absender") & vbnewline &
> First(Fields!Ort.Value, "Absender") & vbnewline &
> First(Fields!BenutzerAnmeldename.Value, "Absender") & vbnewline &
> First(Fields!Vorname.Value, "Absender") & " " & First(Fields!Name.Value,
"Absender") & vbnewline &
> today
> +++
> As you see, I tried controlchars.Newline, vbnewline. No differenc in pdf.
> Thanks for help
> Nicki
>
RectangleTextboxSampleReport.rdl
----
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Rectangle Name="rectangle1">
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>3</ZIndex>
<Top>1.625in</Top>
<rd:DefaultName>textbox4</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.875in</Width>
<CanGrow>true</CanGrow>
<Value>=today</Value>
<Left>0.125in</Left>
</Textbox>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<Top>1.125in</Top>
<rd:DefaultName>textbox3</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.875in</Width>
<CanGrow>true</CanGrow>
<Value>Last line of text</Value>
<Left>0.125in</Left>
</Textbox>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>1</ZIndex>
<Top>0.625in</Top>
<rd:DefaultName>textbox2</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.875in</Width>
<CanGrow>true</CanGrow>
<Value>Second line of text</Value>
<Left>0.125in</Left>
</Textbox>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<Top>0.375in</Top>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.25in</Height>
<Width>1.875in</Width>
<CanGrow>true</CanGrow>
<Value>First line of text</Value>
<Left>0.125in</Left>
</Textbox>
</ReportItems>
<Width>2.25in</Width>
<Style>
<BorderWidth>
<Default>1.5pt</Default>
</BorderWidth>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Rectangle>
</ReportItems>
<Style />
<Height>2in</Height>
</Body>
<TopMargin>1in</TopMargin>
<Width>6.5in</Width>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>b77866c3-877c-45bc-a5dc-88760f336daf</rd:ReportID>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>

NewLine and Carriage return issue in PDF format

If I insert the following expression in a textbox it will display
correctly in HTML format but not in PDF format. Can anyone show me how
to accomplish the same thing so that it will display correctly in both
HTML and and PDF format.
vbCrLf & vbCrLf & vbCrLf & "My Text"
In HTML format, it will display "My Text" on the 4th "row". Whereas in
PDF format, it displays "My Text" on the first row of the textbox.This has to be an issue (bug) with PDF and how it formats initial blank
space before the literal text. I am not sure if this is addressed in a
service pack for 2000 or in 2005 (I am using 2000 to test this) but here is
a workaround that I found that places an ASCII record seperator in the first
position before the CRLF's as:
=CHR(30)&vbCrLf & vbCrLf & vbCrLf & "My Text"
That should work.
Rodney Landrum
<Nergock@.gmail.com> wrote in message
news:1143588675.322590.215140@.u72g2000cwu.googlegroups.com...
> If I insert the following expression in a textbox it will display
> correctly in HTML format but not in PDF format. Can anyone show me how
> to accomplish the same thing so that it will display correctly in both
> HTML and and PDF format.
> vbCrLf & vbCrLf & vbCrLf & "My Text"
> In HTML format, it will display "My Text" on the 4th "row". Whereas in
> PDF format, it displays "My Text" on the first row of the textbox.
>