pemurray
asked on
Problem with saving Rich Text datawindow
All,
I am attempting to save a rich text datawindow without any success and no apparent errors. Here is the code:
//dw_1.SaveAs("T:\CORPORAT E_CLIENTS\ !LETTERS\" + COMPANY + ".PDF",PDF!, FALSE)
messagebox("The Path Is:","C:\" + COMPANY + ".PDF")
//dw_1.SaveAs("C:\" + COMPANY + ".PDF",PDF!, FALSE)
dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let ters\dw_on e.pdf", PDF!, FALSE)
I click on the command button with which the code is associated, but nothing seems to happen. I have tried opening windows explorer and clicking F5 button cannot find anything.
Please help!!
Paul
I am attempting to save a rich text datawindow without any success and no apparent errors. Here is the code:
//dw_1.SaveAs("T:\CORPORAT
messagebox("The Path Is:","C:\" + COMPANY + ".PDF")
//dw_1.SaveAs("C:\" + COMPANY + ".PDF",PDF!, FALSE)
dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let
I click on the command button with which the code is associated, but nothing seems to happen. I have tried opening windows explorer and clicking F5 button cannot find anything.
Please help!!
Paul
ASKER
Hi Rosh,
I applied the EBF.
Then I tried saving the document as Excel and it did write out a file that I was able to open in Excel, although I did notice that only the mail merger fields were saved (who knows, maybe that is the intent).
I then tried saving it as file type PDF! with no success. Is it possible that having Adobe Acrobat on my machine would prevent it from working?
Thanks!
Paul
I applied the EBF.
Then I tried saving the document as Excel and it did write out a file that I was able to open in Excel, although I did notice that only the mail merger fields were saved (who knows, maybe that is the intent).
I then tried saving it as file type PDF! with no success. Is it possible that having Adobe Acrobat on my machine would prevent it from working?
Thanks!
Paul
ASKER
I added the following code to check for errors:
int rtncode
//dw_1.SaveAs("T:\CORPORAT E_CLIENTS\ !LETTERS\" + COMPANY + ".PDF",PDF!, FALSE)
//messagebox("The Path Is:","C:\" + COMPANY + ".PDF")
//dw_1.SaveAs("C:\" + COMPANY + ".PDF",PDF!, FALSE)
//rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let ters\dw_on e.xls", Excel!, FALSE)
rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let ters\dw_on e.pdf", PDF!, FALSE)
//rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let ters\" + company + " CTM Letter to Service Providers.pdf", PDF!, FALSE)
messagebox("Return Code for SaveAs = ",string(rtncode))
When I save as Excel! I get a return code of 1. When I as PDF! I get a return code of -1.
int rtncode
//dw_1.SaveAs("T:\CORPORAT
//messagebox("The Path Is:","C:\" + COMPANY + ".PDF")
//dw_1.SaveAs("C:\" + COMPANY + ".PDF",PDF!, FALSE)
//rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let
rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let
//rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Let
messagebox("Return Code for SaveAs = ",string(rtncode))
When I save as Excel! I get a return code of 1. When I as PDF! I get a return code of -1.
ASKER
I also eliminated the arguments to the SaveAs function which causes Powerbuilder to push a Save As Dialog Navigation Box that allows you to type in the name of the file and select PDF as the save as file type.
rtncode = dw_1.SaveAs()
Unfortunately, I still got the return code of -1.
rtncode = dw_1.SaveAs()
Unfortunately, I still got the return code of -1.
ASKER
And yes I did reboot my machine after applying the EBF.
ASKER
I tried saving the document as text (which worked) but I notice that it is not saving the text of my mail merged letter. It only saves the fields which is not what I would want even if I could save as PDF.
When I print the document it works fine showing a perfectly formatted / merged letter.
Also, I found this in the documentation which seems to conflict with the SaveAs dialog box:
Using GNU Ghostscript
By default, when you select File>Save Rows As and select PDF as the file type, the data is printed to a PostScript file and automatically distilled to PDF using GNU Ghostscript.This option provides a robust solution that can save most types of DataWindow objects.
Limitations
The Ghostscript method currently does not support OLE and RichText DataWindow objects. The XSL-FO method currently does not support OLE, RichText, graph, and composite DataWindow objects.
When I print the document it works fine showing a perfectly formatted / merged letter.
Also, I found this in the documentation which seems to conflict with the SaveAs dialog box:
Using GNU Ghostscript
By default, when you select File>Save Rows As and select PDF as the file type, the data is printed to a PostScript file and automatically distilled to PDF using GNU Ghostscript.This option provides a robust solution that can save most types of DataWindow objects.
Limitations
The Ghostscript method currently does not support OLE and RichText DataWindow objects. The XSL-FO method currently does not support OLE, RichText, graph, and composite DataWindow objects.
hi,
well... going thru the net i have come across some limitations of Rich text datawindows...
please refer the following... could be of some help...
http://www.pmsys.com/pb/tips/rteissue.htm
Paul, tell me one more thing...
why have u made a dw of type rich text and why r u saving it as pdf....
probably i could give u a workaround...
Cheers,
Rosh
well... going thru the net i have come across some limitations of Rich text datawindows...
please refer the following... could be of some help...
http://www.pmsys.com/pb/tips/rteissue.htm
Paul, tell me one more thing...
why have u made a dw of type rich text and why r u saving it as pdf....
probably i could give u a workaround...
Cheers,
Rosh
ASKER
Well, I think I found just a ridiculous solution to the problem.
I installed Adobe Acrobat and am simply printing to the ACROBAT PDFWRITER. There were other printers out there (not sure where they came from) but printing to Sybase DataWindow PS did not work at all and printing to Acrobat Distiller ended up with the document being printed at about 1/100 of its normal size.
dw_1.Object.DataWindow.Pri nt.CanUseD efaultPrin ter = "NO"
dw_1.Object.DataWindow.Pri nt.Orienta tion = 1
dw_1.Object.DataWindow.Pri nt.Printer Name = "ACROBAT PDFWRITER"
//dw_1.Object.DataWindow.P rint.Print erName = "Sybase DataWindow PS"
//dw_1.Object.DataWindow.P rint.Print erName = "Acrobat Distiller"
dw_1.Object.DataWindow.Pri nt.Prompt = "YES"
dw_1.print()
I don't consider this a real solution but I can use it until someone can hopefully point a better solution.
Paul
I installed Adobe Acrobat and am simply printing to the ACROBAT PDFWRITER. There were other printers out there (not sure where they came from) but printing to Sybase DataWindow PS did not work at all and printing to Acrobat Distiller ended up with the document being printed at about 1/100 of its normal size.
dw_1.Object.DataWindow.Pri
dw_1.Object.DataWindow.Pri
dw_1.Object.DataWindow.Pri
//dw_1.Object.DataWindow.P
//dw_1.Object.DataWindow.P
dw_1.Object.DataWindow.Pri
dw_1.print()
I don't consider this a real solution but I can use it until someone can hopefully point a better solution.
Paul
hi paul,
also refer the following URL...
http://sybooks.sybase.com/onlinebooks/group-pb/pbr0900e/pbentrb/@Generic__BookTextView/1015
Rosh
also refer the following URL...
http://sybooks.sybase.com/onlinebooks/group-pb/pbr0900e/pbentrb/@Generic__BookTextView/1015
Rosh
ASKER
Rosh,
Can I package this up with my executable?
Paul
Can I package this up with my executable?
Paul
Also refer,
https://www.experts-exchange.com/questions/21073612/Datawindow-to-PDF-using-Acrobat-Distiller-without-the-dialog-box-to-save-the-file.html
might be of some help...
Rosh
https://www.experts-exchange.com/questions/21073612/Datawindow-to-PDF-using-Acrobat-Distiller-without-the-dialog-box-to-save-the-file.html
might be of some help...
Rosh
ASKER
I tried that along with the XOL... option
dw_1.object.DataWindow.Exp ort.PDF.Me thod = Distill!
No help...
Have you been able to do this?
Thanks!
Paul
dw_1.object.DataWindow.Exp
No help...
Have you been able to do this?
Thanks!
Paul
hi paul,
i dont have PB 9 so cannot try it out myself...
but if u can answer my earlier post i can give u a work around if i know why u r using pdf..
Rosh
i dont have PB 9 so cannot try it out myself...
but if u can answer my earlier post i can give u a work around if i know why u r using pdf..
Rosh
ASKER
Sorry, there are so many posts I don't know which you mean.
Have you been able to do this in any PB version?
Paul
Have you been able to do this in any PB version?
Paul
Paul, tell me one more thing...
why have u made a dw of type rich text and why r u saving it as pdf....
probably i could give u a workaround...
Cheers,
Rosh
why have u made a dw of type rich text and why r u saving it as pdf....
probably i could give u a workaround...
Cheers,
Rosh
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points and grade.
first apply the patch like i have given in ur word document related post...
now what u need to try is to save the dw in some other format which is widely used like excel...
so do as follows...
dw_1.SaveAs() // don't hardcode the path or filetype
with this code it will prompt u to give a file name and also select file type as excel...
now check if it has successfully saved as excel....
well if this works then try again saving as pdf...
let me know if it works...
Cheers,
Rosh