Jim, Thank You for the info. I added the handler putting in the name of my TppReport component (rptAssembly) and added ppViewr to uses clause. Here is the code I used
When I compile I get "[Error] JobRpt.pas(381): Undeclared identifier: 'wsMaximized'". If I comment out "rptAssembly.PreviewForm.WindowState := wsMaximized;" , then the second line compiles OK.
Jim, I do not understand how to implement your last instruction. I am using Delphi6 and the ppReport component is in a data module. The data module does not have a WindowState property. In Report designer if I select the report and look at the object inspector, there is no WindowState property. Do I have to create a form just of the ppReport component and then set its WindowState or can I do this some other way?
Jim, Now it is working. Thank You. It will help others if needing Forms in the uses clause is added to this subject in the tech-tips section.
WindowState would be a good candidate for a new property in ppReport.
Also, it seems to me, that if you want to preview a report, that, you want to see it. Most reports these days go to 8 .5 x 11 in paper and to best see them you need to be maximized. All that is to say, that, my preference would be for the preview default be maximized.
Comments
procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
begin
ppReport1.PreviewForm.WindowState := wsMaximized;
TppViewer(ppReport1.PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
Note: You will need to add ppViewr to the uses clause of your unit,
so that the ZoomSetting enumerated type is recognized by the
compiler.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Thank You for the info. I added the handler putting in the name of my
TppReport component (rptAssembly) and added ppViewr to uses clause. Here is
the code I used
procedure TdtmJobRpt.rptAssemblyPreviewFormCreate(Sender: TObject);
begin
rptAssembly.PreviewForm.WindowState := wsMaximized;
TppViewer(rptAssembly.PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
When I compile I get "[Error] JobRpt.pas(381): Undeclared identifier:
'wsMaximized'". If I comment out "rptAssembly.PreviewForm.WindowState :=
wsMaximized;" , then the second line compiles OK.
What am I doing wrong?
Thanks,
Roy
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I already had ppTypes in uses. Here is my uses clause:
uses
SysUtils, Classes, DB, DBTables, ppCtrls, ppVar, ppPrnabl, ppClass,
ppBands, ppCache, ppDB, ppProd, ppReport, ppComm, ppRelatv, ppDBPipe,
ppStrtch, ppSubRpt, DBXpress, Provider, SqlExpr, DBClient, DBLocal,
DBLocalS, FMTBcd, ppTypes, ppViewr;
So the question remains, what am I doing wrong?
Thanks,
Roy
type TWindowState = (wsNormal, wsMinimized, wsMaximized);
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
I do not understand how to implement your last instruction. I am using
Delphi6 and the ppReport component is in a data module. The data module
does not have a WindowState property. In Report designer if I select the
report and look at the object inspector, there is no WindowState property.
Do I have to create a form just of the ppReport component and then set its
WindowState or can I do this some other way?
Thanks,
Roy
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Now it is working. Thank You. It will help others if needing Forms in the
uses clause is added to this subject in the tech-tips section.
WindowState would be a good candidate for a new property in ppReport.
Also, it seems to me, that if you want to preview a report, that, you want
to see it. Most reports these days go to 8 .5 x 11 in paper and to best see
them you need to be maximized. All that is to say, that, my preference
would be for the preview default be maximized.
Thanks again,
Roy