Solved

powerbuilder datastore print to file in pcl format

Posted on 2010-08-16
5
949 Views
Last Modified: 2013-12-26
Hi Folks:
   I need to do a "print to file" of a datastore and it has to be in the PCL format. I have tried
  "lds_data_store.Object.DataWindow.Print.Filename" but the code fails.
   Can you help?
Thanks
0
Comment
Question by:noreenburke
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:diasroshan
Comment Utility
Hi,

Datastore ds_1

ds_1 = Create Datastore
ds_1.DataObject = 'd_test
ds_1.SetTransObject(SQLCA)
ds_1.Retrieve()
ds_1.Object.DataWindow.Print.FileName = "C:\123.pcl"
ds_1.Print()


I tried the above code and it creates a file 123.pcl which i can open with Microsoft Office Document Imaging and print it!

Are u geting any error?

Cheers,
Rosh
0
 

Author Comment

by:noreenburke
Comment Utility
Hi Rosh::
  This is the code that I am running:
n_ds      lds_report_data_store
lds_report_data_store = CREATE n_ds
lds_report_data_store.DataObject = ls_datawindow_name
lds_report_data_store.SetTransObject(SQLCA)
ll_retrieve_return = lds_report_data_store.Retrieve(ldt_report_date)
lds_report_data_store.Object.DataWindow.Print.Orientation = li_printer_paper_orientation
lds_report_data_store.Object.DataWindow.Print.Duplex = li_printer_simplex_duplex
lds_report_data_store.Object.DataWindow.Print.Paper.Size = li_printer_paper_size

lb_test_bills = lds_report_data_store.Object.DataWindow.Print.Filename = "c:\test_lib\test_report.pcl"

lb_test_bills is now "False"

Thanks for your help

0
 
LVL 18

Expert Comment

by:diasroshan
Comment Utility
Hi,

did u try the code that ive pasted above?

If it works fine for u, then guess the problem could be with using a datastore user object.

First try the code ive given above and let me know if its works for u. Then we cud take it further from there to make ur code work!

Cheers,
Rosh
0
 
LVL 18

Accepted Solution

by:
diasroshan earned 500 total points
Comment Utility

Also,
Try the below code without checking for lb_test_bills, it worked for me.

n_ds      lds_report_data_store
lds_report_data_store = CREATE n_ds
lds_report_data_store.DataObject = ls_datawindow_name
lds_report_data_store.SetTransObject(SQLCA)
ll_retrieve_return = lds_report_data_store.Retrieve(ldt_report_date)
lds_report_data_store.Object.DataWindow.Print.Orientation = li_printer_paper_orientation
lds_report_data_store.Object.DataWindow.Print.Duplex = li_printer_simplex_duplex
lds_report_data_store.Object.DataWindow.Print.Paper.Size = li_printer_paper_size

lds_report_data_store.Object.DataWindow.Print.Filename = "c:\test_lib\test_report.pcl"
lds_report_data_store.Print()


Cheers,
Rosh
0
 

Author Comment

by:noreenburke
Comment Utility
Hi Rosh:
   Removing the return value worked.
Thank you
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 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

6 Experts available now in Live!

Get 1:1 Help Now