关于网友提出的“ 如何动态设定纸张方向?横 or 纵”问题疑问,本网通过在网上对“ 如何动态设定纸张方向?横 or 纵”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 如何动态设定纸张方向?横 or 纵描述:
我用frprintgrid打印dbgrid;
在form上加了两个button1,button2
代码如下:
procedure TForm_print_change.Button4Click(Sender: TObject);
begin
form_print_change.frPrintGrid1.Orientation := poLandscape;
end;
procedure TForm_print_change.Button5Click(Sender: TObject);
begin
form_print_change.frPrintGrid1.Orientation := poPortrait;
end;
但是运行时保错,为什么,请指教!!
解决方案1:
(Sender as TBaseReport).Orientation:=poLandScape;
poLandScape
poDefault
poPortrait
uses printers
代码无问题