|
일딴 그룹별로 반복시키는 법은 찾았는데...이상하네여..인쇄버턴을 누르면 어떨땐 구분이 돼고 어떨땐 구분이 안돼고..아 이걸로 벌써 2틀째 보내고 있네염..좀 도와주세염..ㅠ.ㅠ;; 그리고 페이지 넘어가서 어떨땐 구분돼고 어떨땐 구분안돼고...좀 길지만 소스한번 올려볼께염..너무 머라하지 마시궁;; 좀만 도와주세여..
현상은 3가지로 나타나는데요..첫번째 현상은 제가 원하는 스타일로 preview는 돼는데 막상 프린터하면 그룹이 하나밖에 나눠지지 않은경우고요..현재 스트링그리드의 상태로 볼때 5개의 그룹으로 나눠져야 하거덩엽
두번째는 프리뷰를 해도 그룹이 나눠지지 않는거예염..세번째는..4개정도 나눠지다가 마지막에 한개정도 안
나눠지는경우고염...동적으로 생성한 부분이 초기화가 안돼나 싶어서 이리저리 초기화부분을 많이 끼워넣었는데..어떨땐 돼고 어떨땐 안돼고..그러네염..자꾸 속만 타네여..조언좀 주시면 정말 감사하겠습니다.ㅠ.ㅠ
NeedData에 작성한 소스예염..(스트링그리드에 있는 데이터를 가져다가 뿌린답니다. 배치는 Group header Detail,Group Footer)을 반복시키는거구..Label 8-12가 반복될데이터구염..그리고 그룹푸터에 찍을데이터는 그룹푸터밴드 before프린터 이벤트에 찍었습니다.
TQREvResult *QREvResult = new TQREvResult;
Count=TotalProInformationForm->StringGrid1->RowCount-1;
if(Index < Count && Count!=0)
{
Index++;
QRLabel8->Caption = TotalProInformationForm->StringGrid1->Cells[0][Index];
QRLabel9->Caption = TotalProInformationForm->StringGrid1->Cells[1][Index];
QRLabel7->Caption = TotalProInformationForm->StringGrid1->Cells[2][Index];
QRLabel11->Caption = TotalProInformationForm->StringGrid1->Cells[3][Index];
QRLabel12->Caption = TotalProInformationForm->StringGrid1->Cells[4][Index];
if(Index!=1 && (TotalProInformationForm->StringGrid1->Cells[0][Index]
!= TotalProInformationForm->StringGrid1->Cells[0][Index-1]))
{
Machine_No++; // Expresion을 사용했는데..이
QREvResult->Kind = resInt;
QREvResult->intResult = int (Machine_No); 부분에서 데이터가 같지 않으면...
그룹을 나누고 Footer를 찍고 그리고
다음 인덱스부터 다시 같은지를
비교하는건데..
this->Functions->UpdateConstant("MACHINE", *QREvResult);
}
MoreData=true;
}
else
MoreData=false;
delete QREvResult;
여기는 GroupFooterBeforePrint소스예염..
int Index_1;
if(Index!=Count)
Index_1=Index-1;
else
Index_1=Index;
QRLabel14->Caption = TotalProInformationForm->StringGrid1->Cells[0][Index_1];
QRLabel16->Caption = TotalProInformationForm->StringGrid1->Cells[8][Index_1];
QRLabel18->Caption = TotalProInformationForm->StringGrid1->Cells[5][Index_1];
QRLabel20->Caption = TotalProInformationForm->StringGrid1->Cells[6][Index_1];
QRLabel22->Caption = TotalProInformationForm->StringGrid1->Cells[7][Index_1];
그리고 preview후에 변수 초기화를 해야 다시 프리뷰가 가능하므로..다음은 afterpreview이벤트에 작성한 소스예염..
TQREvResult *QREvResult = new TQREvResult ;
Index=0;
Machine_No=0; // 이부분은 전역변수 초기화부분이고여..
Count=0;
QREvResult->Kind = resInt;
QREvResult->intResult = int (Machine_No);
this->Functions->UpdateConstant("MACHINE", *QREvResult);
delete QREvResult;
|