SAP Knowledge Base Article - Public

1645988 - How to modify image size when using the RAS SDK in a VS .NET application


  • Images inserted into a report display as they are stored in a database
  • How to modify the image size so all images are consistent?


  • Crystal Reports for Visual Studio 2010
  • VS2010


  • Use the following code to control the image size:
Public Class Form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim boReport As CrystalDecisions.CrystalReports.Engine.ReportDocument = Nothing
        Dim boPicture As CrystalDecisions.ReportAppServer.ReportDefModel.PictureObject = Nothing
        Dim boClientDoc As CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument = Nothing
        Dim boReportObject As CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject = Nothing
        Dim boNewObject As CrystalDecisions.ReportAppServer.ReportDefModel.ReportObject = Nothing
            boReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument()
            boClientDoc = boReport.ReportClientDocument
            boPicture = boClientDoc.ReportDefController.ReportObjectController.ImportPicture("test.bmp", _
            boClientDoc.ReportDefController.ReportDefinition.PageHeaderArea.Sections(0), 5, 5)
            For Each boReportObject In             boClientDoc.ReportDefController.ReportObjectController.GetReportObjectsByKind _
                If boReportObject.Name = boPicture.Name Then
                    boNewObject = boReportObject.Clone(True)
                    boNewObject.Width = 14800
                    boNewObject.Height = 14800
                    boClientDoc.ReportDefController.ReportObjectController.Modify(boReportObject, boNewObject)
                End If
            Me.CrystalReportViewer1.ReportSource = boReport
        Catch ex As Exception
        End Try
    End Sub
End Class



CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 picture pic graphic resize smaller bigger , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To


SAP Crystal Reports, developer version for Microsoft Visual Studio