먼저 각설하구여.. 제가 얻고자하는 결과는여..
--- | 부장 | 과장 | 대리 | 사원 | 합계
총무팀 1 2 3 5 | 11
개발팀 1 2 3 5 | 11
인사팀 1 2 3 5 | 11
생산팀 1 2 3 5 | 11
----------------------------------------------
총계 4 8 12 20 | 44
머 이런식으로 구현을 하려구 하거든여..
첨에는 Report를 쓸려구 했는데..
아무리 생각해도 report가 딱 이더라구여..
해서 이렇게 코딩을 하려구........
++++++++++++++++++++++++++++++++++++++++++++++
procedure Tfrmstatistic.BitBtn1Click(Sender: TObject);
var
i,j: integer;
begin
nbtong.PageIndex := 0 ;
stringgrid1.Cells[0,1] := '지원팀';
stringgrid1.Cells[0,2] := '설계팀';
stringgrid1.Cells[0,3] := '품보팀';
stringgrid1.Cells[0,4] := '개발팀';
stringgrid1.Cells[0,5] := '생관팀';
stringgrid1.Cells[0,6] := '생기팀';
stringgrid1.Cells[0,7] := '공무팀';
stringgrid1.Cells[0,8] := '생산팀';
stringgrid1.Cells[0,9] := '총 계';
stringgrid1.Cells[1,0] := '부장'; //사무직
stringgrid1.Cells[2,0] := '차장';
stringgrid1.Cells[3,0] := '과장';
stringgrid1.Cells[4,0] := '대리';
stringgrid1.Cells[5,0] := '사원';
stringgrid1.Cells[6,0] := '소계';
stringgrid2.Cells[0,0] := '기장'; //생산직
stringgrid2.Cells[1,0] := '직장';
stringgrid2.Cells[2,0] := '반장';
stringgrid2.Cells[3,0] := '조장';
stringgrid2.Cells[4,0] := '리더';
stringgrid2.Cells[5,0] := '조원';
stringgrid2.Cells[6,0] := '소계';
stringgrid3.Cells[0,0] := '계';
//아래부터는 완존히 맛간 코딩을 했습니다.
with stringgrid1, Query do
begin
close;
Sql.Clear;
sql.add('select sabun,buscod,jikcod,toesail');
sql.add('from iifm10');
sql.Add('where (jikcod = :xx) and (toesail < :toe) and (buscod = :bs)');
ParamByName('toe').AsString := '1'; //퇴사자처리-재직자만
ParamByName('xx').AsString := '3200'; //직위코드
ParamByName('bs').AsString := '42000'; //부서코드
Open;
cells[2,1] := inttostr(Query.RecordCount);
//이렇게 하면 각 셀마다 한줄이 코딩이 들어가야되는데..어케해야되져?
end;
end;
+++++++++++++++++++++++++++++++++++++++++++++++++++
소스에서 일일이 직위코드를 기술한 이유는여.. 사원중에서도 5급사원,6급사원 하는 식으로 분류가 되어 있거든여.. 해서 쿼리실행후 직급코드 얼마,얼마는 몇번째 칼럼,몇번째셀에 합해져서 들어가고....
이런식으로 구현을 할려구하는데..
제발 좀 가르쳐주세여.. 이러다가 정말 짤리겠습니다.
StringGrid 는 감을 못잡겠어여.. 어케해야할지 제발 도움주십시오