Printing data

You can use a DataStore to print data on a remote server if the server is running on Windows or Solaris.

NotePlatform note The following example would not work on HP-UX or AIX. On these platforms, EAServer uses a windows-free version of the PowerBuilder runtime environment that does not provide support for graphical operations such as printing. Printing using DataStore print functions is currently supported only on Solaris. However, DataStore objects can be printed on all UNIX platforms using the SaveAs function with the PDF SaveAsType.

For more information, see “Printing to PDF”.

In this example, the server component uo_employees has a function called print_employees. print_employees generates an instance of the DataStore ds_datastore, and then prints the contents of this DataStore.

Here is the signature of the print_employees function:

print_employees( ) returns integer

Here is the script for the print_employees function:

datastore ds_datastore
int li_rc
ds_datastore = create datastore
ds_datastore.dataobject = "d_empdata"
ds_datastore.SetTransObject (SQLCA)
ds_datastore.Retrieve()
li_rc = ds_datastore.Print()
return li_rc