Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Image Not Sized Properly

Status
Not open for further replies.

mikeprog

Programmer
Apr 24, 2009
3
0
0
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top