Addpictureobject()

mbarazi
mbarazi used Ask the Experts™
on
I have a vb.net program where I use the function AddpictureObject provided by
CRAXDRT library. I want however to scale the image as I am adding it to the Report.

mReport.Sections(ReportSection).AddPictureObject(strImagePath, xcoordinate, ycoordinate)

take a look at the attachment Format editor off clicking picture then format
I want to set the scaling or size prior to the picture being added or if I can have a place holder image on the template and then I would refresh with a this new image and it would inhereit the scaling/size. This would work also.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
You can't scale it with the AddPicture method.  You will have to find the object and use the scaling on the object.

mlmcc

Author

Commented:
This would mean that I would have to add 15 picture objects to the template and resize the one I decide to display within the code. I read online that I can have an OLEobject and load the image from the windows folder to that oleobject, could you tell me if that's possible and how?

Thanks
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What version of Crystal?

The .Net versions can't use the file path.

mlmcc
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Author

Commented:
I am using the RDC within vb6 which I believe is CR4.6. The templates reports are used as outside reports .rpt
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
RDC was introduced with CR 6 or 7 and is not for use with .Net.

This might be useful

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Reports/Q_25212351.html

mlmcc

Author

Commented:
You see I just want to set the width and height, the reason is because when I scale the image outside of crystal the image and then use the method addpictureobject, the printout has a bad resolution.
I am using very small images and printing on a 200DPI printer, but they look ok when I go ahead and scale down the image in crystal and then print.

I tried the following and it seemed to almost work except I have got an error "access denied" on first line

mReport.Sections(ReportSection).ReportObjects("Picture1").setOleLocation(strImagePath)
mReport.Sections(ReportSection).ReportObjects("Picture1").Height = 0.75
mReport.Sections(ReportSection).ReportObjects("Picture1").Width = 1.50


Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What is the file path?

mlmcc

Author

Commented:
\\servername\drive\folder\pic1.jpg
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
What version of Crystal.  Versions before CR9 don't support JPG

mlmcc

Author

Commented:
Version 8.0

Author

Commented:
I tried using a .bmp file that I downloaded off the internet and was not successful
I wonder if it has something to do with licensing, I noticed I saw other people who listed this error on this site but no solution just the persons decided to use a different method altogether.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
Which edition of CR8 do you have?
   Standard, Professional, Developer?

mlmcc

Author

Commented:
I have the Professional edition
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
The Professional edition doesn't include the license for distributing CRAXDRT though I don't think they started enforcing the issue until CR9.  You were able to build applications for use in your own organization.

Check this application from Crystal
https://smpdl.sap-ag.de/~sapidp/012002523100006011252008E/loadpicturedemo.zip

mlmcc

Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial