We are working on a custom form/workflow to print the Pick List (SO642000) and Packing Slip (SO644000) via a processing form to DeviceHub. The problem we are having is that for some reason, devicehub will print these out of order.
If I don’t print to devicehub it is combining the reports and will show them in a single window. Both are set to use PDF. When this goes to devicehub it prints each report as a separate job and then often they are no longer in order.
Is there a way to 1) get this combined report to print as a single job on devicehub or 2) have better control of what order devicehub is printing in? Obviously I’d love both to be true, but will settle for one.
The code looks like this:
// Define report parameters (keys must match report parameters in RPX)
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["ShipmentNbr"] = theShipment.ShipmentNbr;
PXTrace.WriteInformation("Printer ID: " + theShipmentExt.UsrSpeedyPrinterID);
PrintSettings printSettings = new PrintSettings()
{
PrinterID = Guid.Parse(theShipmentExt.UsrSpeedyPrinterID),
NumberOfCopies = 1,
PrintWithDeviceHub = false,
DefinePrinterManually = false
};
theToken = new CancellationToken();
PXTrace.WriteInformation("Report Number: " + theShipmentExt.UsrSpeedyReportNbr);
actualReportID = theShipmentExt.UsrSpeedyReportNbr;
ex = null;
// Work Order (AKA Pick List).
PXTrace.WriteInformation("Add WO");
ex = PXReportRequiredException.CombineReport(ex, actualReportID, parameters);
// Packing List.
PXTrace.WriteInformation("Add Packlist");
ex = PXReportRequiredException.CombineReport(ex, "SO642000", parameters);
PXTrace.WriteInformation("Send to printer");
SMPrintJobMaint.CreatePrintJobGroup(printSettings, ex, "Print: " + theShipment.ShipmentNbr, theToken);
