Solved

powerbuilder datastore print to file in pcl format

Posted on 2010-08-16
5
981 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 18

Expert Comment

by:diasroshan
ID: 33452749
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
ID: 33453899
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
ID: 33462021
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
ID: 33462139

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
ID: 33486268
Hi Rosh:
   Removing the return value worked.
Thank you
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
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: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

749 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