Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all!
I've created a qvw with a straight table and added some dimensions and an expression on it. As one off my dimensions, I have a field with some big texts and it already has some line breaks (I'm referring to CHAR(10) and CHAR(13)), this line breaks were added into the SQL Server database (data source). When I'm looking on the data at the report everything looks good, but when I run a vbscript that exports this Straight Table as a pdf file, the line breaks disappear and I don't know why this is happening. Someone have any idea?
Here is a example of the data on report:
Dimension 1 | Dimension 2 | Expression |
---|---|---|
Example 1 | Some text; Some text; | 1 |
Example 2 | My text; My text; | 2 |
Example 3 | Anything; Anything; | 3 |
Here is how it looks after exporting to a pdf file (using vbscript):
Dimension 1 | Dimension 2 | Expression |
---|---|---|
Example 1 | Some text;Some text;Some text; | 1 |
Example 2 | My text;My text; | 2 |
Example 3 | Anything;Anything; | 3 |
Thanks in advance!
Best regards,
Tiago
I've got it!
I used CHAR(11) instead of CHAR(10)+CHAR(13)
I think the problem was between the vbscript and word, it wasn't reckoning CHAR(10) + CHAR(13) as a line break, It does a line break with CHAR(11).
Thank you very much for your help and answering this question.
Best regards.
Have you tried something like this....
ActiveDocument.GetSheetObject("CH28").PrintEx "PDF-XChange 3.0",False
If that doesn't address the issue you have, could you load a sample of your script or a qv app that illustrates the problem?
I'm creating a word document first and then saving it as a pdf file. Something like this:
Const wdFormatPDF = 17
Set objWord = CreateObject("Word.Application")
objWord.visible = False
Set objDoc=objWord.Documents.add
Const wdOrientLandscape = 1
objDoc.PageSetup.Orientation = wdOrientLandscape
ActiveDocument.GetSheetObject("CH28").CopyBitmapToClipboard
objWord.Selection.Paste
objDoc.SaveAs "Sample.docx"
Set objDocument = objWord.Documents.Open("Sample.docx")
objWord.visible = False
objDocument.SaveAs "Sample.pdf", wdFormatPDF
Sorry for take too long to answer
Tiago
Ok....I've created an example that appears to be working as intended.
Let me know if this helps.
I'm using personal edition... can you post the macro code?
This is what the chart I was exporting looked like.
here is the macro code:
Sub createPDF
Set XWord = CreateObject("Word.Application")
XWord.Visible=false
XWord.DisplayAlerts=false
Set DocWord = XWord.Documents.add()
Const wdFormatPDF = 17
Const wdOrientLandscape = 1
DocWord.PageSetup.Orientation = wdOrientLandscape
set image = ActiveDocument.GetSheetObject("CH02")
image.CopyBitmapToClipboard
XWord.Selection.Paste
DocWord.SaveAs "c:\Sample.pdf", wdFormatPDF
msgbox "File saved to C:\Sample.pdf"
'XWord.Quit
end sub
I removed the code below from my macro and now I'm saving directly as a pdf file like you did. I still have the same problem.
objDoc.SaveAs "Sample.docx"
Set objDocument = objWord.Documents.Open("Sample.docx")
objWord.visible = False
objDocument.SaveAs "Sample.pdf", wdFormatPDF
I added the line break by concatenating my texts with a CHAR(10) + CHAR(13)
How did you your line breaks?
I was using a calculated dimension since it was only a development app with sample data.
The calculated dimension was =repeat(members&';'&chr(13)&members&';',3)
What does the value look like in a list box object?
In a list box it looks equals in the straight table.
I've tried to do something like you did but nothing changed
What word version are you using? I'm using word 2007
I'm using word 2010....
Open an instance of Word. Right-click the chart object in QV and select copy to clipboard > Image. Go to your blank word doc and paste.
Does it work doing it manually as outlined above?