初次参加工作!有关支票方面的问题请帮帮忙!
koukoulo:
各位大侠!小的既是初次参加工作,又是初临此地!还望多多帮助! 本人刚刚得到一份工作,公司要我设计一个简单的支票打印软件,但本人才疏学浅,不知从何开始!有请各位大位帮帮忙!感激不尽!最好有这方面的源代码给俺参考参考!感谢!具体要求如下: 银行凭证打印软件,不仅可以打印支票,还可以打印电汇凭证、信汇凭证、银行进账单、汇票申请书,日期自动显示,只需输入小写金额,自动转换成规范的大写金额,在打印位置有偏差时可以对打印位置作细微调整,并对打印资料具有管理功能! 无从下手!急需帮忙!感谢!
koukoulo:
大侠们呢!?!不睬我呀!?呜~~~~~小妹初临贵地!竟没人理睬~~~~~~~ 还有哪个论坛可以得到帮忙的,请指条明路吧!感谢!
huang_jihua:
在帮助里面输入:TPrinter 就可以看到一个例子,照着做。
pzoon:
找控件吧,自己画太麻烦了
koukoulo:
??????????????
chifengwatch:
呵呵,没弄过打印的东东。 帮您顶上去
koukoulo:
感谢支持!
ch_builder:
用QR很容易实现的,我们这里用的打印系统就是用QR编写的,并且很方便:)
friendbcb:
FastReport ReportMachine
koukoulo:
怎样用FastReport ReportMachine作呀?给点提示吧!感谢!
koukoulo:
???~~~~~~???
jiangshi99:
楼主是MM? 厉害啊!支持一下!
koukoulo:
GG!是支持的就给点实际的嘛!真是的!
koukoulo:
大哥~~~~~~~~~~~~~~~~~~~~~~给点贴示吧!!!!!!!
stonewater:
FastReport有帮助比较好学
Sammo:
留个邮箱,我发个类似的程序给您吧。
bigfog:
您可以直接用TPrinter打印,在定位时要把页边距减去
koukoulo:
给点例子看看好吗?比如说怎样使用TPrinter进行打印!给点代码!感谢!
iyln:
套打还是用TPrinter比较方便,把要打印的字段名称和位置存在数据表中,看看下面的代码,希望对您有帮助(部分文字已用"*"代替)。 //打印单据 void __fastcall TBillPrnForm::PrintBill(TObject *Sender) { PrintBillBtn->Enabled=false; CancelBtn->Enabled=false; //初始化字段名称和实际名称对照表 TStringList *FieldList=new TStringList; FieldList->Values["****"]="***_**"; FieldList->Values["**"]="***_**"; FieldList->Values["**"]="******"; FieldList->Values["****"]="****_****"; FieldList->Values["****"]="******"; FieldList->Values["****"]="*****"; FieldList->Values["****"]="******"; FieldList->Values["****"]="*******"; FieldList->Values["**"]="****"; FieldList->Values["****"]="*******"; FieldList->Values["****"]="****_**"; FieldList->Values["**"]="*****"; FieldList->Values["****"]="******"; FieldList->Values["****"]="*****_**"; FieldList->Values["****"]="*************"; FieldList->Values["**"]="****"; FieldList->Values["****"]="****_****"; FieldList->Values["****"]="****_**"; FieldList->Values["****"]="*********"; FieldList->Values["**"]="***"; FieldList->Values["**"]="*****"; FieldList->Values["**"]="*********"; FieldList->Values["**"]="*****"; FieldList->Values["****"]="*************"; FieldList->Values["****"]="*********"; FieldList->Values["****"]="********"; FieldList->Values["**"]="****"; //打印机分辨率 int ResX,ResY; //单据联最大高度 int MaxHeight; //初始化数据查询控件 TZZMySqlQuery *BillFormatQuery=new TZZMySqlQuery(this); BillFormatQuery->Database=BillDB; BillFormatQuery->Transaction=BillTransact; //查询单据联最大高度 BillFormatQuery->Close(); BillFormatQuery->Sql->Clear(); BillFormatQuery->Sql->Add("select max(y_axis) max_y_axis from bill_format where bill_name=:bill_type"); BillFormatQuery->ParamByName("bill_type")->AsString=BillTypeCBox->Text; BillFormatQuery->Open(); MaxHeight=BillFormatQuery->FieldByName("max_y_axis")->AsInteger; //查询指定的单据格式项 BillFormatQuery->Close(); BillFormatQuery->Sql->Clear(); BillFormatQuery->Sql->Add("select field_name,x_axis,y_axis,font_name,font_size from bill_format where bill_name=:bill_type"); BillFormatQuery->ParamByName("bill_type")->AsString=BillTypeCBox->Text; BillFormatQuery->Open(); //查询指定单据的联数和联间隔 TIniFile *Ini=new TIniFile(INIFILENAME); int PartNumber=Ini->ReadInteger(BillTypeCBox->Text,"PartNumber",1); int PartSpace=Ini->ReadInteger(BillTypeCBox->Text,"PartSpace",10); delete Ini; //初始化打印控件 TPrinter *BillPrn=Printer(); BillPrn->Title="WMS Bill"; //检测打印机分辨率(pixel/mm) ResX=GetDeviceCaps(BillPrn->Handle,LOGPIXELSX)/25.4+0.5; ResY=GetDeviceCaps(BillPrn->Handle,LOGPIXELSY)/25.4+0.5; MaxHeight=(MaxHeight+PartSpace)*ResY; //打印单据 BillPrn->BeginDoc(); for(register int i=0;i<PartNumber;i++) { BillFormatQuery->First(); for(register int j=0;j<BillFormatQuery->RecordCount;j++) { BillPrn->Canvas->Font->Name=BillFormatQuery->FieldByName("font_name")->AsString; BillPrn->Canvas->Font->Size=BillFormatQuery->FieldByName("font_size")->AsInteger; BillPrn->Canvas->TextOut(BillFormatQuery->FieldByName("x_axis")->AsInteger*ResX, BillFormatQuery->FieldByName("y_axis")->AsInteger*ResY+(i*MaxHeight), BillQuery->FieldByName(FieldList->Values[BillFormatQuery->FieldByName("field_name")->AsString])->AsString; BillFormatQuery->Next(); } } BillPrn->EndDoc(); delete BillFormatQuery; delete FieldList; PrnResult=true; Close(); }