我尝试了手工报表和动态报表,在预览报表时能显示,但是打印时,都出现标题不能打印出来(相同位置其他内容也不能打印出来)的情况。
打印报表代码如下
dm.dts_salary.First;
frReport1.Pages.Clear;
frReport1.Pages.Add; // create page
frreport1.DoublePass:=true; // 双面打印 才有tatol pages
//frReport1.Pages[0].pgWidth:=2750;
//frreport1.Pages[0].pgHeight:=3600;
frReport1.Pages[0].ChangePaper($100,3600,2730,-1,poPortrait); //USE PRINTERS
//穿孔纸
//第一个参数是 纸张类型 也许$100代表自定义类型吧。
//第二个参数是 长
// 第三个参数是 宽
//第五个参数是 竖放/横放 page:=frreport1.Pages[0];
frdbdataset1.DataSet:=dm.dts_salary;
b := TfrBandView.Create; // create Title band
b.SetBounds(0, 0, 3600, 99); // position and size in pixels
b.BandType := btReportTitle; // (only Top and Height are significant
Page.Objects.Add(b); // for the band) v := TfrMemoView.Create; // create memo
v.SetBounds(200, 50, 500, 24); //
//v.BandAlign := baWidth;
// v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.size'] := strtoint(edit3.Text);
v.Prop['Font.name'] := edit1.Text;
v.Memo.Add('太阳公司工资表');//能预览但是不能打印的内容
Page.Objects.Add(v);
但是如果把代码改为:
v.SetBounds(200, 80, 500, 24); //就是把高度从50改为大于80的数据 就能打印该标题。
但是如果把打印高度设定为80以上,纸张的上部就有比较多的空白,浪费纸张并且不美观。 打印机为针式打印机star ar3200+。在word 中打印没有问题。
打印报表代码如下
dm.dts_salary.First;
frReport1.Pages.Clear;
frReport1.Pages.Add; // create page
frreport1.DoublePass:=true; // 双面打印 才有tatol pages
//frReport1.Pages[0].pgWidth:=2750;
//frreport1.Pages[0].pgHeight:=3600;
frReport1.Pages[0].ChangePaper($100,3600,2730,-1,poPortrait); //USE PRINTERS
//穿孔纸
//第一个参数是 纸张类型 也许$100代表自定义类型吧。
//第二个参数是 长
// 第三个参数是 宽
//第五个参数是 竖放/横放 page:=frreport1.Pages[0];
frdbdataset1.DataSet:=dm.dts_salary;
b := TfrBandView.Create; // create Title band
b.SetBounds(0, 0, 3600, 99); // position and size in pixels
b.BandType := btReportTitle; // (only Top and Height are significant
Page.Objects.Add(b); // for the band) v := TfrMemoView.Create; // create memo
v.SetBounds(200, 50, 500, 24); //
//v.BandAlign := baWidth;
// v.Prop['Alignment'] := frtaCenter; // another way to access properties
v.Prop['Font.size'] := strtoint(edit3.Text);
v.Prop['Font.name'] := edit1.Text;
v.Memo.Add('太阳公司工资表');//能预览但是不能打印的内容
Page.Objects.Add(v);
但是如果把代码改为:
v.SetBounds(200, 80, 500, 24); //就是把高度从50改为大于80的数据 就能打印该标题。
但是如果把打印高度设定为80以上,纸张的上部就有比较多的空白,浪费纸张并且不美观。 打印机为针式打印机star ar3200+。在word 中打印没有问题。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货