Avatar of FragReaper
FragReaper

asked on 

Changing image dynamically in crystal reports and vb .net 2008

What I am trying to achieve here is to change an image in a crystal reports .rpt file at runtime. Currently I am using code as shown below to pass custom test to parameters. How can I pass a bitmap to the report before exporting it as a PDF?
Public Sub DataPassOfficer()
        Dim Rep As New mg11a
        Dim passedvalue As String
        passedvalue = statementbody.TextBox1.Text
        Rep.ParameterFields(0).AllowCustomValues = True
        Rep.ParameterFields(0).CurrentValues.AddValue(passedvalue)
        Rep.ParameterFields(1).AllowCustomValues = True
        Rep.ParameterFields(1).CurrentValues.AddValue(Oforename + " " + Osurname)
        Rep.ParameterFields(2).AllowCustomValues = True
        Rep.ParameterFields(2).CurrentValues.AddValue("Over 18")
Rep.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "C:\temp\temp4.pdf")
   End Sub

Open in new window

Visual Basic Classic.NET Programming

Avatar of undefined
Last Comment
FragReaper
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

Isn't that the same link I posted?

Did you mean to post Part 2?

mlmcc
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

I thought you provided the link to part 2 which is the one that contains the section on the image: http://www.emoreau.com/Entries/Articles/2006/10/Crystal-Reports--Part-II.aspx
Avatar of FragReaper
FragReaper

ASKER

Thanks!
Visual Basic Classic
Visual Basic Classic

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo