On Fri, Jun 15, 2012 at 10:41 AM, Paul McNett <[email protected]> wrote:
> On 6/15/12 6:36 AM, Nate Lowrie wrote:
>> Log:
>> Broke the save functionality out of the write method into it's own save
>> method. It has become very useful for putting multiple reports onto the
>> same PDF file.
>
> Cool!
>
> I need to figure out how to collate pages from different reports into one
> pdf. Example:
>
> 3 reports:
> + cutsheet
> + color match sheet
> + frame cutsheet
>
> These all go out to the shop (printed now, but in the future could be just
> the PDF to
> get viewed on screen). They get printed for dozens of orders at a time. So
> currently
> they stack up on the printer uncollated:
>
> 1) all cutsheets for all orders
> 2) all color matches for all orders
> 3) all frame cutsheets for all orders
>
> and the user needs to manually collate these and put them together by order
> number.
>
> I'd love some way of post-collating these so that I end up with a single PDF
> per
> order with output from the 3 reports.
Here is how I am currently doing it:
if self._hasPackingSlips():
reportWriter = ReportWriter()
fname = reportWriter.OutputFile = reportUtils.getTempFile(ext="pdf")
reportWriter.ReportFormFile = "PackingSlips.rfxml"
oli_biz = self.ordersBizobj.orderLineItemsBizobj
for orderLineItem in oli_biz.bizIterator():
if oli_biz.getFieldVal("item_product_type") ==
"Product Kit" and oli_biz.getFieldVal("item_print_packing_slip"):
for i in range(oli_biz.getFieldVal("quantity")):
self.packingSlipReportBizobj.setItemID(oli_biz.getFieldVal("item_id"))
reportWriter.Cursor =
self.packingSlipReportBizobj.getDataSet()
reportWriter.write(save=False)
for dataSet in
self.packingSlipReportBizobj.getSubAssemblyPackingSlipDataSets():
reportWriter.Cursor = dataSet
reportWriter.write(save=False)
reportWriter.save()
reportUtils.previewPDF(fname)
Note that I am changing the report's cursor object and then writing
without saving. I would think you should be able to change the
ReportFormFile as well and just go down the list and then call save at
the end. The reportWriter's write method just heaps printed bands on
the pile and shouldn't erase anything.
Regards,
Nate
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/cagchxzbof0u7g710tpfz4hnrhgpydrauo2ek6tkffrjjbt0...@mail.gmail.com