DataWindow Programmers Guide

Appeon PowerBuilder® 2017 R3

FOR WINDOWS

DOCUMENT ID: DC37775-01-1700-01

LAST REVISED: January 29, 2019

Copyright © 2018 by Appeon Limited. All rights reserved.

This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement.

Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Limited.

Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Limited.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company.

Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries.

Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.

All other company and product names mentioned may be trademarks of the respective companies with which they are associated.

Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.

Appeon Limited, 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong.


Table of Contents

DataWindow and DataStore basics
About DataWindow Technology
About DataWindow objects, controls, and components
Presentation styles and data sources
Basic process
Choosing a DataWindow technology
Solutions for client/server and distributed applications
PowerBuilder DataWindow control
Using DataWindow Objects
About using DataWindow objects
Putting a DataWindow object into a control
Names for DataWindow controls and DataWindow objects
Working with the DataWindow control in PowerBuilder
Specifying the DataWindow object during execution
Accessing the database
Setting the transaction object for the DataWindow control
Retrieving and updating data
Accessing a Web service data source (Obsolete)
Importing data from an external source
Manipulating data in a DataWindow control
How a DataWindow control manages data
Accessing the text in the edit control
Manipulating the text in the edit control
Coding the ItemChanged event
Coding the ItemError event
Accessing the items in a DataWindow
Using other DataWindow methods
Accessing the properties of a DataWindow object
Handling DataWindow errors
Retrieve and Update errors and the DBError event
Errors in property and data expressions and the Error event
Updating the database
How the DataWindow control updates the database
Changing row or column status programmatically
Creating reports
Planning and building the DataWindow object
Printing the report
Using nested reports
Using crosstabs
Viewing the underlying data
Letting users redefine the crosstab
Modifying the crosstab's properties during execution
Generating HTML
Controlling display
Calling the SaveAs method
Displaying DataWindow objects as HTML forms
Dynamically Changing DataWindow Objects
About dynamic DataWindow processing
Modifying a DataWindow object
Creating a DataWindow object
Providing query ability to users
How query mode works
Using query mode
Providing Help buttons
Reusing a DataWindow object
Using DWSyntax
Describe
Modify
Create
Destroy
SyntaxFromSQL
Tips on the syntax generated by DWSyntax
Using DataStore Objects
About DataStores
Working with a DataStore
Using a custom DataStore object
Accessing and manipulating data in a DataStore
Sharing information
Example: printing data from a DataStore
Example: using two DataStores to process data
Manipulating Graphs
Using graphs
Modifying graph properties
How parts of a graph are represented
Referencing parts of a graph
Accessing data properties
Getting information about the data
Saving graph data
Modifying colors, fill patterns, and other data
Using graph methods
Using point and click
DataWindow Export/Import Template
The Export Template view for XHTML
The default XHTML export template
How tree view items are represented
Managing templates
Creating and saving templates
Selecting the template to use
Template structure
Header section
Detail section
Editing XHTML export templates
Root element
DataWindow controls
DataWindow expressions
Element attributes
Style declarations
JavaScript event handlers
CDATA sections
Element Context Menus
Selecting XHTML export templates at runtime
Exporting the DataWindow in XML or XHTML
Exporting in XML
Exporting in XHTML