Results 1 to 14 of 14

Thread: [RESOLVED] maximize CRV

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Resolved [RESOLVED] maximize CRV

    The form i am hosting the crystal report in is a maximzed window. how i get the report to be all it can be. err be maximzed also.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: maximize CRV

    In the Resize event of the Form resize the Crystal Viewer control.

    The following causes the control to fill the entire client area of the form. If you have any other controls on the form you will need to adjust accordingly.

    VB Code:
    1. Private Sub Form_Resize()
    2.     rptViewer.Move 0, 0, ScaleWidth, ScaleHeight
    3. End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    it says scalewidth isnt declared. is there somethiung i need to import?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: maximize CRV

    Where did you put this code?

    ScaleWidth and ScaleHeight are properties of a Form.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    the report loads with form

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    the report loads with form. it would be the only code i put in for that form. kinda just sitting byitself.

  7. #7
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: maximize CRV

    Please post your form file.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    there isnt a point to it. it is bare. all that is on there is the crystal viewer.

  9. #9
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: maximize CRV

    The code I posted for the Resize event should work in every single form for any kind of control.

    Are you using VB 6.0 or .NET or ?????

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    vb.net 2003

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    in the form resize event i changed
    VB Code:
    1. rptViewer.Move 0, 0, ScaleWidth, ScaleHeight
    to
    VB Code:
    1. rptViewer.scale(100,100)
    now it is also maximized, but if i minimize or maximize the window from there the report doesnt show up. is this the wrong way to go or is ther eextyra code i need to add?

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    ok it turns out that scale variables are integer ratios. i changed 100 to 1 for 100%. now it can maximize and minimize without probems, but i still want the viewer to size itself to how big the window is.

  13. #13
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: maximize CRV

    I don't use .NET that much yet but I do know each control has a Dock property. Set the Dock property equal to Fill from within the properties window or use the following in the Form's Load event.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    rptViewer.Dock = DockStyle.Fill
    End Sub
    Last edited by brucevde; Aug 4th, 2005 at 10:21 AM.

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    May 2005
    Posts
    162

    Re: maximize CRV

    brilliant! Kudos.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width