Hi,
I am trying to print a report using AFS in LN 10.5.
This is what works for me for when the user wants to print all the data, which is likely never going to happen.
This is the code when I tried to put some values into the report before printing it. (The only field I put to is Sales Order for both from and to).
I tried setting only the Sales Order fields in from and to, and I also tried setting all of the fields like the code above. Both cases do not work.
There is no error whatsoever in the whole process but the report just does not show up/ save to file. I tried device "D" and "PDF" both have the same effect.
I just want to print using specific values in general because I will use in other reports too, not only Sales Order.
Regards,
Thana
I am trying to print a report using AFS in LN 10.5.
This is what works for me for when the user wants to print all the data, which is likely never going to happen.
Code:
stpapi.set.report("tdsls4409m000", "rtdsls440901300", "PDF", error.msg)
message("Set Report: " & error.msg)
if isspace(error.msg) then
stpapi.form.command("tdsls4409m000", 5, "print.data", error.msg)
message("Print Report: " & error.msg)
endif
stpapi.end.session("tdsls4409m000", error.msg)
Code:
stpapi.put.field("tdsls4409m000", "ddta.f", "")
stpapi.put.field("tdsls4409m000", "ddta.f.time", "")
stpapi.put.field("tdsls4409m000", "ddta.t", "03/20/2018")
stpapi.put.field("tdsls4409m000", "ddta.t.time", "")
stpapi.put.field("tdsls4409m000", "cofc.f", "")
stpapi.put.field("tdsls4409m000", "cofc.t", "ZZZZZZ")
stpapi.put.field("tdsls4409m000", "ofbp.f", "")
stpapi.put.field("tdsls4409m000", "ofbp.t", "ZZZZZZZZZ")
stpapi.put.field("tdsls4409m000", "orno.f", "CSO001911")
stpapi.put.field("tdsls4409m000", "orno.t", "CSO001911")
stpapi.put.field("tdsls4409m000", "pono.f", "")
stpapi.put.field("tdsls4409m000", "pono.t", "9999")
stpapi.put.field("tdsls4409m000", "crep.f", "")
stpapi.put.field("tdsls4409m000", "crep.t", "ZZZZZZZZZ")
stpapi.put.field("tdsls4409m000", "ccur.f", "")
stpapi.put.field("tdsls4409m000", "ccur.t", "ZZZ")
stpapi.put.field("tdsls4409m000", "cofc.f", "")
stpapi.put.field("tdsls4409m000", "cofc.t", "ZZZZZZ")
stpapi.put.field("tdsls4409m000", "dltp.f", str$(etol(tdsls.dltp.not.applicable)))
stpapi.put.field("tdsls4409m000", "dltp.t", str$(etol(tdsls.dltp.production)))
stpapi.put.field("tdsls4409m000", "cprj.f", "")
stpapi.put.field("tdsls4409m000", "cprj.t", "ZZZZZZZZZ")
stpapi.put.field("tdsls4409m000", "cmnf.f", "")
stpapi.put.field("tdsls4409m000", "cmnf.t", "ZZZZZZ")
stpapi.put.field("tdsls4409m000", "cpln.f", "")
stpapi.put.field("tdsls4409m000", "cpln.t", "ZZZZZZ")
stpapi.put.field("tdsls4409m000", "cpcl.f", "")
stpapi.put.field("tdsls4409m000", "cpcl.t", "ZZZZZZ")
stpapi.put.field("tdsls4409m000", "creg.f", "")
stpapi.put.field("tdsls4409m000", "creg.t", "ZZZ")
stpapi.put.field("tdsls4409m000", "item.f.segment.1", "")
stpapi.put.field("tdsls4409m000", "item.f.segment.2", "")
stpapi.put.field("tdsls4409m000", "item.t.segment.1", "ZZZZZZZZZ")
stpapi.put.field("tdsls4409m000", "item.t.segment.2", "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ")
stpapi.set.report("tdsls4409m000", "rtdsls440901300", "PDF", error.msg)
message("Set Report: " & error.msg)
if isspace(error.msg) then
stpapi.form.command("tdsls4409m000", 5, "print.data", error.msg)
message("Print Report: " & error.msg)
endif
stpapi.end.session("tdsls4409m000", error.msg)
There is no error whatsoever in the whole process but the report just does not show up/ save to file. I tried device "D" and "PDF" both have the same effect.
I just want to print using specific values in general because I will use in other reports too, not only Sales Order.
Regards,
Thana