Navigation: Ultimate Suite for PowerBuilder Help > PowerChart >

Printing

Send comments on this topic.

 

To print your graph, you can use the print() function as you would do with a regular datawindow. Nevertheless, you will often want to put your graph into a Powerbuilder report so that you can print a header, a footer and some data at the same time. To do so, you must create a sub-report datawindow object that will contain a picture object.  Then you must call  the getpngfilename() function that will export the graph in a .png temporary file. And last but not least, assign the filename to your report picture object. If you want it to be done immediately after your window opened, you must code this in the "Displayed" event of your chart.js datawindow, otherwise, you can code it in an event triggered by the user.

"Displayed" event:

string ls_file_name

ls_file_name  = dw_chart_js.getpngfilename()

dw_1.object.dw_2[1].object.p_graph.filename =ls_file_name


Copyright © 2021 Werysoft Inc.