Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting picture in report at runtime 1

Status
Not open for further replies.

DarrenWard

IS-IT--Management
Feb 15, 2002
217
GB
I am trying out a barcode ocx that has a picture property, I want to print a report or run off lables and put the barcode on them, the barcode will be different for every page/label, I have bound the ocx to the data but am struggling to get the picture into the report, help!

On a slightly wider issue, I am using the ocx because it automatically creates the check digit and puts bearer bars around the barcode etc, I also have the option of using a barcode font, this will be easier to use but I do not think will be as flexible, I would welcome any comments or experiences on this from others.

Darren

GuiltyMaggot - The best rock band in the world!
 
I'd go with a barcode font - they are nice and easy to use, no messing with ocx controls, easy to install on target machines too.

This is a free one (to a point - read the licence!)


Regards

Griff
Keep [Smile]ing
 
Griff,

The barcode font is definately the easiest way to go, there is going to be a cost involved no matter which way I go as this is software that will be utilised on various different client machines, so that is not really an issue.

Is there an wasy way to get get a controls picture into a report at run time? I would like to try both methods before deciding what way to go.

Darren

GuiltyMaggot - The best rock band in the world!
 
Since you can't drop an ocx control on a report, I don't see how you could get a controls property directly on a report. The control is obviously going to draw a picture of a bar code somewhere, but without seeing where it would be it's hard to figure out how you could maybe reference it with a UDF or something.
Take a look at LOADPICTURE() and SAVEPICTURE(). You may be able to get something to work with them.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
The control has a picture property as stated in the original post, the same as an Image control, in VB I could use something like;

Printer.PaintPicture oleControl.Picture, XPos, YPos

Darren






GuiltyMaggot - The best rock band in the world!
 
Right. But there are some 'limitations' of VFP when it comes to using ocxs.
-You can't drop the control on the report
-There isn't a printer object in VFP
-Output either goes to the screen or printer

You may be able to drop the oleControl fro a report picture on the report, and reference it that way but I'm not sure.

For all the hassle though, a font would not only be easier, but probably more reliable.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Wouldnt there be a way to drop the picture into a General field in a table then access the picture within the form from there?

Darren

GuiltyMaggot - The best rock band in the world!
 
Sorry to be a pain, I was playing with this over the weekend and still cannot get this to work, can it be done?

I came across some sample code that used a bound control in conjuction with an ocx and the a general field in a table but I couldnt make it work.

Darren

GuiltyMaggot - The best rock band in the world!
 
DarrenWard.

I was requested recently to add a Word document to a report as a summary page. I could have automated Word to output the document separately, but I needed an acurate pagecount, so I tried to scan the document into a jpg and put it into a General field and using an OLEBound Activex control on my report, I was able to have the document appear in my report as a summary page. Although I did not choose this as a final solution since the document itself was 1.3 megs, and it took an eternity to print, I finally went with saving the original document as an RTF document, bringing into a Genaral field of a cursor and using an OLEBound Activex control on my report. It is not exactly what you need, but the solution would be the same, bring the "picture" into a general field and use an OLEBound control on your report.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks mike,

This is kinda where I was going, but I cant seem to get the picture into the General field of the cursor, any chance of a quick bit of pseudo code to point me in the right direction.

I have worked out that I need to use something like;
APPEND GENERAL myCursor.Picture Class Barcode.Picture

Or something like it!

Darren

GuiltyMaggot - The best rock band in the world!
 
DarrenWard

APPEND GENERAL myCursor.Picture Class Barcode.Picture

And what is the result using the code? I'm not sure about "Barcode.Picture". The class refers to the OS class associated with a picture on your system, not the OCX itself.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
If I use the above I get a OLE Invalid class string error.

Darren

GuiltyMaggot - The best rock band in the world!
 
DarrenWard

Unless the Barcode is a valid OLE class, you will get this type of error. I noticed you have not specified the actual picture you are try to use. The format should be:

Code:
SELECT myCursor
GO BOTTOM
APPEND BLANK
APPEND GENERAL myGeneralField FROM myPicture.bmp

You might want to try it without the Class name.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top