Erreur : [500] Could not execute the specified command: Index was outside of the array
Dear,
Recently I passed from Bartender 2016 to Bartender 2022 Automation (2 printers) under Windows 11 with Excel databases.
Lately I'm facing an error on a new project:
"Erreur : [500] Could not execute the specified command: L'index était hors limites. Il ne doit pas être négatif et doit être inférieur à la taille de la collection.
Nom du paramètre : index"
In English it's Index was outside of the array (I don't know what it means), according to my investigations it is a problem linked to Excel files connections.
I've found a similar publication ( https://support.seagullscientific.com/hc/en-us/community/posts/4424183946263--500-could-not-execute-the-specified-command-Index-was-outside-of-the-array?input_string=Erreur%20%3A%20%5B500%5D%20Could%20not%20execute%20the%20specified%20command%3A%20Index%20was%20outside%20of%20the%20array ) but without clear solution.
Any idea how to solve it?
Thanks
-
pthane
★ BarTender Hero ★
The solution mentioned in the linked post was that they reinstalled BarTender and that got rid of the error.
You could also try linking to a different excel spreadsheet and see if that works
0 -
qualite
★ BarTender Hero ★
Thanks for your interest Peter.
I tried to reinstal BT, Windows and update the different versions of SQL server present on my computer but nothing works.
Something interesting is that the problem appears only if I use more than 3 tabs in my excel spreadsheet.
I also opened a ticket in the Bartender support center, but without success until now.
When I googlize "Index was outside of the array" I can see there is a problem on various software using databases and it often reports SQL, but no solution found so far.
0 -
pthane
★ BarTender Hero ★
Thats odd I can link to excel files with multiple worksheets without issue. Try creating a new test label and link to the spreadsheet from that and see what that does, as it could be an issue with the label or spreadsheet themselves where the problem is
0 -
qualite
★ BarTender Hero ★
I tried to work on a whole new BT file and a "dumb" Excel file with simple data, in order to reproduce the error.
Perhaps I'm intenting something that is not possible in BT?
My 4 excel sheets:
My table joins:
My error (having invites or not don't change the error):
In BT2016 when I had a problem in my joins I used to have an error like "join error".
0 -
pthane
★ BarTender Hero ★
You have an extra join command that isn't needed, try removing the 3rd one and see what happens:
Mine works correctly without this (Selected Client "Bill" and product 3)
0 -
qualite
★ BarTender Hero ★
Thanks Peter, I don't have the error anymore.
However by quitting the "extra" join condition I receive several results as you do.
As in my original database I have some sets of 3 records with each one its translation (as in my example), at the end I get 3 labels with 3 different translations...
There's no way to filter it to have only 1 result?
0 -
pthane
★ BarTender Hero ★
The problem is the filter and I believe you need to add an extra level to this. I assume it is the Town/Ville you also need to select and so your filter should look somehting like this which as you can see only pulls through one record now
0 -
qualite
★ BarTender Hero ★
One way to solve it is indeed to add an extra filter.
But an extra filter needs an extra data entry control on the form. In order not to have non consistent information, I put an extra control for the language (linked to Colour.colour) with "Source=query prompt value" and ticked the option "Depends on: client". It works but the operator needs to click in a 1 choice list every time... that seems dumb.
But I don't understand why we need to add this extra filter as the information is already stored in the database with the Product (1 product record has 1 town), in your screenshot you already linked the Product.town with Town.town.
With 1 filter on the Product it already filters the town and colour.
With 1 filter on the Client it already filters the language.
Or is it where I'm mistaken?
0 -
pthane
★ BarTender Hero ★
My guess is the SQL statement needs to be made a custom statement to process the joins correctly as there does seem to be some form of issue with them.
There maybe another way round this by perhaps conditional printing or VB in the label template itself and when I get a chance I will see if I can work something out
0 -
pthane
★ BarTender Hero ★
This should work:
Add a field on to the side of the label so that it doesn't print and make this a Named field (I called mine LangCheck for language check) and set it as an VB Script > Event Controlled Script. Then click the edit button.
In the entry box for OnAutoSelectedEvent change the entry to Value = "Y"
Next click on the OnNewRecord option and in the entry/coding box type in something like this
To enter the database field names double click on the database names shown in the column on the right which should be something like client.langue and ville.langue for you.
Click Close and Close to come out of the field then right click on Template 1 and go into the Properties of this and click on the button to the right of the Print When box (it will say Always to start off with). On the next screen edit the Conditionally based on expression settings so that the Named Data Source name, set above Equals Y.
This should mean that the only label to print will be when the client.langue = ville.langue
0 -
qualite
★ BarTender Hero ★
Good morning Peter,
Thank you so much, you're a true BT genius!
As in my original database I have several tables with the problem of language, I had to replicate the conditions for sorting in the vb script, it's not very nice but it works!
"If Field(language)=Field(origin) and Field(language)=Field(packaging) and ... then"
I wish you a wonderful week.
0
请先登录再写评论。
评论
11 条评论