I'm designing an invoice export feature that generates a PDF file for each selected invoice. The invoice form has a nested report to show the subtotal, sales tax, shipping charges, and invoice total along with a few other things. Although we are not quite ready to transition to web apis, I designed this to work the same way. I have an API that retrieves data for the invoices using a datastore, and returns the data in JSON format. I thought importing the JSON would cover everything, but I found out the JSON does not contain the data for the nested report.
I can reference the nested report as a DWObject, get the dataobject of the nested report, retrieve the data, and manually update the nested report.
Is there an easier way to do this? I tried GetChild, but I could not that to work even after setting the processing to 5 (Composite). I would think that exporting a datastore to a JSON should contain the data for the nested report. Importing the JSON should update the nested report. If I can do it manually, ImportJson should be able to do it.
Thanks
Joe
Maybe you can answer this question. I was able to populate the nested report once. I made some changes. Now when I try to update a column in the nested report, I receive the error, "Error accessing external object property object." Here is the line of code:
dc_invoiceForm.Object.dw_2 [al_row].Object.invd_class_type [ll_row]
The nested datawindow is in a group trailer. In this case, I'm trying to print a single invoice with 8 lines. There is only 1 page. al_row = 8. ll_row = 1. If I change al_row to 1, I do not get the error. However, I do not get any data in the nested report. Thoughts on what I can look for?
I wonder if writing the received JSON data - after parsing it out - to a few temporary DB tables and then issuing a DS.Retrieve (<args>) would be the better (easier) way to populate the DWOs?