1836384 - How to automatically adjust the page size of the report of the WPF viewer (fit page)

SAP Knowledge Base Article - Public

1836384 - How to automatically adjust the page size of the report of the WPF viewer (fit page)

Symptom

  • The Crystal Reports WPF viewer does not adjust automatically to fit page

Environment

  • SAP Crystal Reports, developer version for Microsoft Visual Studio
  • Microsoft Visual Studio

Resolution

  • Use the following code
    Private Sub MyCrystalReportViewer_QueryCursor(sender As Object, e As System.EventArgs) Handles MyCrystalReportViewer.QueryCursor
    If Not FitToPage AndAlso MyCrystalReportViewer.ViewerCore.TotalPageNumber > 0 Then
                MyCrystalReportViewer.ViewerCore.Zoom(-1)
                FitToPage = True
    End If
    End Sub

 

Keywords

crvs cr4vs 2010 2012 , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio