在Web Service中怎样将一个Grid中的内容直接输出到打印机上,而不是将整个Html页面输出到打印机。我用的是Delphi6 + Web Snap + IIS,希望高手关注解决一下,万分感谢。
解决方案 »
- 我用下面的代码向数据库写数据,写到600条左右就出错,谁帮我改改
- 怎么让程序能动态的加载OCX控件
- 我想用报表形式打印listview中的内容,我用的打印组件是fastreport?请问怎么把listview中的内容直接输入fastreport打印?
- 请高手指点,一个带数据库的小程序,怎么发布给别人呢?
- 怎么释放在delphi中定义的很多变量呀?(急呀)
- 巨好的東東,運行態改變控件位置的一個pas單元!
- 用Delphi做过托盘程序的高手请进
- 请问哪里有Delphi 6的控件下载?
- Kylix编译的文件怎样直接运行?
- 问一个问题:INTERBASE最多可以支持多少个用户并发访问?
- 急救,为何过一段时间就connection failure
- 请问:如何将Canvas上的图像打印出来?
试试,
有个问题,你的webservice还有form?
begin
Bits := FormImage.Handle;
GetDIBSizes(Bits, InfoSize, ImageSize);
Info := AllocMem(InfoSize);
try
Image := AllocMem(ImageSize);
try
GetDIB(Bits, 0, Info^, Image^);
with Info^.bmiHeader do
begin
DIBWidth := biWidth;
DIBHeight := biHeight;
end;
case PrintScale of
poProportional:
begin
PrintWidth := MulDiv(DIBWidth, GetDeviceCaps(Handle,
LOGPIXELSX), PixelsPerInch);
PrintHeight := MulDiv(DIBHeight, GetDeviceCaps(Handle,
LOGPIXELSY), PixelsPerInch);
end;
poPrintToFit:
begin
PrintWidth := MulDiv(DIBWidth, PageHeight, DIBHeight);
if PrintWidth < PageWidth then
PrintHeight := PageHeight
else
begin
PrintWidth := PageWidth;
PrintHeight := MulDiv(DIBHeight, PageWidth, DIBWidth);
end;
end;
else
PrintWidth := DIBWidth;
PrintHeight := DIBHeight;
end;
StretchDIBits(Canvas.Handle, 0, 0, PrintWidth, PrintHeight, 0, 0,
DIBWidth, DIBHeight, Image, Info^, DIB_RGB_COLORS, SRCCOPY);
finally
FreeMem(Image, ImageSize);
end;
finally
FreeMem(Info, InfoSize);
end;
end;
参考Form.Print方法