Title: PWB511 You Can Do That in InfoMaker? Cool!
1PWB511You Can Do That in InfoMaker? Cool!
Terry Dykstra Database Administrator tddykstra_at_for
estoil.ca / (403) 292-8107 August 2003
2You Can Do That in InfoMaker? Cool!
- Whats new in release 9 901
- Customization
- Custom Form Styles
- Modifying Imstyle9.pbl
- Modifying Environment
3Whats New In Release 9?
- Save As PDF, XSL-FO, XML
- Import CSV, XML
- PBD in LibraryList
- DataWindow ActiveX
- Executable enhancements
- Versioning
- (De)Select All Items
- DataWindow enhancements
- Hardcode printer name
- Collate copies
- Database driver enhancements
4Whats New In Release 9.0.1?
- XP look and feel
- Insert / Delete clause in SQL painter
- Save Rows As Excel8 (97 / 2000 / XP / 2003)
- Deployment libjsybheap.dll no longer required.
Functionality has been moved into pbvm90.dll
5DataWindow ActiveX
Display PSR
- Alternative to DataWindow plugin (npdweXX.dll)
for use in Internet Explorer - psdwc90.cab and psdwc90.dll file in
Sybase\Shared\PowerBuilder - ltOBJECT IDIMDWC1" WIDTH1058 HEIGHT668
- CLASSID"CLSID99991503-9999-1000-8000-0800
09AC61A9"gt - ltPARAM NAME"_Version" VALUE"65536"
- ltPARAM NAME"_ExtentX" VALUE"22400"gt
- ltPARAM NAME"_ExtentY" VALUE"14145"gt
- ltPARAM NAME"_StockProps" VALUE"2"gt
- ltPARAM NAME"DataWindowObject"
VALUE"d_employees.psr"gt - lt/OBJECTgt
- The CLSID is that of the PSDWC90.DLL file after
registering. The DataWindowObject parameter
specifies the name of the PSR file to display.
6DataWindow ActiveX
Dynamic Reporting
- Actual connection to a database
- Requires JDBC
- Include command buttons for navigation, filtering
etc. - Not mentioned in InfoMaker documentation
7DataWindow ActiveX
Dynamic Reporting Versus Static PSR
- Static (PSR)
- ltPARAM NAME"DataWindowObject" VALUE"d_employees.
psr"gt - Dynamic
- ltPARAM NAME"SourceFileName" VALUE"im9_example.pb
l"gtltPARAM NAME"DataWindowObject"
VALUE"d_glhead"gtltPARAM NAME"LogId"
VALUE"hr"gtltPARAM NAME"LogPass"
VALUE"hr"gtltPARAM NAME"dbParm"
VALUE"Driver'oracle.jdbc.driver.OracleDriver',UR
L'jdbcoraclethin_at_127.0.0.11521PO92'"gt
8DataWindow ActiveX
Distributing CAB File using CODEBASE attribute
- Use the CODEBASE attribute in the Object element
to identify a file to be downloaded. After the
browser downloads the CAB file, it unpacks it and
registers the ActiveX controls in the user's
system registry. - The value for CODEBASE has the format
urlversion - CODEBASE"cabs/psdwc90.cab9,0,1,6520"
- The URL is the location of the DataWindow
control's CAB file on your Web server. It can be
an absolute or relative URL. - The version is a set of four numbers, separated
by commas. The numbers must match the version of
the CAB file ( same as the InfoMaker version). - Create additional cab files using MS Cabinet tool
- http//msdn.microsoft.com/library/default.asp?url
/workshop/delivery/osd/overview/osd.asp - http//msdn.microsoft.com/library/default.asp?url
/library/en-us/vstool1/html/veovrcreatingcustompac
kages.asp
9DataWindow ActiveX Demo
10Customizing InfoMaker
Three Methods
- Custom formstyles
- Modifying imstyle9.pbl
- Modifying the environment
11Custom Form Styles
What is a Custom Form Style?
- A window A menu
- Window needs to be saved with a comment starting
withStyle ..
12Custom Form Styles
DataWindow Control Naming Conventions
- Freeform
- Gridstyle
- One-to-many
- Many-to-one
- dw_freeform
- dw_grid dw_freeform
- dw_master_12many dw_detail_12many
- dw_master_many21 dw_detail_many21
13Custom Form Styles
Other Rules
- Command buttons on forms use Actions
- An Action public function on the window
14Custom Form Styles Demo 1
15Custom Form Styles Demo 1
- PB versus IM library painter
- Quick build using freeform w_form1
- Add an Action
- Save using comment styledemo1
- Build a form in IM
- Notice that SQL painter gets invoked automatically
16Custom Form Styles
Non Standard Forms
- Using non standard dw-control naming convention
- No need to SQLCA
- IM will add code automatically
- call superopendw_drilldown.SetTransObject(sqlca
)dw_drilldown.Retrieve()
17Custom Form Styles
Non Standard Forms
- Two functions automatically created
- Close()
- Print_setup()
18Custom Form Styles Demo 2
19Custom Form Styles Demo 2
- Quick build using w_drilldown
- Notice the following in PB
- No code in open event of w_drilldown
- Notice the following in IM
- The SQL painter does not get invoked
- In the IM form code has been generated
automatically
20Modifying Imstyle9.pbl
What is the Imstyle9.pbl?
- Class library
- Determines the functionality of exes created
- Does not affect the development environment,
except for forms
21Modifying Imstyle9.pbl
Why Modify the Imstyle9.pbl?
- Provide additional functionality, e.g.
- custom saveas(xml!)
- e-mail
- easy filter screen
- Work around bugs, issues, e.g.
- groupcalc() after retrieve()
22Modifying Imstyle9.pbl
What are the limitations?
- Cannot modify the default application script
- Cannot modify the default project. Creates 1 exe
using machine code - No PBD, PBR
- but you can add PBD use SetLibraryList() in
w_pbstyle_ancestor_frame - No global variables
- No global external function declaration
23Modifying Imstyle9.pbl
What are the limitations contd?
- No dynamic assignments, e.g.
- dw_1.dataobject d_myreport
- Upgrading to newer version of Infomaker requires
you to redo all your work in the new
imstyleX.pbl. Get PBDelta
(www.pbdr.com)
24Customizing Imstyle9.pbl Demo 3
- Easy Filter / Saveas (XML)
25Modifying The Environment
- What they did not teach you at Sybase
University - DisclaimerThis is totally unsupported!No
guarantee this will work in the futureProceed
with caution!
26Modifying The Environment
Understanding toolbars
- Where are toolbar settings stored?
- Hkey_current_user\Software\Sybase\Infomaker\9.0\T
oolbar - Toolbars are identified by numbers
- Icons on the toolbar are in the Items string
value - Default toolbars might not be shown in the
registry
27Modifying The Environment
Understanding toolbars
- InfoMaker
- 1000 Powerbar
- 1004 Library
- 1007 Report
- 1010 Form
- PowerBuilder
- 1000 Powerbar
- 1011 Library
- 1006 Datawindow
- 1037 Window
28Modifying The Environment
Understanding items on the toolbar
- 3 or 4 digit number
- -1 for separator
- Examples
- 1468 tab order
- 1476 picturehyperlink
- 1614 export
29Modifying The Environment
Understanding items on the toolbar contd
- Many will crash IM, e.g. 1076 project
- Others will fail, e.g. 1618 Import
- Some will do nothing, e.g. 1622 check in
30Modifying The Environment
Understanding layouts
- Where are default layout settings stored?
- Hkey_current_user\Software\Sybase\Infomaker\9.0\l
ayout\default - Where are custom layout settings stored?
- Hkey_current_user\Software\Sybase\Infomaker\9.0\l
ayout\form - Hkey_current_user\Software\Sybase\Infomaker\9.0\l
ayout\datawindow
31Modifying The Environment
Changing layouts
- Borrow the default layout from PB Window registry
- Apply to the custom IM form layout
- Magic happens you can now write code in IM
forms!
32Modifying The Environment
Changing layouts
- Limitations
- When you create a new form in IM, you must use
the default format.If you try to build a form
using the custom (ie script enabled) format, it
will fail! - Property views are not always identical between
IM PB - Typically fewer parameters are available, e.g.
you cannot change the name of objects - Accessing scripts is awkward
- Select item in Control List, Then go to Event List
33Modifying The Environment Demo 4
34Debugging InfoMaker
- Default Application Open script
- window w_localToolBarTextTrueExeNametestit.ex
e"IniNametestit.ini".. - connectif sqlca.sqlcode 0 thenOpenWithParm(w_
local,ExeName,"w_pbstyle_frame")else..
35Debugging Infomaker
- There is no w_pbstyle_frame in
- imstyle9.pbl or
- the Infomaker users pbl
- It exists in the exe created by Infomaker!
36Debugging Infomaker
Solution
- Include the exe in your library list
- The target needs to include
- yourimwork.pbl
- imstyle9.pbl
- yourimwork.exe
- Now you can debug your code
- You can even look at the code in the exe!
37Debugging Infomaker
38OTHER RESOURCES
- Application Techniques Manual PB9Chapter 37
Building InfoMaker Styles and Actions - Newsgroups forums.sybase.com
- SDN
- CodeExchange
- PowerBuilder 9 Client Server Development,Chapter
4
39SDN Presents CodeXchange
A New Benefit for Sybase Developers
- Forum for exchanging samples, tools, scripts,
etc. - New features enable community collaboration
- Download samples created by Sybase or external
users - Leverage contributions of others to extend Sybase
products - Contribute code or start your own collaborative /
open source project with input from other product
experts - Any SDN member can participate
- Log in using your MySybase account via SDN
- www.codexchange.sybase.com
- Or via SDN at www.sybase.com/developer
- SDN CodeXchange at TechWave
- Visit SDN in the Technology Boardwalk
- Learn about CodeXchange in the Sybase Booth
Theater