|
|
Script Editor Colors: (by Tom Alexander): Although the script editor in Powerbuilder uses color to aid readablility of your code, they chose some colors outside the 256 color pallette. In order to see all of the colors PB uses, you must have your display settings defined to at least 'True Color' (24 bit).
PowerBuilder OLE Automation with Microsoft products: (by Pramod Gurshaney): First see Document ID: 44471 on Sybase support for PowerBuilder. This document should get you started. (This document uses Excel as an example). After reading the doc you should be able to do basic tasks like Ole Connect to the OLE server application. Now to do advanced tasks like doing a SaveAs, selecting objects etc, create a macro to do the task in the Microsoft application. Edit the macro and get the VBA code. With a little tweaking you should be able to use that code in your PowerBuilder application. Thus, you now have the same OLE capabilties as a VB app would have, without doing any research or spending time to figure out the solution.
The best way to scroll to
the last page in a composite report: (by Bill Collins and Carl
Kessler): Problem:
On a composite datawindow, when you try to scroll to the last
page, it doesn't work. Our powerscript to scroll to the last page
was setup as follows:
LONG ll_Row
ll_Row = my_dw.RowCount()
my_dw.ScrollToRow( ll_Row)
That script worked fine until someone tried it against a
composite datawindow. A composite datawindow only ever has
one row, so RowCount() returns 1. When you scrolltorow(1),
you end up on the first page. ScrollToRow will move to the
last page if you pass a number greater than the RowCount.
So we took our row count variable and added one to it.
This powerscript worked with regular datawindows as well
composites:
LONG ll_Row
//Get the rowcount
ll_Row = my_dw.RowCount()
//Add one to the rowcount
ll_Row++
//Scroll to a row past the end of the last row, will put you on
the last page regardless of dw type
my_dw.ScrollToRow( ll_Row)
'?' in db error: (from Pramod Gurshaney): If you are wondering at what '?' represents whenever you get a db error containing a similar error to 'INSERT INTO "project" ("proj_number", proj_desc) VALUES (?, ?)' then add DisableBind=1 to your transaction object's DBPARM value and you will see the actual values instead of '?'. Usually this value is set in your application's ini file making it easy to toggle and see the change next time you start the application.
[ Home ] [ Next Meeting ] [ Presentations ] [ Hot Tips ]