Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

change a picture at runtime in crystal reports with vb.net

Posted on 2005-04-22
13
Medium Priority
?
977 Views
Last Modified: 2012-06-27

How can I change the picture in a Picture Object in Crystal Reports ...
I am using  Crystal Reports  that comes with VB.NET.  I want to be able to change the logo that apears in the section 2 based on values.  I would like to pass a path to the image to the report.
0
Comment
Question by:troyvw
13 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 13845565
0
 

Author Comment

by:troyvw
ID: 13845822
I looked at the dynamic image example before but it didn't make much sense to me.....  

        Dim MyDA As New SqlClient.SqlDataAdapter()
        'Dim myDS As New DatasetJobTicket()
        Dim myDs As New DataSet()

        Dim oReport As New JobTicket() 'Report
        Dim comJobTicket As New SqlClient.SqlCommand()

        If connEngine.State = ConnectionState.Closed Then
            connEngine.Open()
        End If

        comJobTicket.Connection = connEngine
        comJobTicket.CommandText = "SELECT * FROM JobTicket WHERE TicketNumber = " & _
        "'" & bookTicketNumber & "'" & " AND ProductType = 'MEMORYBOOK' ORDER BY ItemSize, BindingType"

        MyDA.SelectCommand = comJobTicket
        MyDA.Fill(myDs, "JobTicket")

        '' Set the SetDataSource property of the Report to the Dataset
        oReport.SetDataSource(myDs)

        '************************************************************************************
        'Export to PDF
        Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
        Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
        Dim myExportFile As String
        Dim PdfFileName As String
        Dim pdfFilePath As String
        pdfFilePath = MemoryBookTicketReport

        PdfFileName = "JobTicket" & bookTicketNumber & ".pdf"

        myExportFile = pdfFilePath & PdfFileName
        myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions()
        myDiskFileDestinationOptions.DiskFileName = myExportFile
        myExportOptions = oReport.ExportOptions

        With myExportOptions
            .DestinationOptions = myDiskFileDestinationOptions
            .ExportDestinationType = .ExportDestinationType.DiskFile
            .ExportFormatType = .ExportFormatType.PortableDocFormat
        End With

        oReport.Export()
        oReport.Close()
        oReport = Nothing
0
 

Author Comment

by:troyvw
ID: 13845824
oops didn't mean to post all of my code
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
LVL 9

Expert Comment

by:cyberdevil67
ID: 13866213
The best way is to have the images inserted into the report, then based on a paramter or value from the query you can hide or show the correct image object
0
 

Author Comment

by:troyvw
ID: 13869195
cyberdevil67 that would probable work ok according to the origional question that I asked.  Unfortunatly, we doing another report that will show a different image(s) for every report. So, we will not just have a fixed amount of images that need to be variable....

Thanks
0
 

Author Comment

by:troyvw
ID: 13879292
Does anybody know if there is a dirrect way to do this such as just set a property or call a method of the OLE Object field??
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 13882499
Sorry.  That capability was added in CR 10 or XI.

mlmcc
0
 

Author Comment

by:troyvw
ID: 13887765
mlmcc would it work to just upgrade to cr10 or XI?? How do i find out what the version is that I have bundled with .net?  What would the syntax be if I where to get CR 10 or XI?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 13891341
Depending on the version of .Net you have 9, 10, or XI.  However it is a limited version with limited capabilities.  I would recommend you upgrade and since CRXI is out I would recommend CRXI Developer edition.

mlmcc
0
 

Author Comment

by:troyvw
ID: 13900539
do you know off the top of your head how much that would cost??
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 13901902
No.  Look at

www.businessobjects.com

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 14043005
Glad i could help

mlmcc
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question