How to Print Barcode Labels

Is there a way to make a report where the data is shown by column for example
Table1

id - barcode
record1 - code1
record2 - code 2
record3 - code 3
record4 - code 4
record5 - code 5
.
.
.

I want to print only the bar codes.
how they should appear in the report

code1 - code2 - code3
code4 - code5 ...

 

Thanks

0 19 420
19 REPLIES 19

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Agasys 


@Agasys wrote:

s there a way to make a report where the data is shown by column for example
Table1

id - barcode
record1 - code1
record2 - code 2
record3 - code 3


What about this table in your report template:

id barcode
<<Start:yourTable[id]>><<[id]>> <<[barcode]>><<End>>

For reference:

Use Start expressions in templates - AppSheet Help


@Agasys wrote:

I want to print only the bar codes.
how they should appear in the report

code1 - code2 - code3
code4 - code5 ...


For this, you may want to try:

<<Start:yourTable[id]>><<[barcode]>><<End>>

Thanks for the answer. I already had it this way but what happened was that the records were repeated in the lines, printing the same information 3 times in each line. Getting like this:

<<START:Produtos[Codigo Produto] >><<[CodigoBarra]>>

<<[CodigoBarra]>>

<<[CodigoBarra]>><<END>>

print.png

 

thank you for the help

Hi @Agasys 

I don't get it. The output is compliant with your Start pattern.

Which output would you want to have?

If understanding of your requirement is correct , please try 

<<START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
)/ 3)=1,

[CodigoBarra]

)>> <<END>>

<<START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
)/ 3)=2,

[CodigoBarra]

)>>  <<END>>

<<START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
)/ 3)=0,

[CodigoBarra]

)>><<END>>

 

This approach basically finds the index of the key [Codigo Produto] in the total list of keys Produtos[Codigo Produto] and if the index number is in the series, 1, 4, 7, ....it should print in the first column, 2, 5, 8....., it should print in the 2nd column and for 3, 6, 9....., it should print in the last column.

The finding index expression is based on the tip by @Steve , mentioned below

INDEXOF() - Google Cloud Community

Edit: made some changes in the expressions.

 

 

Thank you very much for the answer, Suvrutt_Gurjar I am starting with the appsheet and I have some difficulties yet, with your demonstration I got the result has not yet been satisfactory, because it was like this:

Agasys_1-1689093870043.png

 


But starting from your idea I found a solution and solved part of the problem, now it is only left to find out how to make a range for each column in this piece of code in ([_ Rownumber], list (1,4,7) ... because in the first block All records should be located in this sequence 1,4,7,11,14,17 ... Until the end of the records, if I have an idea to help me get grateful.
Now the impression was as I needed.
Thanks also to Aurelien
The report was thus

 

Agasys_0-1689093496890.png

 

 

 

 

<<START:FILTER(Produtos, IN([_ROWNUMBER], LIST(1,4,7)))>><<[CodigoBarra] >>

<<END>>

 

<<START:FILTER(Produtos, IN([_ROWNUMBER], LIST(2,5,8)))>><<[CodigoBarra] >>

<<END>>

 

<<START:FILTER(Produtos, IN([_ROWNUMBER], LIST(3,6,9)))>><<[CodigoBarra] >>

<<END>>

 

Thank you for update and modifying the idea suggested. 

Yes, this simple expression will work if all the rows of the table are serially present and one needs all the rows serially in the report. But almost every time there is some logic to select rows , for example date range or order status ( complete or incomplete), sales of a particular state and so on. During such times, the created list does not have serially arranged row numbers and hence complex indexing logic is required. 

Nice to know that you got a work around.  I think I may need a bit of tweak in my expression. I will revert tomorrow after testing. 

 

This is true, I need to improve this solution, I will think in some way of the numbering of the lines always be sequential, if you can improve your solution I get grateful if you can send me, thanks again

Hi @Agasys ,

I tested my suggestion and it works perfectly. I realized that there was a typo in my earlier shared expression. Instead of comma "," there was a slash "/" in MOD() expression. The following template is corrected and it should work.

START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
) , 3)=1,

[CodigoBarra]

)>> <<END>>

<<START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
) , 3)=2,

[CodigoBarra]

)>>  <<END>>

<<START:Produtos[Codigo Produto] >>

<<IFS(MOD(COUNT(
SPLIT(
ANY(
SPLIT(
(" , " & Produtos[Codigo Produto] & " , "),
(" , " &[Codigo Produto] & " , ")
)
),
" , "
)
),  3)=0,

[CodigoBarra]

)>><<END>>

The test results in my test app are shown below.

