Forum > Android

How to display barcode contents with jGridview?

(1/2) > >>

Hello all,
I want to make an android app to display barcode contents,get the same result as I did in PC(See attachments PC_1.png,PC_2.png,PC_3.png).

First line will display position in barcode, 2nd line display barcode content in that positon.

It's no problem to do so in PC program.With different length of barcode can be shown dynamic.

For android app, I plan to use JGridview, but I don't know how to adjust each cell's width.
Such as my attachment,after position 10, it will display as 1 and 0,become 2 lines.

Also JGridview has no position bar to move to see more content, difficult to see more contents.

Can any one help me how to do this?

Maybe jGridview isn't the suitable component? Is there any other component can do this?

Best regards,

Hi, Jovy!

What about "jTableLayout"  component.... ?? 

demo:   "AppTableLayoutDemo1"

For jTableLayout, the result is same, can not get scroll.

So I want to use jHorizontalScrollView and JGridview together.

I did a test for following code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{hint: Pascal files location: ...\AppLAMWProject1\jni }unit unit1; {$mode delphi} interface uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes, SysUtils, AndroidWidget, Laz_And_Controls, gridview;  type   { TAndroidModule1 }   TAndroidModule1 = class(jForm)    Button1: jButton;    HorizontalScrollView1: jHorizontalScrollView;    procedure AndroidModule1Create(Sender: TObject);    procedure AndroidModule1Destroy(Sender: TObject);    procedure Button1Click(Sender: TObject);  private    GridViewBarcode: array[1..100] of jGridView;   public    {public declarations}  end; var  AndroidModule1: TAndroidModule1;  i,iLen:integer;implementation  {$R *.lfm}   { TAndroidModule1 } procedure TAndroidModule1.Button1Click(Sender: TObject);begin end; procedure TAndroidModule1.AndroidModule1Create(Sender: TObject);begin   iLen:=52; //example, 52 chars for testing only   GridViewBarcode[1].Create(HorizontalScrollView1);  GridViewBarcode[1].Visible:=true;  GridViewBarcode[1].ColCount:=1;  GridViewBarcode[1].RowCount:=2;  GridViewBarcode[1].Cells[0,0]:='1';  GridViewBarcode[1].Cells[0,1]:='S1';  GridViewBarcode[1].PosRelativeToParent:=[rpLeft,rpCenterVertical];  GridViewBarcode[1].LayoutParamWidth:=lp96px;  for i:=2 to iLen do         begin         GridViewBarcode[i].Create(HorizontalScrollView1);         GridViewBarcode[i].Visible:=true;         GridViewBarcode[i].ColCount:=1;         GridViewBarcode[i].RowCount:=2;         GridViewBarcode[i].Cells[0,0]:=IntToStr(i);         GridViewBarcode[i].Cells[0,1]:='S'+IntToStr(i);         GridViewBarcode[i].Anchor:=GridViewBarcode[i-1];         GridViewBarcode[i].PosRelativeToAnchor:=[raToRightOf];         GridViewBarcode[i].LayoutParamWidth:=lp96px;         end;  end; procedure TAndroidModule1.AndroidModule1Destroy(Sender: TObject);begin  for i:=1 to iLen do           GridViewBarcode[i].Destroy; end; end.
But when I run the code, app will flash, then closed.
Is something wrong with my code?

Hi, Jonvy!

Put here some *.txt data (one bar code by line)  exemple...

I will try help you.....

Ok, I attach some txt here.
Each file means one barcode,barcode length is different, pls check it.



[0] Message Index

[#] Next page

Go to full version