Roeland
17th August 2010, 17:19
I like to show an array of strings in a report header.
For example somthing like this:
extern domain tcmcs.str80 header(30)

I defined this field in de report with depth 30.
Then I have a header layout with this field.
expression = header

When compiling I get this error:
Argument 1 (header) for function 'strip$' should have 1 dimension (not 2).

I'm not sure from where this strip$ is coming. It's not in my code.

Any solution/ideas?

mark_h
18th August 2010, 01:23
If this is an array then you need to specify which element of the array. So you would have to put all 30 fields - each field would look like header(1), header(2), etc. So you cannot print all 30 elements by just putting header in the print field.

sameer.don
18th August 2010, 06:46
If this is an array then you need to specify which element of the array. So you would have to put all 30 fields - each field would look like header(1), header(2), etc. So you cannot print all 30 elements by just putting header in the print field.


In fact this is being the array of string, you will have to put it like
header(1,1)
header(1,2)
header(1,3) ...
and so on.

mark_h
18th August 2010, 16:43
Sameer is correct. I forgot about the other dimension.

Deknor
14th August 2015, 06:03
In fact this is being the array of string, you will have to put it like
header(1,1)
header(1,2)
header(1,3) ...
and so on.


I'm sorry if i'm asking....
What you are meant here, is it

header.1:
before.layout:
header(1,1) = sprintf$("%u(%02d-%02m-%4Y)",DAT(1))
header(1,2) = sprintf$("%u(%02d-%02m-%4Y)",DAT(2))
header(1,3) = sprintf$("%u(%02d-%02m-%4Y)",DAT(3))
..
........
.......


header(1,31) = sprintf$("%u(%02d-%02m-%4Y)",DAT(31))

is it true? I'm still confusing about string array..

Your kindness i'm really appreciated,


Thanks,

Deknor:)

bhushanchanda
14th August 2015, 09:23
Hi,

Here's a sample -

declaration:

domain tcmcs.str100 header(5)
domain tcdate dat(5)
domain tcdate date1,date2,date3,date4,date5

header.1:
before.layout:
utc.add(utc.num(),0,0,-1,0,0,0,date1)
utc.add(utc.num(),0,0,-1,0,0,0,date2)
utc.add(utc.num(),0,0,-1,0,0,0,date3)
utc.add(utc.num(),0,0,-1,0,0,0,date4)
utc.add(utc.num(),0,0,-1,0,0,0,date5)

dat(1) = date1
dat(2) = date2
dat(3) = date3
dat(4) = date4
dat(5) = date5

header(1,1) = sprintf$("%u(%02d-%02m-%4Y)",dat(1))
header(1,2) = sprintf$("%u(%02d-%02m-%4Y)",dat(2))
header(1,3) = sprintf$("%u(%02d-%02m-%4Y)",dat(3))
header(1,4) = sprintf$("%u(%02d-%02m-%4Y)",dat(4))
header(1,5) = sprintf$("%u(%02d-%02m-%4Y)",dat(5))

On the report layout, you have to define like this -

header(1,1)
header(1,2)
header(1,3)
....

dat(1)
dat(2)
dat(3)
...

Hope this helps.

Deknor
14th August 2015, 09:30
Hi,

Here's a sample -

declaration:

domain tcmcs.str100 header(5)
domain tcdate dat(5)
domain tcdate date1,date2,date3,date4,date5

header.1:
before.layout:
utc.add(utc.num(),0,0,-1,0,0,0,date1)
utc.add(utc.num(),0,0,-1,0,0,0,date2)
utc.add(utc.num(),0,0,-1,0,0,0,date3)
utc.add(utc.num(),0,0,-1,0,0,0,date4)
utc.add(utc.num(),0,0,-1,0,0,0,date5)

dat(1) = date1
dat(2) = date2
dat(3) = date3
dat(4) = date4
dat(5) = date5

header(1,1) = sprintf$("%u(%02d-%02m-%4Y)",dat(1))
header(1,2) = sprintf$("%u(%02d-%02m-%4Y)",dat(2))
header(1,3) = sprintf$("%u(%02d-%02m-%4Y)",dat(3))
header(1,4) = sprintf$("%u(%02d-%02m-%4Y)",dat(4))
header(1,5) = sprintf$("%u(%02d-%02m-%4Y)",dat(5))

On the report layout, you have to define like this -

header(1,1)
header(1,2)
header(1,3)
....

dat(1)
dat(2)
dat(3)
...

Hope this helps.

Hi,


Thank you Bhushan,

I'm really appreciated. I will try your suggesttion

Thank you,

Regards,
Deknor:)

Deknor
19th August 2015, 04:06
Hi guys,

Sorry if i'm disturbing..

I already write the code and run it, the report can be run. But there are header for date its follow the current date..

In requirements,:
1)the date its depend on items
2) the date stored the quantity which is plant issue or plant receipt

I'm really appreciated,:)

pillai.ganesh
19th August 2015, 07:37
Hi guys,

Sorry if i'm disturbing..

I already write the code and run it, the report can be run. But there are header for date its follow the current date..

In requirements,:
1)the date its depend on items
2) the date stored the quantity which is plant issue or plant receipt

I'm really appreciated,:)
Can you give some more information of how you are printing the Item?

If you are printing Item in the "detail" layout (as a Table Field send to the report as Input Field) and you want to print the date depending on that Item in the detail Layout beside the Item then- You need not create a array of dates for each occurrence of item on the report.
You can just have one date variable which you can print beside the item on the "detail" layout. Fill the date variable with the value that you want to put in it at the before.layout section of that detail layout.

