CrystalReportViewer and Zoom

Posted on 2006-03-21
Last Modified: 2012-08-14
I am using the CrystalReportViewer on a form to show a report.  I know that you can use the Zoom method to set the zoom level.  For instance, CrystalReportViewer1.Zoom(75).

What I'd like to be able to do is save the zoom setting when the user closes the form and go back to this when the user next runs the report.

However, I can't seem to find a property that indicates the zoom level.

Is there a way of doing this?

I am using VB 2005, but I'd imagine it might be the same for earlier versions.

Question by:chlade
    LVL 34

    Expert Comment

    by:Brian Crowe
    You might consider saving the value in the application config file.  I use it to save things like the previous size and location of the application, etc.

    Author Comment

    That's exactly what I want to do.  My question is how do I  _get_ the value so that I can save it.
    LVL 14

    Expert Comment

    ReportViewer.ZoomPercent ?
    LVL 34

    Accepted Solution

    I misunderstood your question.  Use the ViewZoom event to record the new zoomlevel whenever it changes.

    Private Sub CrystalReportViewer1_ViewZoom(ByVal source As Object, _ ByVal e As CrystalDecisions.Windows.Forms.ZoomEventArgs) _
       Handles _ CrystalReportViewer1.ViewZoom
    End Sub

    Author Comment

    I had just figured out a way of doing it whereby I was parsing the 3rd panel of the status bar.  This was a bit clunky.  You'd think there would be a property such as ZoomPercent but there doesn't appear to be.

    BriCrowe, I like your method better than mine.  Thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video discusses moving either the default database or any database to a new volume.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now