-
In my VB6 application a user can show an article from a database. With this information he also sees a picture(.jpg) of the article. What my customer wants is giving the user the opportunity to print this .jpg.
What I want is printing this via crystal reports. I do know
how to place a picture object on a report but this is a
fixed path. HOW can I do this via VB6 ??. SO I pass
the correct path to crystal reports for this picture from VB. HOW... please help me.
-
Is your report integrated in your VB App (report designer?)
or is independent file?
In the first case you can change the path of the pic in run time. (if this is your case i can help you!)
If it is an independent file you'd better put the pics in your database.
:confused:
-
Yes it is integrated in my VB app. so how can I change the path of the picture during run-time??
-
Open a new Project and add a Report:
Code:
'This is the code window where i put the CRViewer!
Private rpt as CrystalReports1
Private Sub Form_Load()
CRViewer1.ReportSource = rpt
CRViewer1.ViewReport
End Sub
'This is the code window of the report.
'I put a pic in the section2 of the report so i called the event:
Private Sub Section2_Format(ByVal pFormattingInfo As Object)
Set Picture1.FormattedPicture = LoadPicture("Path\file.bmp")
End Sub
'Put a breakpoint in the event and in the imediate pane try this:
?CrystalReport1.Section2.ReportObjects.Item(1).name
Picture1
'The property FormattedPicture is read-only, and the only time it can be
changed it's when the section it's being formatted...
I HOPE THIS HELP!