【发布时间】:2011-07-12 17:45:46
【问题描述】:
我正在使用 Crystal Reports 7 和 Delphi 7,想知道如何打开报表的模式预览。
Crpe1.Execute;
打开一个非模态表单,但我找不到打开模态表单的方法... 感谢您的帮助!
【问题讨论】:
我正在使用 Crystal Reports 7 和 Delphi 7,想知道如何打开报表的模式预览。
Crpe1.Execute;
打开一个非模态表单,但我找不到打开模态表单的方法... 感谢您的帮助!
【问题讨论】:
很久没有使用TCrpe和Delphi7了。
我认为您可以将 Tcrpe.Output:= toWindow 更改为预览,并将 Tcrpe.Output:= toPrinter 更改为直接打印到打印机。
我不太清楚,因为我的电脑上没有 delphi7 和 Tcrpe。
使用 crpe1.show,然后你还有预览对话框。
【讨论】:
我希望这个例子可以帮助你有一个showmodal
procedure Tform1.BtnShowViewerClick(Sender: TObject);
var
oForm: TForm;
begin
oForm:= TForm.Create(Nil);
try
oForm.bordericons:= [bisystemmenu];
oForm.OnResize:= OnCrpeViewerResize;
crpe1.WindowParent:= oForm;
crpe1.Show;
oForm.ShowModal;
finally
FreeAndNil(oForm);
end;
end;
procedure TForm1.OnCrpeViewerResize(Sender: TObject);
begin
if (sender is TForm) then
begin
SetWindowPos(Crpe1.ReportWindowHandle,
HWND_TOP,
0,
0,
TForm(Sender).ClientWidth,
TForm(Sender).ClientHeight,
SWP_NOZORDER);
end;
end;
【讨论】: