I have VB6 application that uses the Crystal Reports 8.5 CRAXDRT. I am dynamically loading an image at runtime. The code below works great and does load the image. The problem, however, is that the image (jpg) is not sized properly. The jpg images that I am dynamically loading are of different sizes, so setting the image .Height and .Width in code is not helping. How do I get a dynamically-loaded image to be properly sized in Crystal Reports?
Any assistance is appreciated.
Dim crApplication As New craxdrt.Application
Dim crReport As craxdrt.Report
Dim WithEvents crReportHeaderSection As craxdrt.Section
Set crReport = crApplication.OpenReport("C:\MyReport.rpt")
crReport.DiscardSavedData
crReport.Database.Tables(1).SetDataSource rstMyData, 3
Set crReportHeaderSection = crReport.Sections("RH")
Private Sub crReportHeaderSection_Format(ByVal pFormattingInfo As Object)
Set crReportHeaderSection.ReportObjects.Item("Picture1").FormattedPicture = _
LoadPicture("c:\mypic.jpg")
Exit Sub
Any assistance is appreciated.
Dim crApplication As New craxdrt.Application
Dim crReport As craxdrt.Report
Dim WithEvents crReportHeaderSection As craxdrt.Section
Set crReport = crApplication.OpenReport("C:\MyReport.rpt")
crReport.DiscardSavedData
crReport.Database.Tables(1).SetDataSource rstMyData, 3
Set crReportHeaderSection = crReport.Sections("RH")
Private Sub crReportHeaderSection_Format(ByVal pFormattingInfo As Object)
Set crReportHeaderSection.ReportObjects.Item("Picture1").FormattedPicture = _
LoadPicture("c:\mypic.jpg")
Exit Sub