Vb Script - Ghs Symbol Logic Error S’abonner

0
Avatar
Legacy Poster

I am receiving the following error when i click 'test' button to check VB script - 

bartender error message #6900

OnNewRecord(Line 2): : Object required: 'mBTObj'

 

I get this same error on the 'onprintjobcancel' and 'onprintjobend'. I do not get errors when i 'test' on the 'functions and subs' or the 'onprintjobstart'.

 

I am trying to place GHS symbols on our existing product label. To do this, i have used the sample V10 GHS label design (attached) to make my changes. The sample uses a table (cvs) called GHS.csv. In order to make my own item testing data i am using a copy of the GHS table - field names all named the same - the only difference is the my table is called GSHtom.csv

 

I believe i have created all the necessary layers and within the data sources - Named Data sources and the GHS object values were copied direct from the sample format. I only changed the field reference for the pictogram (from ghs.pictogram to ghstom.pictogram.

 

Obviously as you can see in my new label design (attached) i am sourcing data from a database and the csv / CIJIGSAW table VWLABELQUERY and the ghstom table - joined by the item number and  product identifier. I know that my join is working - otherwise i would get no data found (followed by the error) when doing 'preview'.

 

I appreciate any feedback anyone can provide on this. 

 

8 commentaires

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

Generally there should be no need to modify the VB script that controls the GHS symbols whatsoever.  However, with that said there is a small error in the document level VB script concerning a variable name for the GHS symbol spacing method.  Either rename the "GHS_SpacingMethod" data source to be ""GHS_Spacing", or adjust the below variable reference on line 80 of the script.

 

Const const_nds_spacing      = "GHS_Spacing"

 

to

 

Const const_nds_spacing      = "GHS_SpacingMethod"

 

From what I can see the field you mention is in fact named "ghstom.pictograms" - note the "s" on the end.  In any case, I'd advise you to set an alias on the table and field names as the script relies on them to be named as expected.  if the field names are different then you have to mangle the VB script.  Far easier to set an alias where needed in your database connection.

 

Be sure to read the white paper as it explains the steps that are needed.  We are also in the process of producing a video on this subject too, so look out for that in the coming weeks.

 

http://www.seagullscientific.com/assets/images/industries/ghs-compliance-labeling.pdf

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Ian - first thank you very much for looking at this. Its great that your team can take the time to look at all of these and respond so timely. 

So - i took your advice and renamed my copy of the GHStom.csv to GHS.csv - this to simplify things a bit and keep it to be like your sample format. I reconnected the database to the csv and it appropriate brought up the data in the browse functions of the database and the csv. I also made the change to line 80 you suggested 'Const const_nds_spacing      = "GHS_SpacingMethod"' however i find it interesting that it worked with your sample template. And finally i saved, closed and reopened the template. Again checked all connections and then performed the 'TEST' button on the script - and i still get the exact error as noted previously. Any ideas? I have attached the updated btw file.

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

Difficult to say as I cannot test the label for I don't have access to your CIJIGSAW database.  Do you get the error when actually printing or previewing?  I ask as clicking on the "Test" button is not always helpful when making reference to database fields as you won't have an active connection to the database.  You'd probably need to put in default data for your field connected objects for this reason when doing such a test.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I do get the error on 'print preview'. Prompts for item number - then pops up the error. If I hit continue - it does bring up the label - but of course without the GHS symbols. And it comes up with the error again. I understand that you are limited without the jigsaw database table.

Thanks

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

I suggest you set the record selection in the Print dialog to be select at print time so you can see what records and data in each field is available to the label at print time.  I'd suspect that data from the database/datafile that you think will be in there for the label to use, isn't, hence the script having a problem due to missing input.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

I changed the location of the PICTOGRAM AREA and it now prints the graphics outside the area of the rectangle.

0
Avatar
Ian Cummings
Modérateur
Actions pour les commentaires Permalien

Make sure the pictogram area has an "Object Reference Point" of top left, which is found in the "Position" section of the object's properties.

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Thanks Ian, After fiddling with it for awhile I was able to get it where I wanted. The colored rectangle is way North of where the pictograms are located, though. It looks as if the code and colored gif got disconnected somehow, but I was able to position the pictograms and then hide the layer so that I could see the other fields that the rectangle was blocking.

Vous devez vous connecter pour laisser un commentaire.