bcb2009使用quickreport5.4
报表预览没有问题,可是打印出来中间一段是乱码,
只使用了QRLabel控件
font设置都是一样的,可是就是中间一段是乱码;
void __fastcall TMainFrm::PrintReportBtnClick(TObject *Sender){ PrintReportBtn->Enabled=false; try { int WeiGui; String SqlStr,tablename; try { tablename=DataMod->InsertTable->TableName; DataMod->TempQuery->Close(); DataMod->TempQuery->SQL->Clear(); SqlStr="select * from "+tablename; SqlStr+=" where VEH_Plate='"+VehPlate+"' "; SqlStr+=" and OverLoad>0"; DataMod->TempQuery->SQL->Add(SqlStr); DataMod->TempQuery->Open(); WeiGui=DataMod->TempQuery->RecordCount; DataMod->TempQuery->Close(); } catch(...) { } BillFrm->QRLbl_Title->Caption=BillTitle; //BillFrm->QRLbl_VehID->Caption=VehID; BillFrm->QRLbl_VehTime->Caption=FormatDateTime("YYYY'年'MM'月'DD'日' HH:NN:SS",PrintTime); BillFrm->QRLbl_AxleNum->Caption=PrintData.AxleNum; BillFrm->QRLbl_Plate->Caption=VehPlate; //BillFrm->QRLbl_Violation->Caption=WeiGui; BillFrm->QRLbl_Weight->Caption=PrintData.Weight; BillFrm->QRLbl_Limit->Caption=PrintData.Limit; BillFrm->QRLbl_Overload->Caption=PrintData.OverLoad; BillFrm->QRLbl_Speed->Caption=PrintData.Speed; BillFrm->QRLbl_Operator->Caption=VehOperator; BillFrm->QRLbl_StationName->Caption=StationName; BillFrm->A1_QRLabel->Caption=PrintData.Axle[0].Weight; BillFrm->A2_QRLabel->Caption=PrintData.Axle[1].Weight; BillFrm->A3_QRLabel->Caption=PrintData.Axle[2].Weight; BillFrm->A4_QRLabel->Caption=PrintData.Axle[3].Weight; BillFrm->A5_QRLabel->Caption=PrintData.Axle[4].Weight; BillFrm->A6_QRLabel->Caption=PrintData.Axle[5].Weight; BillFrm->A7_QRLabel->Caption=PrintData.Axle[6].Weight; BillFrm->A8_QRLabel->Caption=PrintData.Axle[7].Weight; BillFrm->BillRep->Print(); } catch(...) { // } PrintReportBtn->Enabled=true;}