300分,打印问题.本来想给1000分的(系统不允许). (300分)

K

kxboy

Unregistered / Unconfirmed
GUEST, unregistred user!
在win2000p下,打印图像时(图像一般为1-4幅,每幅图像为1-2M),经常第一幅图像打印不出来(空白),但是其它的文字和图像完全正确.
预览正常.
打印机:hp1005黑白激光打印机
开发环境:win2000p,d7,RBuilder
这个问题已经把我搞崩溃了,望哪位好心人帮帮我
打印预览和打印的程序如下:(每次打印一页)
procedure TPrintForm.PacsPreview(const InspectID: Integer = 0); //预览
begin
if InspectID > 0 then
FInspectID := InspectID;
with qTmpdo
begin
//取病例信息
SQL.Text := 'select * from 病例视图 where 检查序号=:0';
Params[0].Value := FInspectID;
try
Open;
except
on E: Exceptiondo
begin
ShowError('病人检查信息查询失败,请与维护员联系。错误:' + E.Message);
Exit;
end;
end;
if IsEmpty then
begin
ShowMessage('请先选择病人');
Exit;
end;
FInspectNo := FieldByName('检查编号').AsInteger;
FInspectType := FieldByName('检查类别编号').AsString;
SQL.Text := 'select count(序号) from 病例图像表 where 检查序号=:0 and 是否打印=''是''';
Params[0].Value := FInspectID;
try
Open;
//取病例图像表
except
on E: Exceptiondo
begin
ShowError('病例图像查询失败,请与维护员联系。错误:' + E.Message);
Exit;
end;
end;
FImageCount := Fields[0].AsInteger;
if FImageCount > 5 then
FImageCount := 5;
//大于等于5个图像的用打印5个图像的报表打印
SQL.Clear;
SQL.Add('select b.名称 from 检查类别表 a,');
SQL.Add(' 报表项目表 b where a.报表Id=b.Id and a.编号=:0 ');
Params[0].Value := FInspectType;
try
Open;
//取当前检查类别用的报表名称
except
on E: Exceptiondo
begin
ShowError('报表设置查询失败,请与维护员联系。错误:' + E.Message);
Exit;
end;
end;
if not IsEmpty then
rptReport.ReportName := Fields[0].AsString
else
rptReport.ReportName := '通用报表';
end;
begin
Wait('正在生成报表...');
ppViewer.ZoomSetting := zsPageWidth;
with rptReportdo
try //执行打印
Params[0] := IntToStr(FInspectId);
Params[1] := Params[0];
Preview(ppViewer);
except
on E: Exceptiondo
ShowMessage('预览出错:' + E.Message);
end;
EndWait;
end;

procedure TPrintForm.PrintButtonClick(Sender: TObject);
//打印按钮
begin
rptReport.Print;

end;
 
打印代码贴出来看看。
 
将图象组件设置为BringToFront。
 
我测试一下看
 
一个函数这么长?
 
今天又去试了试:将图象组件设置为BringToFront 这个,不行.
现在是在打印的时候我写了个函数将image里的图像输出为bmp文件(没有问题)
将整个报表输出为图片也没有问题.
但是发现了一个现象就是:
图像出问题的时候:点击打印按钮时输出到打印机的时间比正常情况下要短一些
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
644
import
I
顶部