Medtun
30th December 2015, 13:32
Hi,
Is it possible to use different font size in a label report(whwmd543001000) ?
This report is a bit special. It contains only one text field that holds all the informations that will be printed on the label.
Actually all the informations are printed with the same font size. It would be better if i could choose a bigger size for some of the fields and keep the usual size for the others.
Thank you.
OmeLuuk
30th December 2015, 17:42
Customize the report, break up the text field into different separate fields you put on the report and use different fonts for the same. Should be doable.
Medtun
4th January 2016, 16:20
Hello OmeLuuk, happy new year and best wishes.
How can i, please, break up the text field ?
My report is whwmd543001000.
In report layout(ttadv3531m000), i have a "Detail" layout with only one field :
label.text (domain : tc.txtn) with lenght 80.
In "Report input fields"(ttadv3532m000), i created label1.text and label2.text same as label.text
I added them to "Detail" layout. But this did not worked. I gets the same informations duplicated 3 times.
I made some searchs. But, i did not found a way to assign one specific line for each field.
mark_h
4th January 2016, 17:20
Somewhere you will need to separate out the text into string fields. So the label1.text and label2.text will be string fields and not a text field. Then in either the report script or session script you pull out of the text field whatever information you need and assign that to the label1.text and label2.text fields. I believe that is what Omeluuk was referring to in his response.
mark_h
4th January 2016, 22:11
Forgot to mention there are a couple of ways to move txt to strings - you can use txt.to.buf. Then you can parse out the information you are looking for into the two text fields.
Medtun
5th January 2016, 18:09
Thank you mark_k,
I did some researches and this is my code. My label text contains 8 fields in 8 lines :
#include <bic_text>
string text_buf(40,8),F1,F2,F3,F4,F5,F6,F7,F8
long ret
set.mem(text_buf, "")
ret = TEXT.TO.BUF("whwmd520.txta", "4", 8, text_buf)
F1 = text_buf(1,1)
F2 = text_buf(1,2)
F3 = text_buf(1,3)
F4 = text_buf(1,4)
F5 = text_buf(1,5)
F6 = text_buf(1,6)
F7 = text_buf(1,7)
F8 = text_buf(1,8)
Normally, i have to add 8 fields in the layout. but actually i have something wrong.
mark_h
5th January 2016, 22:52
What exactly is wrong? To me you need to make f1 thru f8 all a length of 40. Maybe move to the next line and say string*40 f1...f8. Something like that - because it looks like you will get only the first character for the 8 fields.
Medtun
6th January 2016, 15:51
The problem was that two fields on the report weren't of string type but long.
So, i changed them to string and actually compilation is ok.
But, when i print, i gets 42 empty labels !
Maybe my text table is wrong. i tried with whwmd530.txta and whwmd520.txta.
Another problem is that in report layout, i cannot insert more than 3 lines.
Medtun
6th January 2016, 17:27
problem of layout lines is ok.
mark_h
7th January 2016, 16:38
Did you change the length of f1 thru f8? Or is it printing okay now.
Medtun
7th January 2016, 17:30
I'm still at the same point. i still gets 42 empty pages.
Normally, i changed the lenght :
string F1(40),F2(40),F3(40),F4(40),F5(40),F6(40),F7(40),F8(40)
mark_h
8th January 2016, 00:08
Is whwmd520.txta part of the input fields to the report? When you run it in debug mode what do you see in it? You should see a number - at least in 4c4 I would. Then what ends up in text_buf field?
Medtun
8th January 2016, 13:30
This is the debug tracing result :
lb.sem = 1
text_buf stays "halt"
ret : "halt"
F1,..., F8 : unresolved
mark_h
8th January 2016, 15:23
Once again - make sure whwmd520.txta has something in it. Make sure it is an input field to the report. Make sure that the session script passes it to the report. Before anything else will work you have to fix the data and make sure it contains what you are looking for.
Medtun
8th January 2016, 17:39
That is the question.
The label's mantaining session is whwmd5520m000.
The variables are stored in the text file appended to the label's line.
The text's number is 107148.
I supposed that the text would be in whwmd520.txta but apparently it's not true.
I made many searches. and found nothing till now.
is there a way to find this text's table ?
mark_h
8th January 2016, 20:50
In 4c4 the txt is stored in tttxt010. I can take the txt number and go look it up in that table. I can't speak for ln.
benito
8th January 2016, 22:21
mark, it's the same in LN. texts are in the same table as in 4c4. also whwmd520.txta does exist and it contains text number.
Medtun
11th January 2016, 12:59
Good morning, nice week for you.
May i ask you :
How to acess to a .txta table ?
How to access a text table using the text's number ?
I already got my text number through tttxt1100m000 session. The number is 107148.
mark_h
11th January 2016, 14:47
Not sure I get the questions - but you can look at it thru table maintenance(ttaad4500 or ttaad4100 on 4c4). Or since you know the text number you can go into the report and set the text number right before the text to buf. Just to see if the code works. If the code works then you need to figure out why the text is not set correctly in the report script.
Medtun
11th January 2016, 17:59
With GTM(ttaad4500) and GTD(ttaad4100), i can access to "normal" tables(for example table whwmd520). but i cannot access to ".txta" tables(for example whwmd520.txta).
How can i call the text in the code using its number ? how can i "set the text number right before the text to buf" ?
Sorry if my questions seems so evident and thank you again for your help.
mark_h
11th January 2016, 20:11
You should be able to access the tttxt010 table thru ttaad4500. Then just search on the txt number. At least then you could confirm something was in that text number.
For the code just set whwmd520.txta=107148 right before the text to buf command. That would let you know if the code works.
Medtun
12th January 2016, 12:12
Good morning Mark,
There is an improvement now.
i declared :
table twhwmd520
I added in the code as you told me :
whwmd520.txta=235 (the right text was 235 and not 107148).
When i print, i gets as expected the 8 fields(corresponding to F1,.. F8) created on the label but with one problem.
I gets the names of the variables instead of their values.
For examle i have in my text a field named "#bc.lb.quan.inv" which is stored in F5 and should display the quantity. Instead of the quantity, i gets "#bc.lb.quan.inv" printed on the label.
benito
12th January 2016, 17:02
medtun, maybe you should provide screenshots so people here can better help you (screenshots of table, etc). some of the things that you are doing are not necessary. if you can post your script, it would also be helpful.
Medtun
12th January 2016, 18:02
This is my script :
#include <bic_text>
extern domain tcweek lb.sem
extern domain tcyrno lb.year
string text_buf(40,9),F1(40), F2(40),F3(40),F4(40),F5(40),F6(40),F7(40),F8(40),F9(40)
long ret
table twhwmd520
lb.sem = val(sprintf$("%u(%02W)", utc.num()))
lb.year= val(sprintf$("%u(%02y)", utc.num()))
set.mem(text_buf, "")
whwmd520.txta=235
ret = TEXT.TO.BUF("whwmd520.txta", "4", 9, text_buf)
F1 = text_buf(1,1)
F2 = text_buf(1,2)
F3 = text_buf(1,3)
F4 = text_buf(1,4)
F5 = text_buf(1,5)
F6 = text_buf(1,6)
F7 = text_buf(1,7)
F8 = text_buf(1,8)
F9 = text_buf(1,9)
These are my variables :
http://imageshack.com/a/img903/1333/vae52T.png
My report layout fields :
http://imagizer.imageshack.us/v2/xq90/903/msr1np.png (https://imageshack.com/i/p3msr1npp)
This is what i gets :
http://imageshack.com/a/img905/6788/O75V85.png
mark_h
12th January 2016, 21:08
This is a lot different than I initially thought - based off what you have posted. When you hard coded 235 as the test number that is what I expected to happen. It would print the text. That tells me the text number is not being passed to the report. So that would be the session code or adding the text number to the report as an input field.
Now what you are wanting to happen is something related to barcodes it looks like to me. I am not sure how to make that happen. All of our barcoding is done through the RMS Label tool on our zebra printers. I do not know how to do what you are asking - I am sure there is a way, but I do not know it.
benito
12th January 2016, 21:42
now i am not sure whether you can do this without source code, or other methods. i hope i'm wrong. the report layout fields should contain only one print expression = label.text with a domain txtn. this is the one that you need to pass to the label layout, not f1, f2, etc. the problem is how can you append f1, f2...into label.text. it might be possible but not the way you are doing it. i hope someone else can throw their 2 cents.
benito
12th January 2016, 22:54
looks like it's possible to modify the label.text but then you need to pass a variable that will be contained in label.text. in order to see what's inside the label.text i appended the following test code in the existing report script:
#include<bic_text>
extern string comm1(200)
domain tcmcs.str80 comments.text(5)
long rc
detail.1:
before.layout:
rc = text.to.buf("label.text","2",5,comments.text)
comm1 = comments.text(1,2)
message(comm1)
i am getting a message Qty:#lb.quan.str U/M:#lb.unit.....etc
you can have a variable like #lb.texta but then you need to modify your label layout to contain this. this should get you started in the right direction.
Medtun
13th January 2016, 13:14
something is strange : when i use your code in my report script. the message box i gets is empty. label.text exist in the layout thought.
Medtun
13th January 2016, 13:19
My goal is to set different font sizes to the fields of my label.
Actually i can print a correct label. But, all the fields have the same font size.
I can add variables to label.text. I've added the week and the year numbers. All i have to do is to define them in the report script and add them in the appended text of my label disposition in session whwmd5520m000.
The problem then is that all the variables are printed with the same font size.
Normally, there is a place in LN where label.text is linked to whwmd520.txta or 235 text(on our system).
And it should be a reason why the system calculate the variables contained in "label.text" and doesn't calculate those i added in my script.
is it because label.text is declared as a text whereas mine are string ?
benito
13th January 2016, 14:42
medtun, yes let's rewind a little. look at your report whwmd5430011000 and go to Input fields. there you would see label.text but also variables like bc.lb.order, etc. this is what you need to break down on each layout. i tried adding another detail.2 and added bc.lb.order (order number). you can change the whole layout font or just the font size itself as omeluuk and mark suggested earlier.
Medtun
13th January 2016, 16:24
"why make it simple when you can make it complicated"
It was as simple as that.
what a shame lol
Anyway, thank you very much guys for the help.
I learned a lot from you.
benito
13th January 2016, 16:58
welcome. i learned something too. i haven't done what you just did but it made me look at how this thing works. still a good effort.
Medtun
15th January 2016, 11:56
Hi,
I just wanted to show you the final result. Not that bad. Thank you again.
Have a nice day.
http://imagizer.imageshack.us/v2/xq90/911/T8gtyE.png (https://imageshack.com/i/pbT8gtyEp)
mark_h
17th January 2016, 20:47
Congrats - glad you got it sorted out.