if you use :-
dw_1.enabled = False //the whole datawindow object will be disabled including scrollbars
instead of that use below :-
dw_1.Object.DataWindow.ReadOnly = "yes"
//the scroll bar will still work and you can scroll up and down the datawindow
to set enable again :_
dw_1.Object.DataWindow.ReadOnly = "no"
Showing posts with label Datawindow. Show all posts
Showing posts with label Datawindow. Show all posts
Tuesday, August 16, 2011
Monday, May 24, 2010
Display as Picture property in Column Datawindow
//1. your datawindow SQL like below, where the picture name is 00001.jpg, 00002.jpg and so on...
SELECT a.staffno, a.name, ('images\staff\'||a.staffno||'.jpg') as gambar
FROM staff a
//2. the pictures located in subdirectory images\staff\
SELECT a.staffno, a.name, ('images\staff\'||a.staffno||'.jpg') as gambar
FROM staff a
//2. the pictures located in subdirectory images\staff\
//3. At column property, check Display as picture
//4. Output of datawindow will be like below...
//4. Output of datawindow will be like below...
Monday, April 26, 2010
Using OLE Blob in Powerbuilder 10 using Oracle 10g
In datawindow, you might want to have OLE column that display such as picture of staff department.
These are the step to do it :-
These are the step to do it :-

1. When building datawindow select the ID number (in my case staff number) without selecting the blob / longraw (in Oracle 10g) column.
2. Make sure the table have primary key (staff id), and update properties for datawindow as below :-
2. Make sure the table have primary key (staff id), and update properties for datawindow as below :-

3. Add an OLE column from menu Insert->Control->OLE Database Blob.
4. As below the properties for OLE column (select blob column from the same table)
4. As below the properties for OLE column (select blob column from the same table)

5. Key Clause: [primary key for blob table = :primary key for update in datawindow]
6. Client Name Expression : used when opening paintbrush application to update to which staff number such as below (after running your application)
6. Client Name Expression : used when opening paintbrush application to update to which staff number such as below (after running your application)

7. Paintbrush appears when double-click on OLEblob column

8. You can paste a picture or select paste from file...
9. Update back to datawindow by clicking menu in paint such below, then exit paint.
9. Update back to datawindow by clicking menu in paint such below, then exit paint.

10. When return to datawindow, you have blob picture in you application!
11. Remember to save you datawindow by using dw_1.update() then commit using sqlca;
or the picture will not be updated into your database.
12. This feature doesnt not supported by Appeon till now (version 6.2)
11. Remember to save you datawindow by using dw_1.update() then commit using sqlca;
or the picture will not be updated into your database.
12. This feature doesnt not supported by Appeon till now (version 6.2)
Wednesday, March 24, 2010
Crosstab and having SQL that display star rating
//lets say we have this SQL in crosstab datawindow in Powerbuilder (i'm using 10.2.x)
select a.KOD, d.PIHAK , c.JUMBINTANG, c.MULA, c.AKHIR, a.KOD_JENIS, e.SINGKATN, to_char(b.TKH_SEMASA, 'yyyy') as compute_0008_year
from main a, semasa b, star c, pihak d, kdfaklt e
where a.KOD = b.KOD (+)
and b.SEMASA is not null
and a.PIHAK = d.PIHAK (+)
and a.PTJ = e.KDFKLT
having (count(to_char(b.TKH_SEMASA, 'yyyy')) between c.mula and c.AKHIR)
group by a.KOD, d.PIHAK , c.JUMBINTANG, c.MULA, c.AKHIR, a.KOD_JENIS, e.SINGKATN, to_char(b.TKH_SEMASA, 'yyyy')
order by to_char(b.TKH_SEMASA, 'yyyy'), a.KOD_PEKA
//your crosstab definition is like this

//you have datawindow output like this

//in a dialogbox format property of the displayed number in datawindow code this:-
select a.KOD, d.PIHAK , c.JUMBINTANG, c.MULA, c.AKHIR, a.KOD_JENIS, e.SINGKATN, to_char(b.TKH_SEMASA, 'yyyy') as compute_0008_year
from main a, semasa b, star c, pihak d, kdfaklt e
where a.KOD = b.KOD (+)
and b.SEMASA is not null
and a.PIHAK = d.PIHAK (+)
and a.PTJ = e.KDFKLT
having (count(to_char(b.TKH_SEMASA, 'yyyy')) between c.mula and c.AKHIR)
group by a.KOD, d.PIHAK , c.JUMBINTANG, c.MULA, c.AKHIR, a.KOD_JENIS, e.SINGKATN, to_char(b.TKH_SEMASA, 'yyyy')
order by to_char(b.TKH_SEMASA, 'yyyy'), a.KOD_PEKA
//your crosstab definition is like this

//you have datawindow output like this

//but you want an output like below?
//in a dialogbox format property of the displayed number in datawindow code this:-
Monday, January 18, 2010
To Enable/disable Editing on new/existing row in datawindow
//In your datawindow write this code in your column property, in ->General->protect
if (isRowNew(), 0, 1)
//this will enable editing on newrow and disable editing on existing row
//write code in each column to enable/disable editing for a row...
//you can put other conditions like calculation such as
if (columnname = 'Admin', 0, 1)
Tuesday, October 13, 2009
Dynamic runtime modifying SQL in datawindow
//let say we have these codes in open window event
string ls_code, ls_SQL, ls_newSQL
ls_code = message.stringparm
dw_1.settransobject(sqlca)
//get existing SQL from dw_1
ls_SQL = dw_1.getsqlselect( )
ls_code = message.stringparm
dw_1.settransobject(sqlca)
//get existing SQL from dw_1
ls_SQL = dw_1.getsqlselect( )
//dynamicly modify SQL in datawindow by adding where statement...
if ls_code = '-' then
ls_newSQL = ls_SQL + " where b.KOD_JENIS IS NULL order by b.KOD_PEKA"
else
ls_newSQL = ls_SQL + " where b.KOD_JENIS = '"+ls_code+"' order by b.KOD_PEKA"
end if
//sets new SQL to dw_1
dw_1.setsqlselect(ls_newSQL)
dw_1.retrieve()
if ls_code = '-' then
ls_newSQL = ls_SQL + " where b.KOD_JENIS IS NULL order by b.KOD_PEKA"
else
ls_newSQL = ls_SQL + " where b.KOD_JENIS = '"+ls_code+"' order by b.KOD_PEKA"
end if
//sets new SQL to dw_1
dw_1.setsqlselect(ls_newSQL)
dw_1.retrieve()
/* example that you have this SQL in dw_1
select b.KOD, b.KOD_JENIS,
(select c.PIHAK from ppihak c where c.KOD_PIHAK = b.KOD_PIHAK) as pihak,
b.KOD_PTJ, b.TKH_TTGN, b.TKH_TAMAT, b.TKH_UPDATE, b.ID_UPDATE
from pmain b
(select c.PIHAK from ppihak c where c.KOD_PIHAK = b.KOD_PIHAK) as pihak,
b.KOD_PTJ, b.TKH_TTGN, b.TKH_TAMAT, b.TKH_UPDATE, b.ID_UPDATE
from pmain b
*/
Wednesday, July 9, 2008
Tuesday, July 1, 2008
Row Counting Problem in Datawindow for Powerbuilder
Do you want your datawindow report looks like this :
/*
Header Row No :- cumulativesum(1 for all DISTINCT groupname)
Group Row No :- cumulativesum(1 for group 1)
*/

/*
Header Row No :- cumulativesum(1 for all DISTINCT groupname)
Group Row No :- cumulativesum(1 for group 1)
*/
Stripe Color in Datawindow

in datawindow properties > general.color
if (mod (getrow(), 2) = 0, RGB(192,192,192), RGB(255, 255, 255))
or
put a coloured rectangle in datawindow band and send it to back, in visible properties of the rectangle put this code :
if (mod (getrow(), 2) = 0, 1, 0)
Subscribe to:
Posts (Atom)