The report looks like below

Suvrutt_Gurjar_0-1689135703379.png

The products are arranged in the view as below. So you can see that in the report above, the images are aligned  horizontally as 1, 2 , 3 and then 4, 5, 6 and then 7,8, 9 and then 10 

Suvrutt_Gurjar_1-1689135934373.png

 

 

 

Estimated friend Suvrutt_Gurjar, I greatly thank the attention to me, I had already detected the problem in the mod function and made the correction.
I now tested your solution again and I must be doing something wrong because the result is not expected.
The data is recorded like this

Agasys_1-1689167605380.png

In the template it was placed like this

<<START:Produtos[Codigo Produto]>><<IFS(MOD(COUNT(SPLIT(ANY(SPLIT((" , " &Produtos[Codigo Produto] & " , "),(" , " &[Codigo Produto] & " , ")))," , ")) ,3)=1,[CodigoBarra])>> <<END>><<START:Produtos[Codigo Produto]>><<IFS(MOD(COUNT(SPLIT(ANY(SPLIT((" , " &Produtos[Codigo Produto] & " , "),(" , " &[Codigo Produto] & " , ")))," , ")) ,3)=2,[CodigoBarra])>>  <<END>><<START:Produtos[Codigo Produto]>><<IFS(MOD(COUNT(SPLIT(ANY(SPLIT((" , " &Produtos[Codigo Produto] & " , "),(" , " &[Codigo Produto] & " , ")))," , ")) ,3)=0,[CodigoBarra])>>  <<END>>


And the result presented is this

Agasys_0-1689167552712.png

 

I could say where I am wrong
Again I thank you for your attention

Could you please share your actual template ? 

Estimated friend Suvrutt_Gurjar, look at this situation, I got the expected result but it was necessary to include another information in the case " ", has any explanation for this fact?

In the template it was placed like this

Agasys_0-1689169491504.png

 


And the result presented is this

Agasys_1-1689169540691.png

 

Another question, if I want to put 4 columns instead of 3 what would the change be like?

<<IFS(MOD(COUNT(SPLIT(ANY(SPLIT((" , " &Produtos[Codigo Produto] & " , "),(" , " &[Codigo Produto] & " , ")))," , ")) ,4)=1,[CodigoBarra])>>

column1 = 1, column2 = 2, column3 = 3 and column4 0

Was this?

Again I thank you for your attention and apologize for my English


@Agasys wrote:

column1 = 1, column2 = 2, column3 = 3 and column4 0


You are correct.


@Agasys wrote:

Again I thank you for your attention and apologize for my English


You are welcome, You need not apologize at all. We all have different native languages. Even my native language is not English. Of course, I studied my college education in English.

Suvrutt_Gurjar_0-1689170737056.png

This output looks decent. Even though I understand that each barcode can be in a separate cell. I will try different template format and revert , if I can manage to do the needful.

I see in your template that you have IFS() expression twice in each cell. You can have it only once. Any specific reason you have it twice?

Your template is still not available. But anyway please do not share the document As I mentioned, your picture of template makes it clear how it is there. Please reduce the IFS() statement to just one per cell.

Suvrutt_Gurjar_0-1689171741975.png

 

Please try the following format, this will ensure you can have each bar code enclosed in a separate cell. Please note the additional cell in which <<[CodigoBarra]>> is placed.

<<START: SELECT(Produtos[Codigo Produto], MOD(COUNT( SPLIT(ANY(SPLIT(  (" , " & Produtos[Codigo Produto] & " , "),(" , " & [Codigo Produto] & " , ")))," , " )),3)=1 )>>

<<[CodigoBarra]>>

<<END>>

<<START: SELECT(Produtos[Codigo Produto], MOD(COUNT( SPLIT(ANY(SPLIT(  (" , " & Produtos[Codigo Produto] & " , "),(" , " & [Codigo Produto] & " , ")))," , " )),3)=2 )>>

<<[CodigoBarra]>>

<<END>>

<<START: SELECT(Produtos[Codigo Produto], MOD(COUNT( SPLIT(ANY(SPLIT(  (" , " & Produtos[Codigo Produto] & " , "),(" , " & [Codigo Produto] & " , ")))," , " )),3)=0 )>>

<<[CodigoBarra]>>

<<END>>

 


@Agasys wrote:

I don't know how to share correctly follows the link


 

Thank you. The shared document is not accessible. But please do not worry, you need not share it. I got the idea of your template from the shared image. I will revert if I find a good way to put each bar code in a different cell. 

But generally your current output looks good, except for the bar codes not having independent cell.

Top Labels in this Space