Hi
I've simplified this so I can test it's not me and so it's easier to explain.
I have one table in SQL server called Table1. Five fields called: One, Two, Three, Four, Five. Values of NULL, 2, 3, 4, NULL.
Reporting services, put a table in a report. Two fields. Header of Field1 and Field2.
Value field data for Field1 ="One: " & vbcrlf & "Two: " & vbcrlf & "Three: " & vbcrlf & "Four: " & vbcrlf & "Five: "
Value field data for Field2 =Fields!One.Value & vbcrlf & Fields!Two.Value & vbcrlf & Fields!Three.Value & vbcrlf & Fields!Four.Value & vbcrlf & Fields!Five.Value
Preview the report, all is well, you get this:
Field1 Field2
One:
Two: 2
Three: 3
Four: 4
Five:
Export it to a PDF, all is not well, I get this:
Field1 Field2
One: 2
Two: 3
Three: 4
Four:
Five:
I can make it work by checking the NULL fields and replacing them with a character. But why does it ignore the vbCRLF when exported to a PDF?
Any ideas...
give minimum space (width and hight) for that field and try|||Hello merin
Not sure how I give it minimum space?
Also the field is being outputted with enough space (I think), as 234 appear in that field. If I replace the NULLS with a hypen, it works perfectly. But that NULL in the table in field one is causing the VbCRLF to be ignored when it is exporting to a PDF.
With a hypen as a replacement for the NULL I get this preview and it outputs perfectly to a PDF. (This is how I've fixed the problem, but I'm still interested as to why this happens)
Field 1 Field2
One: -
Two: 2
Three: 3
Four: 4
Five: -
Unfortunately, this is not something we support very well at all in SQL Server 2005. You'll see inconsistent behavior - for instance, exporting to TIFF will act as if the tabs are not present so the words will run together and exporting to PDF will act as if the tabs are spaces except for underline which won't cover the complete text.
Your best bet will be to do this via code. Switch to a fixed-width font and simulate tabs with multiple spaces.
Sorry I don't have a better answer.
|||Thanks for this. The NULL replace with a hypen works for me for now. Hopefully in the next SP it will be a little more consistant with the formatting, here's hoping anyway.
No comments:
Post a Comment