Solved

Problem with saving Rich Text datawindow

Posted on 2004-08-21
17
1,835 Views
Last Modified: 2013-12-26
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
Comment
Question by:pemurray
  • 9
  • 6
  • 2
17 Comments
 
LVL 18

Expert Comment

by:diasroshan
ID: 11862593
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
 

Author Comment

by:pemurray
ID: 11864120
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
 

Author Comment

by:pemurray
ID: 11864151
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
 

Author Comment

by:pemurray
ID: 11864172
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
 

Author Comment

by:pemurray
ID: 11864175
And yes I did reboot my machine after applying the EBF.
0
 

Author Comment

by:pemurray
ID: 11864233
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 11864530
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
 

Author Comment

by:pemurray
ID: 11864570
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 18

Expert Comment

by:diasroshan
ID: 11864571
0
 

Author Comment

by:pemurray
ID: 11864728
Rosh,

Can I package this up with my executable?

Paul
0
 
LVL 18

Expert Comment

by:diasroshan
ID: 11864813
0
 

Author Comment

by:pemurray
ID: 11864853
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 11864873
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
 

Author Comment

by:pemurray
ID: 11864945
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
 
LVL 18

Expert Comment

by:diasroshan
ID: 11864997
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
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 11867503
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
 
LVL 33

Expert Comment

by:sajuks
ID: 11877589
Thanks for the points and grade.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now