Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize Preview window

Status
Not open for further replies.

RobHVB6Sql

Programmer
May 20, 2002
77
AU
This one has been driving me batty for some time ..
BACKGROUND: Using VB 6 /SQL and Crystal 8.5.

A previous developer linked CrystalReport1 to a VB form and set the following:
Code:
CrystalReport1.WindowParentHandle = frmPrintPreview
CrystalReport1.Destination = crptToWindow
CrystalReport1.WindowWidth = frmPrintPreview.ScaleWidth
CrystalReport1.WindowHeight = frmPrintPreview.ScaleHeight

'Execute the report
CrystalReport1.Action = 1

'Show print preview window
frmPrintPreview.show vbModal
This is all working fine especially with vbModal.

THE QUESTION:
How do I allow users to resize the form AND report.
When they maximise the form the CrystalReport1 does not resize.
Do I drop using the vb form altogether?
How would I then retun control back to vb once the report is closed.

PS I have played with ScaleHeight and ScaleWidth, ie
Code:
frmPrintPreview...

Private Sub Form_Resize()
   frmReportCriteriaGenetics.CrystalReport1.WindowWidth =frmPrintPreview.ScaleWidth
   frmReportCriteriaGenetics.CrystalReport1.WindowHeight =frmPrintPreview.ScaleHeight
End Sub

'frmReportCriteriaGenetics' contains the 'CrystalReport1' object and it calls the print preview form.

Any help appreciated ;-)

Rob Hasard
(VB6 /SQL 7.0 /CR8.5)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top