?
Solved

Visual Basic 6 with Crystal Reports 7 Help!

Posted on 2003-03-02
12
Medium Priority
?
1,288 Views
Last Modified: 2013-11-25
im trying to edit an picture object in my report, im using vb6 and cr7, im not using a blob or ole object in my database but path of the image. ive looked at support.crystaldecisions.com but when i tried their solution:

Set crxMyPictureObject.FormattedPicture = LoadPicture("C:\picture.bmp")

an error occured prompting "permission denied". ive seached crystal decisions and said my picture image must be in a subreport but it isnt. need help! please! thanks!
0
Comment
Question by:manduz_griffus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 8055046
0
 

Author Comment

by:manduz_griffus
ID: 8055320
thanks mlmcc! that worked when i include the report in the project, but what im using is an independent report outside my project.

i code it like this:

Public crxApplication As New CRAXDRT.Application
Public crxReport As CRAXDRT.Report
Public crxDatabase As CRAXDRT.Database
Public crxDatabaseTables As CRAXDRT.DatabaseTables
Public crxDatabaseTable As CRAXDRT.DatabaseTable
Public crxSections As CRAXDRT.Sections
Public crxSection As CRAXDRT.Section
Public crxPictureObject As CRAXDRT.OLEObject

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
Set crxReport = crxApplication.OpenReport("C:\MyReport.rpt")
crxReport.DiscardSavedData
Set crxDatabase = crxReport.Database
Set crxDatabaseTables = crxDatabase.Tables
For Each crxDatabaseTable In crxDatabaseTables
    crxDatabaseTable.Location = "C:\MyDatabase.mdb"
Next crxDatabaseTable
CRViewer1.ReportSource = crxReport
Set crxPictureObject = crxReport.Sections("PH").ReportObjects.Item(10)
Set crxPictureObject.FormattedPicture = LoadPicture("C:\MyPicture.jpg")
CRViewer1.ViewReport
Me.WindowState = vbMaximized
Screen.MousePointer = vbDefault
End Sub

hope you could help me more.
thanks anyways!
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8058149
How about changing the order of these lines

CRViewer1.ReportSource = crxReport
Set crxPictureObject = crxReport.Sections("PH").ReportObjects.Item(10)
Set crxPictureObject.FormattedPicture = LoadPicture("C:\MyPicture.jpg")


Try
Set crxPictureObject = crxReport.Sections("PH").ReportObjects.Item(10)
Set crxPictureObject.FormattedPicture = LoadPicture("C:\MyPicture.jpg")
CRViewer1.ReportSource = crxReport


mlmcc
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:manduz_griffus
ID: 8068419
hi mlmcc! thanks again! but the error 70 "permission denied" still occurs.

when i tried doing the solution in the link to crystal decisions the error also occured when i didn't put the code in the corresponding section where the picture object is placed, but when i put it on the right section it already worked, but it only works when the report is included in the project and in using an independent report outside my project. i really need to know how to do it. it will help me a lot.

i really thank you for your time!
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8069004
I assume you can place the picture in the report?  You aren't having a file permission error by chance?

mlmcc
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 90 total points
ID: 8069016
This seems to apply but I am not sure how.

http://support.crystaldecisions.com/library/kbase/articles/c2007698.asp

http://support.crystaldecisions.com/library/kbase/articles/c2006500.asp

According to these you can only change objects in a section in that sections format event.

mlmcc
0
 

Author Comment

by:manduz_griffus
ID: 8069816
thanks again mlmcc! these solutions worked when i include or a a crystal report in my vb project. but what im trying to use is an independent report(crystal report) save as .rpt file not added to my vb project.
its really important to me.
thanks very much!
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8071651
This seems to be a permissions problem rather than a CR problem.

What references to CR have you included with your project?

mlmcc
0
 

Author Comment

by:manduz_griffus
ID: 8076068
hi mlmcc!

i've included crystal report smart viewer and
crystal report 7 activex designer run time library in my references.
should i include other references?

again, thank you very much!

manduz_griffus

0
 

Expert Comment

by:CleanupPing
ID: 8900881
manduz_griffus:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 8906664
Sorry.  Must have missed the update.  Can you run reports that don't include pictures?

Delete the picture from that report and try to display it from the VB application.

mlmcc
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9012095
Moderator, my recommended disposition is:

    Accept mlmcc's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

765 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