1. In B4A Mod function works with a float. In B4i it does not compile.
2. I have a CustomListView that I am using strictly to format for printing to a pdf file. It is never visible. I have two columns of data. I fill it with a column of data then
This works fine in B4A but for some reason in B4i I had to move Dim bmp As B4XBitmap and do a dummy Snapshot before I start looping through data to fill the data.
Otherwise the first column of data looks like This:
Instead of this:
Note that only the first Column is wrong, and it only happens ONCE. The first time you open the program, go to the print page and create the file. (It is a B4x pages app and this is on its own page.)
B4X:
Dim X As Float
If X Mod 2 = 0 Then '<Fails in B4i, runs fine inB4a
.
.
.
B4X:
Do While RS.NextRow
.
.
'
'Dim bmp As B4XBitmap = PrintCLV.sv.ScrollViewInnerPanel.Snapshot '[B]This way FAILS in B4i, works in B4a[/B]
bmp = PrintCLV.sv.ScrollViewInnerPanel.Snapshot
If Y Mod 2 = 0 Then
DestRect.Initialize(40, ColTop, 305, (LineHeight * PrintCLV.Size) + ColTop - 10) '(612W, 792H) 297
Else
DestRect.Initialize(305, ColTop, 572, (LineHeight * PrintCLV.Size) + ColTop - 10) '(612W, 792H) 297
End If
RowsLeft = TotalRows - X
'10/25/12 ColHight = Min(ColHight, (LineHeight * RowsLeft))
#If B4A
pdf.Canvas.DrawBitmap(bmp, Null, DestRect)
pdf.Canvas.DrawText($"(${NumberFormat((Floor(Y / 2) + 1), 1, 0)})"$, (612 / 2), DestRect.Bottom + 30, Typeface.DEFAULT_BOLD, 5, xui.Color_Black, "CENTER")
pdf.Canvas.DrawLine(DestRect.Left, DestRect.Bottom, DestRect.Right - 1, DestRect.Bottom - 1, xui.Color_Black, .5)
#ELSE IF B4I
PDFCanvas.DrawBitmap(bmp, DestRect)
PDFCanvas.DrawText($"(${(Floor(Y / 2) + 1)})"$, (612 / 2), DestRect.Bottom + 30, Font.CreateNewBold(20), xui.Color_Black, "CENTER")
PDFCanvas.DrawLine(DestRect.Left, DestRect.Bottom, DestRect.Right - 1, DestRect.Bottom - 1, xui.Color_Black, 1)
PDFCanvas.Refresh
#END IF
B4X:
Dim bmp As B4XBitmap = PrintCLV.sv.ScrollViewInnerPanel.Snapshot '[B]This seems to be required to fix a bug in B4i[/B]
Do While RS.NextRow
.
.
Instead of this:
Note that only the first Column is wrong, and it only happens ONCE. The first time you open the program, go to the print page and create the file. (It is a B4x pages app and this is on its own page.)