Powerbuilder/DataWindow2010. 6. 9. 22:34
This statement sets the status of row 5 in the Salary column of the primary buffer of dw_history to NotModified!:

dw_history.SetItemStatus(5, "Salary", &

        Primary!, NotModified!)

This statement sets the status of row 5 in the emp_status column of the primary buffer of dw_new_hire to DataModified!:

dw_new_hire.SetItemStatus(5, "emp_status", &

        Primary!, DataModified!)

This code sets the status of row 5 in the primary buffer of dw_rpt to DataModified! if its status is currently NewModified!:

dwItemStatus l_status

l_status = dw_rpt.GetItemStatus(5, 0, Primary!)

IF l_status = NewModified! THEN

        dw_rpt.SetItemStatus(5, 0, 

            Primary!, DataModified!)

END IF

/* Modified ! */




dw_main.GetNextModified(0, Primary!)
Posted by Julyus
Powerbuilder2010. 6. 9. 17:43
lvc_data.setProperty('pgmid', Upper(this.ClassName()))
Posted by Julyus
Powerbuilder2010. 6. 7. 10:19




//wf_dddw_
Long ll_dddw_row
String ls_leac, ls_leacnm, ls_ptyp

/* 2010.06.07 by 최인욱 : 개인비용지급 구매요청 타입은 PURC로 Default처리*/
idwc_ptyp.SetFilter("f12ptyp = 'PURC'")
idwc_ptyp.Filter()
dw_main.SetTabOrder('f20ptyp', 0)
ll_dddw_row = idwc_ptyp.GetRow()

If ll_dddw_row > 0 Then
ls_ptyp = idwc_ptyp.GetItemString(ll_dddw_row, 'f12ptyp')
ls_leac = idwc_ptyp.GetItemString(ll_dddw_row, 'f12leac')
ls_leacnm = func_fin.of_get_codename('F01', ls_leac, '', '', '', '')
dw_main.SetItem(al_row, 'f20ptyp', ls_ptyp) //계정코드
dw_main.SetItem(al_row, 'tf12lna0_f12leac', ls_leac) //계정코드
dw_main.SetItem(al_row, 'tf01lna0_f01desc', ls_leacnm) //계정명
Else
// Messagebox("확인", "구매유형이 지정되지 않은 업체코드입니다.~nAR팀 홍정민씨에게 문의하시고 등록하시기 바랍니다.")
Messagebox("확인", "구매유형이 지정되지 않은 업체코드입니다.~nBP담당자에게 문의 하시기 바랍니다.")
End If
/* End of 2010.06.07 */




//postopen
//--구매유형
dw_main.GetChild ("f20ptyp", idwc_ptyp)
idwc_ptyp.SetTransObject (sqlca)

Posted by Julyus
Powerbuilder2010. 6. 1. 09:26
If KeyDown(46) Then Messagebox ('','test Delkey')

/////////////////////////////////////////////////

To: Bond numerical code often described 
  
