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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange report error

Status
Not open for further replies.

DarrenWard

IS-IT--Management
Feb 15, 2002
217
0
0
GB
I have an ActiveX on a form and also an ActiveX Bound Control.

And the following code;

CREATE CURSOR _report (bcText c(50), BC g)
SELECT _report
APPEND BLANK
REPLACE bcText WITH "123456789"
APPEND GENERAL BC CLASS TBarCode5.TBarCode5
WITH THISFORM.BoundControl
.CONTROLSOURCE = "_report.BC"
.BarCode = 16
.PrintDataText = .F.
.REFRESH
.Text = "123456789"
.REFRESH
ENDWITH

REPORT FORM 'rp032' NEXT 1 TO PRINTER NOCONSOLE
thisform.Barcode_Invisible.ControlSource = ""
USE
SELECT WWO

The report has a bound control pointing to BC and a couple of text boxes, if I execute the code I get a "Variable 'BC' is not found" error, but if I direct the print to the screen or insert a 'BROWSE' command just before the 'REPORT FORM' it works find!!! Although if I send output to screen and then click on the print button on the print preview toolbox I get the error again.

Another thing that I have noticed is that when the 'USE' is processed it closes the table WWO and not _Report, and if I ommit the 'USE' command WWO ends up at eof as if the report had been run using this table, it makes no sence, I have the same code running on other forms and it works direct to printer ok.

Darren

GuiltyMaggot - The best rock band in the world!
 
I have the same code running on other forms and it works direct to printer ok.

So you are saying you can do the printing routine on other computers but not yours? Or are you just having problems with the file closings on yours?

if I direct the print to the screen or insert a 'BROWSE'
I have yet to hear of anyone who has successfully printed anything having to do with an Active-x control, to a printer.
If you're just trying to print barcodes, you would probably be better off installing a bar code font and using it in your report's text fields.

The last issue is probably the default data session versus the report's data session.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
All code is running on my machine, there is definately something wrong with this form and the reports data session, it prints perfectly to the screen using the data expected but then closes the wrong table, I can get it to work if I cut and paste the code again, store the current record pointer before creating the temp cursor, restore the record pointer and dont delete the temp cursor until I exit the form, but its a compromise.

Ive tried deleting and creating the report from scratch, but same result just on this form.

Ive been using the ActiveX sucessfully for a while, so you have met someone now ;-) its was a lot easier than the font option, the control calculates the check didgit and takes car of the barcode ratios ect. this would not be that easy with a font a and EAN128 barcode.

Darren

GuiltyMaggot - The best rock band in the world!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top