Link to home
Start Free TrialLog in
Avatar of aslyas
aslyas

asked on

Updating the zoom view in a Crystal Reports in asp.net

I have a report in a asp.net page, the zoom is set initially in 100, but if it is changed, nothing happen and remain the initial set (100)
I tryied this:
  Protected Sub crViewer1_ViewZoom(ByVal source As Object, ByVal e As CrystalDecisions.Web.ZoomEventArgs) Handles crViewer1.ViewZoom
          Me.crViewer1.Zoom(e.NewZoomFactor)
 End Sub
But an application error happened:
https://www.experts-exchange.com/questions/23399688/Aplicaci-n-de-servidor-no-disponible.html

Is there another way for updating the zoom?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aslyas
aslyas

ASKER

I got an error if I did it from command button, but I solved it updating the zoom from the bindReport function:

Protected Sub BindReport(ByVal reporte As String)
        If oRpt Is Nothing Then oRpt = New ReportDocument
        Dim zoom As Integer = CInt(txtZoom.Text)
        Try            oRpt.Load(Server.MapPath(reporte))
            oRpt.SetDataSource(dsData)
            Me.crViewer1.ReportSource = oRpt              
            Me.crViewer1.DataBind()
            Me.crViewer1.Zoom(zoom)
        Catch ex As Exception
        End Try
    End Sub

I will give you the points since you point me in the direction.

Thanks a lot!