VbKeyLButton a left mouse button 
VbKeyRButton 2 Right 
VbKeyCancel 3 CANCEL button 
VbKeyMButton four middle mouse button 
8 BACKSPACE key vbKeyBack 
VbKeyTab 9 TAB key 
VbKeyClear 12 CLEAR button 
13 ENTER key vbKeyReturn 
VbKeyShift 16 SHIFT keys 
17 CTRL key vbKeyControl 
VbKeyMenu 18 menu button 
VbKeyPause 19 PAUSE button 
CAPS LOCK key vbKeyCapital 20 
27 ESC key vbKeyEscape 
VbKeySpace 32 SPACEBAR bond 
VbKeyPageUp 33 PAGEUP bond 
VbKeyPageDown 34 PAGEDOWN bond 
35 END button vbKeyEnd 
36 HOME button vbKeyHome 
37 LEFT ARROW button vbKeyLeft 
UP ARROW button vbKeyUp 38 
RIGHT ARROW button vbKeyRight 39 
40 DOWN ARROW button vbKeyDown 
VbKeySelect 41 SELECT button 
PRINT SCREEN key vbKeyPrint 42 
EXECUTE key vbKeyExecute 43 
SNAP SHOT button vbKeySnapshot 44 
INS key vbKeyInser 45 
VbKeyDelete 46 DEL keys 
HELP button vbKeyHelp 47 
VbKeyNumlock 144 NUM LOCK keys 
  
  
A key to Z button with the value of the corresponding ASCII code 'A' to 'Z' is the same 
Numerical often described 
A key vbKeyA 65 
VbKeyB 66 B bond 
VbKeyC 67 C bond 
VbKeyD 68 D Bond 
VbKeyE 69 E bond 
VbKeyF 70 F bond 
71 G keys vbKeyG 
VbKeyH 72 H bond 
I vbKeyI 73 keys 
74 J keys vbKeyJ 
VbKeyK 75 K bond 
76 L button vbKeyL 
VbKeyM 77 M bond 
78 N bond vbKeyN 
VbKeyO 79 O bond 
80 P bond vbKeyP 
Q bond vbKeyQ 81 
82 R button vbKeyR 
VbKeyS 83 S bond 
VbKeyT 84 T Bond 
85 U keys vbKeyU 
VbKeyV 86 V bond 
W keys vbKeyW 87 
88 X button vbKeyX 
89 Y button vbKeyY 
90 Z button vbKeyZ 
  
  
0 to 9 button with the key code corresponding ASCII value of'0 'to'9' is the same 
Numerical often described 
Bond vbKey0 48 0 
VbKey1 49 1 bond 
VbKey2 50 2 keys 
VbKey3 51 3 button 
VbKey4 52 4 button 
VbKey5 53 5 keys 
VbKey6 54 6 button 
VbKey7 55 7 bond 
VbKey8 56 8 bond 
VbKey9 57 9 button 
  
  
Digital small button on the keyboard 
Numerical often described 
Bond vbKeyNumpad0 96 0 
VbKeyNumpad1 97 1 bond 
VbKeyNumpad2 98 2 keys 
VbKeyNumpad3 99 3 button 
VbKeyNumpad4 100 4 button 
VbKeyNumpad5 101 5 keys 
VbKeyNumpad6 102 6 button 
VbKeyNumpad7 103 7 bond 
VbKeyNumpad8 104 8 bond 
VbKeyNumpad9 105 9 button 
VbKeyMultiply 106 x (*) key 
VbKeyAdd 107 plus (+) key 
VbKeySeparator 108 ENTER key (in small numbers on the keyboard) 
VbKeySubtract 109 dashes (-) bond 
VbKeyDecimal 110 decimal point (.) Bond 
VbKeyDivide addition, 111 (/) key 
  
  
Function keys 
Numerical often described 
VbKeyF1 112 F1 button 
VbKeyF2 113 F2 button 
VbKeyF3 114 F3 key 
VbKeyF4 115 F4 keys 
F5 key vbKeyF5 116 
VbKeyF6 117 F6 key 
VbKeyF7 118 F7 key 
VbKeyF8 119 F8 key 
120 F9 key vbKeyF9 
121 F10 keys vbKeyF10 
122 F11 keys vbKeyF11 
123 F12 keys vbKeyF12 
124 F13 keys vbKeyF13 
125 F14 keys vbKeyF14 
126 F15 keys vbKeyF15 
127 F16 keys vbKeyF16
Posted by Julyus
Powerbuilder2010. 5. 28. 14:19
get, 폴더, Directory, dir

