Hi,
Report I try to make need to go through records in cursor and populate Cells in Excel.If two records are the same (have the same order and odline fields)then the second record should be skipped and only QTY field should be added to QTY field of previous one.So I have code like this that populate excel cells(c_reportis name of the cursor):
SELECT c_report
For i=1 to _TALLY
.Cells(i,1)=c_report.ohcust
.Cells(i,2)=c_report.order
.Cells(i,3)=c_report.odline
.Cells(i,4)=c_report.odpart
.Cells(i,5)=c_report.ipclas
.Cells(i,6)=c_report.ippgrp
.Cells(i,7)=c_report.ordate
.Cells(i,8)=c_report.QTY
goto i
EndFor
I had something like this:
if .Cells(i,2)=.Cells(i-1,2) and .Cells(i,3)=.Cells(i-1,3) Then
.Cells(i,8)=.Cells(i,8)+.Cells(i-1,8)
.Row(i).Delete
Endif
where .Cells(i,2)is order field
.Cells(i,3)is odline field
and .Cells(i,8)is QTY field but it doesn't work.It just populate cells from cursor c_report.I think that I should compare those fields before they are displayed in cells but I don't know how.
I really need help on this so any idea appreciated,
Lyn
Report I try to make need to go through records in cursor and populate Cells in Excel.If two records are the same (have the same order and odline fields)then the second record should be skipped and only QTY field should be added to QTY field of previous one.So I have code like this that populate excel cells(c_reportis name of the cursor):
SELECT c_report
For i=1 to _TALLY
.Cells(i,1)=c_report.ohcust
.Cells(i,2)=c_report.order
.Cells(i,3)=c_report.odline
.Cells(i,4)=c_report.odpart
.Cells(i,5)=c_report.ipclas
.Cells(i,6)=c_report.ippgrp
.Cells(i,7)=c_report.ordate
.Cells(i,8)=c_report.QTY
goto i
EndFor
I had something like this:
if .Cells(i,2)=.Cells(i-1,2) and .Cells(i,3)=.Cells(i-1,3) Then
.Cells(i,8)=.Cells(i,8)+.Cells(i-1,8)
.Row(i).Delete
Endif
where .Cells(i,2)is order field
.Cells(i,3)is odline field
and .Cells(i,8)is QTY field but it doesn't work.It just populate cells from cursor c_report.I think that I should compare those fields before they are displayed in cells but I don't know how.
I really need help on this so any idea appreciated,
Lyn