I have garbage on the screen WebListBox

Xojo 2014r3.1 on Windows 7 32bit

If any one have same
I have garbage on the screen on WebListBox Look Bad

i send to show on WebListBox show a garbage after the number 5 but look like 15 but is 5

ListBox1.AddRow Rs.Field("ItemNum").getString
ListBox1.Cell(ListBox1.LastIndex,1)=Rs.Field("Description").getString
ListBox1.Cell(ListBox1.LastIndex,2)=format(Rs.Field("qtyonhand").IntegerValue,"-####0;####0;")
ListBox1.Cell(ListBox1.LastIndex,3)="0"
ListBox1.Cell(ListBox1.LastIndex,4)="0"
ListBox1.Cell(ListBox1.LastIndex,5)=format(Rs.Field("cost").CurrencyValue,"##,##0.00") // Defalult Cost
ListBox1.Cell(ListBox1.LastIndex,6)=format(Rs.Field("cost").CurrencyValue,"##,##0.00") // Defalult New Cost
ListBox1.Cell(Listbox1.LastIndex,7)=format(Rs.Field("saleprice").CurrencyValue,"##,##0.00") // Defalult Sales Price
ListBox1.Cell(Listbox1.LastIndex,8)=format(Rs.Field("saleprice").CurrencyValue,"##,##0.00")

You might want to check the encoding of the string since this is coming from a database. This can sometimes produce garbage in the string. Search the forums or docs if you need more information on encodings

ListBox1.AddRow Rs.Field(“ItemNum”).getString
ListBox1.Cell(ListBox1.LastIndex,1)=Rs.Field(“Description”).getString

Both of these probably need a DefineEncoding on them otherwise Xojo wont know what encoding this data is

*darn phone rang & brock beat me to it :stuck_out_tongue:

This format string looks strange. But can you describe your situation a little more? What is displaying where. It’s hard to look at your code and match it to your description of the problem. Which column? Have you examined the data coming out of your database? Maybe there is a weird character or something. Give us more to go on.

FeedBack#37673

I test like this ListBox1.Cell(ListBox1.LastIndex,2)=“5” and is the same look like 15 on the listbox

So who i use the encoding with it

Same

ListBox1.AddRow DefineEncoding(Rs.Field("ItemNum").getString,encodings.UTF8)
ListBox1.Cell(ListBox1.LastIndex,1)=DefineEncoding(Rs.Field("Description").getString,encodings.UTF8)
ListBox1.Cell(ListBox1.LastIndex,2)=DefineEncoding(format(Rs.Field("qtyonhand").IntegerValue,"####0;-####0;"),encodings.UTF8)
ListBox1.Cell(ListBox1.LastIndex,3)="0"
ListBox1.Cell(ListBox1.LastIndex,4)="0"
ListBox1.Cell(ListBox1.LastIndex,5)=format(Rs.Field("cost").CurrencyValue,"##,##0.00") // Defalult Cost
ListBox1.Cell(ListBox1.LastIndex,6)=format(Rs.Field("cost").CurrencyValue,"##,##0.00") // Defalult New Cost
ListBox1.Cell(Listbox1.LastIndex,7)=format(Rs.Field("saleprice").CurrencyValue,"##,##0.00") // Defalult Sales Price
ListBox1.Cell(Listbox1.LastIndex,8)=format(Rs.Field("saleprice").CurrencyValue,"##,##0.00")
1 Like

Can’t reproduce. Can you post a screen capture?

Hi Tim
Can this problems can be i am working on a Virtual Machine VMware Fucion on mac.

i try on Xojo on Mac and same error

@Alexis Colon Lugo , as @Norman Palardy and I have mentioned. You most likely need to change the Encoding. This isn’t a bug per say., but most likely an undefined encoding coming from the database.

but i try
ListBox1.Cell(ListBox1.LastIndex,2)=“5” and i have same

To get rid of a possible encoding issue, what happens if you send a “SET NAMES ‘utf8’” to the database connection right after it’s established?

https://xojo.io/994379ae030f

I dont see any 5 that looks like 15 in that image

The format is fine
It actually takes a 3 parts string positive; negative; zero - like Excel :stuck_out_tongue:
See http://documentation.xojo.com/index.php/Format
The formatSpec can be made up of up to three formats separated by semicolons. The first format is the format to be used for positive numbers. The second format is the format to be used for negative numbers and the third format is the format to be used for zero.

Windows 7
Code
ListBox1.Cell(ListBox1.LastIndex,3)=“5”
https://www.dropbox.com/s/6a9r7r5f8m44ake/WebListBox_02.png?dl=0

What happens when you change your code to

ListBox1.Cell(ListBox1.LastIndex,3)="5"
ListBox1.Cell(ListBox1.LastIndex,4)="5"
ListBox1.Cell(ListBox1.LastIndex,5)="5"

Do they all look the same? Or is it just the one column?

Same

I found the Error is when i use ColumnWidths 24%,40%,0%,8%,8%,10%,10%,0%,0% to hide some Columns

Try “0” instead of “0%”. Fixed width instead of percentage. Just a wild guess.