ks_ks_
24th June 2009, 08:46
Hi,
The report output is lets say have 5 pages, on the second page, the first record is not printing, same with the 3rd,4th and 5th pages the first record is not printing.
The script looks okay as for rest all records it fetched the data correctly.
ANy hints?
george7a
24th June 2009, 09:00
Hi,
Did you check the field in the layout? may be there are some conditions there.
Can you post the code?
- George
ks_ks_
24th June 2009, 09:04
Hi George,
Thanks for the reply. There is no print condition. I debugged the code also but no luck.
george7a
24th June 2009, 09:06
What do yo mean by no luck? Do you see that the code is printing the missing lines?
Can you post the code?
ks_ks_
24th June 2009, 09:15
No luck means I am unable to find out why is it not printing the first record on the next page. I can not post the code coz it belongs to a customer.
Output expression of each field is 1, but because we r doing calculations in each layout, and printing only after.field1 it is lattr.print = false on all layouts but after.field1.
Does this make sense?
ks_ks_
24th June 2009, 09:18
I just did an experiment.. I checked the field new field for the layout which is printing so each value should come on new page. It is not printing the same field for any record.
mark_h
24th June 2009, 13:30
With this limited information it is almost impossible for us to diagnose the problem. My recommendation is to put the script in debug mode. Step through it for every record watching what gets executed. Then when you get to the record or records where it is running the calculations make sure it moves through them correctly and executes the after field layout. Also make sure that none of the header layouts in the scrit interfer with printing the after.field layouts.
ks_ks_
25th June 2009, 09:20
in my debugging I found that after it calculates the value of variable which is not printing, it goes to a before.layout of another field where the variable is getting initialized.
I am curious to know in the report script, how would we come to know at which point does the printing triggers.
Because after it comes out of the calucations in after.layout,it retains the value.
mark_h
25th June 2009, 14:45
It makes it hard to help without the script. Here is a sample of what I expect to be happening in your report. You will have to make sure you have it sorted correctly and the code in each of the appropriate layouts.
|Sample sorted by tirou001.cwoc
declaration:
extern domain tcamnt cumm.totl
extern domain tcamnt reqd.avg.totl
extern domain tcamnt reqd.avg
before.program:
cumm.totl = 0
reqd.avg.totl = 0
detail.1:
before.layout:
lattr.print = false
cumm.totl = cumm.totl + etot.hrs
reqd.avg.totl = reqd.avg.totl + etot.hrs
| After sub work center.
after.tirou001.cwoc.1:
before.layout:
| variables printed in layout
after.layout:
cumm.totl = 0
reqd.avg.totl = 0
ks_ks_
25th June 2009, 19:06
Now this is how my code looks like:
|Sample sorted by tirou001.cwoc
declaration:
extern domain tcamnt cumm.totl
extern domain tcamnt reqd.avg.totl
extern domain tcamnt reqd.avg
before.program:
cumm.totl = 0
reqd.avg.totl = 0
before.field1:
before.layout:
info = ""
lattr.print = false
detail.1:
before.layout:
cumm.totl = cumm.totl + etot.hrs
reqd.avg.totl = reqd.avg.totl + etot.hrs
lattr.print = false
| After sub work center.
after.tirou001.cwoc.1:
before.layout:
| variables printed in layout
info = "xyz" |some calculation
after.layout:
cumm.totl = 0
reqd.avg.totl = 0
lattr.print= false
Everytime the first line of the next page is blank.
interesting thing is that when I put a counter in the after.tirou001.cwoc.1 and printed it in the layout, it is printing.
So I am sure there is something wrong going on with variable info. But can not figure out where.
loveneesh
26th June 2009, 07:45
Hi
As per my understanding, it seems problem is with Paper Width maintained in session maintain font of paper type (ttaad3111m000). Check your paper width maintained against paper type. It should be synchronized with no of lines print by your printer.
In your case reduce your paper width with 1 in session ttaad3111m000.
ks_ks_
26th June 2009, 08:28
Hi Lovneesh,
Even if I give the device as D, it doent print the first line. But still I am going to try what you suggested. I will post my results soon.
ks_ks_
26th June 2009, 08:33
Lovneesh,
Just checked that and found out that it is going to affect all the reports, but remaining all the reports are printing fine.
loveneesh
26th June 2009, 08:49
before.field1:
before.layout:
info = ""
What is field1 ?.
I would like to suggest , not to init value in before. layout always init after printing layout.
What is you first line ?, means detail.1 or before.field1.