[Sample #1]
If is_cur_directory <> '' Then ChangeDirectory(is_cur_directory)

is_chk = 'F'
ll_rtn = GetFileOpenName("전표DETAIL DATA 찾기", &
+ ls_PathName, ls_FileName, "File", &
+ "CVS Files (*.CSV),*.CSV")
is_cur_directory= GetCurrentDirectory ()

[Sample #2]
ls_cur_directory = GetCurrentDirectory ( )
li_rtn = GetFileOpenName("Select File", &
   ls_doc_path, ls_doc_name[], "DOC", &
   + "Text Files (*.txt),*.TXT," &
   + "CSV Files (*.csv),*.CSV," &
   + "XLS Files (*.xls),*.XLS," &
   + "All Files (*.*), *.*", &
   ls_cur_directory, 18)

ChangeDirectory ( ls_cur_directory )
Posted by Julyus
Powerbuilder2010. 5. 24. 11:03




Environment env
INTEGER     resp
n_macip uo_macip

/* Variable Setting */
resp = GetEnvironment(env)     //시스템 환경을 읽어오는 함수

CHOOSE  CASE env.OSType         //OS TYPE(파워빌더는 7개 인식)
CASE aix!
    is_ostype = 'AIX'
CASE hpux!
    is_ostype = 'HPUX'
CASE macintosh!
    is_ostype = 'MacIntosh'
CASE osf1!
    is_ostype  = 'OSF1'
CASE sol2!
    is_ostype  = 'Solaris 2'
CASE Windows!
    is_ostype = 'Windows'
CASE Windowsnt!
    is_ostype  = 'Windows NT'
CASE ELSE
    is_ostype = 'etc'
END CHOOSE

uo_macip = CREATE n_macip
uo_macip.uf_getipaddr(is_ip)
uo_macip.uf_getmacaddr(is_macaddr)

gs_ip = is_ip
gs_macaddr = is_macaddr

Posted by Julyus
Powerbuilder2010. 5. 19. 11:18
Case 'gbn2'
ls_gbn2 = func.of_nvl(this.GetItemString(row, 'gbn2'   ), 'LEAC')
dw_main.SetRedraw(FALSE)
If ls_gbn2 = 'LEAC' Then
dw_main.Modify("t_leac.X='"+ String(Long(dw_main.Describe("t_prd.X")) + Long(dw_main.Describe("t_prd.Width")) + 13/*간격*/)+"'")
dw_main.Modify("t_leacnm.X='"+ String(Long(dw_main.Describe("t_leac.X")) + Long(dw_main.Describe("t_leac.Width")) + 13)+"'")
dw_main.Modify("t_dta.X='"+ String(Long(dw_main.Describe("t_leacnm.X")) + Long(dw_main.Describe("t_leacnm.Width")) + 13)+"'")
dw_main.Modify("leac.X='"+ String(Long(dw_main.Describe("prd.X")) + Long(dw_main.Describe("prd.Width")) + 13)+"'")
dw_main.Modify("leacnm.X='"+ String(Long(dw_main.Describe("leac.X")) + Long(dw_main.Describe("leac.Width")) + 13)+"'")
dw_main.Modify("dta.X='"+ String(Long(dw_main.Describe("leacnm.X")) + Long(dw_main.Describe("leacnm.Width")) + 13)+"'")
dw_main.SetSort("dcd asc, leac asc, dta asc")
dw_main.Sort()
ElseIf ls_gbn2 = 'DTA' Then
dw_main.Modify("t_dta.X='"+ String(Long(dw_main.Describe("t_prd.X")) + Long(dw_main.Describe("t_prd.Width")) + 13)+"'")
dw_main.Modify("t_leac.X='"+ String(Long(dw_main.Describe("t_dta.X")) + Long(dw_main.Describe("t_dta.Width")) + 13)+"'")
dw_main.Modify("t_leacnm.X='"+ String(Long(dw_main.Describe("t_leac.X")) + Long(dw_main.Describe("t_leac.Width")) + 13)+"'")
dw_main.Modify("dta.X='"+ String(Long(dw_main.Describe("prd.X")) + Long(dw_main.Describe("prd.Width")) + 13)+"'")
dw_main.Modify("leac.X='"+ String(Long(dw_main.Describe("dta.X")) + Long(dw_main.Describe("dta.Width")) + 13)+"'")
dw_main.Modify("leacnm.X='"+ String(Long(dw_main.Describe("leac.X")) + Long(dw_main.Describe("leac.Width")) + 13)+"'")
dw_main.SetSort("dcd asc, dta asc, leac asc") /*소트 아이템 설정*/
dw_main.Sort() /*소트하기*/
End If
dw_main.SetRedraw(TRUE)
Posted by Julyus
Powerbuilder2010. 5. 19. 11:16



IF( prd[-1] = prd, IF( long( Describe( 'Datawindow.FirstRowOnPage' ) ) = Getrow(), 1, 0 ), 1 )
DW 컬럼에 Visible에 넣어 주면 된다.

IF( prd[-1] = prd, IF( long( Describe( 'Datawindow.FirstRowOnPage' ) ) = Getrow() or dcd[-1] <> dcd, 1, 0 ), 1 )
추가적으로 내용을 넣고 싶으면 or로 묶으면 된다.
Posted by Julyus
Powerbuilder2010. 5. 19. 11:15




dw_main.SetSort("dcd asc, leac asc, dta asc") dw_main.Sort()
Posted by Julyus
Powerbuilder2010. 5. 18. 11:12
DW 프린트 할 경우 Trailer Group Column이 앞으로 밀릴때...
소계를 할 경우 앞으로 밀리고는 한다.
이럴때는 앞에 컬럼을 같은 사이즈로 만들어 주면 정상적으로 프린트가 된다.




그래도 안되는 경우가 있다.
고생 좀 했지만, 여러 삽질로 해결 봤다.
잘 안되는 컬럼을 SQL에서 뺐다가 다시 넣어보는것도 좋은 방법이다.
컬럼 제목이 하나 안 보이게 되었을때 해결을 봤다

Posted by Julyus