Datawindow to PDF in Powerbuilder 8


I am trying to find a way to export a report(DataWindow) to a PDF, but all solutions that I can find on the web is in Powerbuilder 9 or 10. Anybody know if it can be done in Powerbuilder 8, and how?

- Roar
Who is Participating?
sajuksConnect With a Mentor Commented:
The key to pdf printing from pb is to remember to've pdf driver installed and
to set the pdf printer.

dw_main.modify("Datawindow.printer = 'Adobe Acrobat writer')
In 8 you need to print to a PDF driver.  Many people use Amyuni, CutePDF, or Acrobat.  Change your printer to the PDF "printer", print the dw, then change the printer back.

Check out the printer at
We've used it in many places wherev'r the clinet required pdf printing ( prior to pb9)
You need to install pdf driver.

Also you can try the below code
// to print without user intervn you need to do some changes in registry
String ls_reg
ls_reg = "HKEY_CURRENT_USER\Software\Adobe\Acrobat PDFWriter"
RegistrySet(ls_reg, "PDFFileName", RegString!, "C:\printmypdf.pdf")
RegistrySet(ls_reg, "bDocInfo", RegString!, "0")
After that,
dw_main.object.datawindow.printer = "Acrobat PDFWriter"

Thats it, The example above assumes you've Acrobat PDFWrite as the printer name and adobe installed, the full version
If you purchase amyuni,pdf995,cutepdf you can change the name to the corresponding printer.
You will alos have to change the default printer back as per req
A split would be the proper response
RoarEngenAuthor Commented:
Sorry, I missunderstod how it worked, I thought points were awarded automatically to those who responded. I have awarded the points to you sajuks because the combination of your two posts where the ones that solved the problem for me, thank you very much!
All Courses

From novice to tech pro — start learning today.