Q&A

  • text 화일 작성시 전자로 작성할수 있는 방법좀..
with Mis_fQuery do begin

Close;

Sql.Clear;

Sql.Add('select a.group_code, a.user_code, a.user_group, ' +

'a.pay_date, a.bill_pay, a.billpay_ck, a.user_no1, ' +

'a.user_no2, a.user_transbank, a.user_transcode, ' +

'b.user_up_name, b.user_jong_name, b.user_address,' +

'b.user_name, b.user_chief from eos_ea21 a, mst_user b ' +

'where a.pay_date like ' + '''' + date_s + '''' +

// 'and a.billpay_ck = ' + '''' + ck_n + '''' +

' and (a.group_code = b.group_code) ' +

'and (a.user_code = b.user_code) ' +

'order by a.group_code, a.user_group, a.user_code');

showmessage('select a.group_code, a.user_code, a.user_group, ' +

'a.pay_date, a.bill_pay, a.billpay_ck, a.user_no1, ' +

'a.user_no2, a.user_transbank, a.user_transcode, ' +

'b.user_up_name, b.user_jong_name, b.user_address,' +

'b.user_name, b.user_chief from eos_ea21 a, mst_user b ' +

'where a.pay_date like ' + '''' + date_s + '''' +

// 'and a.billpay_ck = ' + '''' + ck_n + '''' +

' and (a.group_code = b.group_code) ' +

'and (a.user_code = b.user_code) ' +

'order by a.group_code, a.user_group, a.user_code');

Open;

end;



szMisFile := GetCurrentDir + 'up미납.txt';

Assignfile(fpfile, szMisFile);

Rewrite(fpfile);



Mis_fQuery.DisableControls;

Mis_fQuery.First;



for i := 1 to Mis_fQuery.RecordCount do begin

szbuffer := '';



us_cd := trim(Mis_fQuery.FieldByName('user_code').AsString);

no_t := trim(Mis_fQuery.FieldByName('user_no1').AsString) ;

no_1 := Copy(no_t, 1, 3);

no_2 := Copy(no_t, 5, 2);

no_3 := Copy(no_t, 8, 5);

pay_tot := Mis_fQuery.FieldByName('bill_pay').AsInteger;

pay_pri := pay_tot / 1.1;

pay_pris := FloatToStr(pay_pri);

pay_vat := pay_pri * 0.1;

pay_vats := FloatToStr(pay_vat);



szbuffer := Format('%3s', [no_1]) +

Format('%2s', [no_2]) +

Format('%5s', [no_3]) +

Format('%-40s', [Mis_fQuery.FieldByName('user_name').AsString]) +

Format('%-10s', [Mis_fQuery.FieldByName('user_chief').AsString]) +



=====> 위의 구문에서 반자(1바이트) 스트링으로 되어 있는 부분을

전자(2바이트) 스트링으로 작성할려고 하는데.

구문을 모르겠네요..

아시분은 설명좀 해주세요...

내생각에는 '%-10s'를 '%-10?'이런식으로 바꿔줄수 있는게 있을것

같은데요...

흑,, 흑,, 아시는 분은 답변을 부탁드려요...

Format('%-20s', [Mis_fQuery.FieldByName('user_up_name').AsString]) +

Format('%-20s', [Mis_fQuery.FieldByName('user_jong_name').AsString]) +

Format('%3s', [Mis_fQuery.FieldByName('group_code').AsString]) +

Format('%-17s', [us_cd] ) +

Format('%-80s', [Mis_fQuery.FieldByName('user_address').AsString]);

Write(fpfile, szbuffer);

Write(fpfile, #13 + #10);

Mis_fQuery.Next;

end;

CloseFile(fpfile);

showmessage(Format('%5d', [Mis_fQuery.RecordCount]) + '건 Mis전체자료가 생성되었습니다.');





0  COMMENTS