And if you want to have multiple date columns one beside the other showing different types of date (Like issue date and receipt date) you can use more date variables or a array of date variables.

And if your requirement is hard that you want the Date to be printed only on the "header" layout .... Is it that you print only one Item on each report?
If that is the case still you can have the option of either having a array of dates or multiple date variables. And assign them with the value depending on your 1 item that will be printed on the report.

If you create a date array then you need not specify 2 dimensions on the output expression.

Deknor
19th August 2015, 10:05
Hi pillai,
Sorry if i'm make it confuse. I already attach the example of row data which are needed in LN reports.

I already create the new LN program/session to print the data. But I’m stuck when I want to print the data in 1 row.

I have some confusion when i want to create the 3 array
1) transaction date
2) Issue Quantity
3) Receipt Quantity

Each trx date, store receipt and issue quantities. But the transaction date must have in 1 months (30 or 31 days).

If the day don't have quantities, it also display in report but it will become "blank".

i have some logic to this program. but when i run, the data does not print.

After I make it some changes in my code, the data print out but it's does not what I want.. Here i attach the example of data print out. What we can see, in the attachment, the header of transaction date is follow the current date. The transaction date is supposed print from 1st of July until 31 of august. The items also print the quantity either planned issue or planned receipt according the transaction date.

This is the some information about my problem,


Your kindness i'm really appreciated,

pillai.ganesh
19th August 2015, 10:33
Hi pillai,
Sorry if i'm make it confuse. I already attach the example of row data which are needed in LN reports.

I already create the new LN program/session to print the data. But I’m stuck when I want to print the data in 1 row.

I have some confusion when i want to create the 3 array
1) transaction date
2) Issue Quantity
3) Receipt Quantity

Each trx date, store receipt and issue quantities. But the transaction date must have in 1 months (30 or 31 days).

If the day don't have quantities, it also display in report but it will become "blank".

i have some logic to this program. but when i run, the data does not print.

After I make it some changes in my code, the data print out but it's does not what I want.. Here i attach the example of data print out. What we can see, in the attachment, the header of transaction date is follow the current date. The transaction date is supposed print from 1st of July until 31 of august. The items also print the quantity either planned issue or planned receipt according the transaction date.

This is the some information about my problem,


Your kindness I'm really appreciated,

Solution 1:
An easy approach will be to print data on excel like this:-
=> Item|SOH(X)|Transaction Date|Planned Issue(Y)|Planned Receipt(Z)
Then do a Pivot Table on the excel. (You can create a macro, eliminating the Pivoting activity every time the report is printed)

Solution 2:
If the number of Transaction Dates for your Item is always Finite/Fixed then you will have to play with before.field & after.field Layout.
Which will allow you to do the grouping based on Item and print the Finite Transaction Date array in before.field Layout and the Totalling data on after.field Layout.
To have actual transaction Dates please assign proper Transaction Date values to the array field. If you assign current date then current date will be printed as transaction date.

Hope this helps. :)

Deknor
19th August 2015, 11:22
Solution 1:
An easy approach will be to print data on excel like this:-
=> Item|SOH(X)|Transaction Date|Planned Issue(Y)|Planned Receipt(Z)
Then do a Pivot Table on the excel. (You can create a macro, eliminating the Pivoting activity every time the report is printed)

Solution 2:
If the number of Transaction Dates for your Item is always Finite/Fixed then you will have to play with before.field & after.field Layout.
Which will allow you to do the grouping based on Item and print the Finite Transaction Date array in before.field Layout and the Totalling data on after.field Layout.
To have actual transaction Dates please assign proper Transaction Date values to the array field. If you assign current date then current date will be printed as transaction date.

Hope this helps. :)



Thank you pillai,

i'm very appreciated that.

I will try it

Deknor
20th August 2015, 03:20
Hi,

Here's a sample -

declaration:

domain tcmcs.str100 header(5)
domain tcdate dat(5)
domain tcdate date1,date2,date3,date4,date5

header.1:
before.layout:
utc.add(utc.num(),0,0,-1,0,0,0,date1)
utc.add(utc.num(),0,0,-1,0,0,0,date2)
utc.add(utc.num(),0,0,-1,0,0,0,date3)
utc.add(utc.num(),0,0,-1,0,0,0,date4)
utc.add(utc.num(),0,0,-1,0,0,0,date5)

dat(1) = date1
dat(2) = date2
dat(3) = date3
dat(4) = date4
dat(5) = date5

header(1,1) = sprintf$("%u(%02d-%02m-%4Y)",dat(1))
header(1,2) = sprintf$("%u(%02d-%02m-%4Y)",dat(2))
header(1,3) = sprintf$("%u(%02d-%02m-%4Y)",dat(3))
header(1,4) = sprintf$("%u(%02d-%02m-%4Y)",dat(4))
header(1,5) = sprintf$("%u(%02d-%02m-%4Y)",dat(5))

On the report layout, you have to define like this -

header(1,1)
header(1,2)
header(1,3)
....

dat(1)
dat(2)
dat(3)
...

Hope this helps.


Hi,


On the report layout, you have to define like this -

header(1,1)
header(1,2)
header(1,3)
....

dat(1)
dat(2)
dat(3)
...


On the report layout, it is on black screen or script?

This's because, i'm confused where i want to put dat(1), dat(2), dat(3) on black screen.

I'm very appreciated

bhushanchanda
20th August 2015, 11:09
Hi,

Report Layout - > Black/Grey Screen
Report Script -> The script