Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2061
  • Last Modified:

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:\CORPORATE_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\!Letters\dw_one.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
0
pemurray
Asked:
pemurray
  • 9
  • 6
  • 2
1 Solution
 
diasroshanCommented:
hi paul,
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
0
 
pemurrayAuthor Commented:
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
0
 
pemurrayAuthor Commented:
I added the following code to check for errors:

int rtncode

//dw_1.SaveAs("T:\CORPORATE_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\!Letters\dw_one.xls", Excel!, FALSE)
rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Letters\dw_one.pdf", PDF!, FALSE)
//rtncode = dw_1.SaveAs("C:\Documents and Settings\Administrator\My Documents\!GT3\ImTrak\!Letters\" + 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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pemurrayAuthor Commented:
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.
0
 
pemurrayAuthor Commented:
And yes I did reboot my machine after applying the EBF.
0
 
pemurrayAuthor Commented:
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.

0
 
diasroshanCommented:
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
0
 
pemurrayAuthor Commented:
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.Print.CanUseDefaultPrinter = "NO"
dw_1.Object.DataWindow.Print.Orientation = 1
dw_1.Object.DataWindow.Print.PrinterName = "ACROBAT PDFWRITER"
//dw_1.Object.DataWindow.Print.PrinterName = "Sybase DataWindow PS"
//dw_1.Object.DataWindow.Print.PrinterName = "Acrobat Distiller"

dw_1.Object.DataWindow.Print.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
0
 
diasroshanCommented:
0
 
pemurrayAuthor Commented:
Rosh,

Can I package this up with my executable?

Paul
0
 
diasroshanCommented:
0
 
pemurrayAuthor Commented:
I tried that along with the XOL... option

dw_1.object.DataWindow.Export.PDF.Method = Distill!

No help...

Have you been able to do this?

Thanks!

Paul
0
 
diasroshanCommented:
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
0
 
pemurrayAuthor Commented:
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
0
 
diasroshanCommented:
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
0
 
sajuksCommented:
integer li
dw_1.object.DataWindow.Export.PDF.Method = Distill!
 li = dw_1.SaveAs("c:\dw.pdf", PDF!, true )
works for Pb9.0.1 build 7171.

Check a few things:
1.Acrobat Professional 6.0 with distiller installed
2. Is ghost script installed ?

 Run gs705w32.exe to install Ghostscript on your system.

 Add the gs7.05\bin directory to your system PATH environment variable.

 The Adobe PostScript drivers used in this feature are installed in Sybase\Shared\PowerBuilder\drivers".  Create a folder say "pdfdrivers" in the directory where the PB runtime DLLs are located, and
copy the contents of "Sybase\Shared\PowerBuilder\drivers" to the "pdfdrivers" folder.


Also http://www.sybase.com/detail?id=1026721#BABGDBHJ
0
 
sajuksCommented:
Thanks for the points and grade.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 9
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now