Position of PrintPreview window

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

Position of PrintPreview window

Postby prosoft » Thu Feb 11, 2010 4:18 pm

Hallo Alex,
Is any chance to move PrintPreview form to any other position?
When i do print grid table PrintPreview window is off screen.
How do you set up position of PrintPreview?
Thanks Josef.
prosoft
User
 
Posts: 14
Joined: Tue Nov 27, 2007 3:35 pm

Re: Position of PrintPreview window

Postby AlexZencovich » Thu Feb 11, 2010 9:12 pm

Hello,
It just set by Form.Position := poMainFormCenter in DFM file. You may change it if you need in event handler TPivotGrid.OnMetafilePrepared event or just edit DFM file if you need it at once.
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am

Re: Position of PrintPreview window

Postby prosoft » Fri Feb 12, 2010 8:46 am

I changed in PrintPreview_SRC.dfm position to poMainFormCenter and i cretated

procedure TfrmOlapDBF.frCacheOlapext1pvGridMetafilePrepared(
Sender: TObject; MetafileName: String; Col, Row: Integer;
var ABreak: Boolean);
begin
TForm(Sender).Position :=poMainFormCenter ; //Is this sender pointer to preview form ?
end;

but it doesn't work.

Is anything wrong?
prosoft
User
 
Posts: 14
Joined: Tue Nov 27, 2007 3:35 pm

Re: Position of PrintPreview window

Postby AlexZencovich » Sat Feb 13, 2010 10:20 am

prosoft wrote:I changed in PrintPreview_SRC.dfm position to poMainFormCenter and i cretated

procedure TfrmOlapDBF.frCacheOlapext1pvGridMetafilePrepared(
Sender: TObject; MetafileName: String; Col, Row: Integer;
var ABreak: Boolean);
begin
TForm(Sender).Position :=poMainFormCenter ; //Is this sender pointer to preview form ?
end;

but it doesn't work.

Is anything wrong?


Sorry, that was my mistake in prev. answer. You cannot use that constrcution (TForm(Sender).Position) as Sender is TPivotGrid, not TForm.

You may need create inherited class from TPivotGrid with override TPivotGrid.CreatePrintPreviewForm method and set required parameters at that like

function TNewPivotGrid.CreatePrintPreviewForm : TCustomPrintPreviewForm
begin
Result := inherited CreatePrintPreviewForm;
Result.Position := ....
...etc
end;

There is most safe and clear way, I think
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 4 guests

cron