Hello everyone,
I've modified the cheque printing so it will spawn an extra report after printing the cheques. This new report uses the same tmpChequePrintout as its basis. I have actually copied the ChequeController/ChequeDP to perform the similar report initiliazing. The new report is always launched right after printing the cheques.
What's happening is the following:
1) output to screen works fine; new report is shown and layout is correct
2) printing to either a PDF printer or the physical printer only works right after restarting the AOS; it will never work afterwards
2.1) but the layout is a mess and single page is spreaded across 12 pages!
3) trying to run the report afterwards will produce nothing when sending to the PDF printer (no error when tracing code) and will report the infamous "Settings to access printer 'PRTRXADM01 on impression (redirected)' are not valid."
If I can throw some technical details to enhance my chance of getting help, the programming I have done is as follow:
In the BankChequePrint class, method printDocument, after the cheques are printed, I call the new report:
case ChequeFormType::CAStyle :
this.runReport(menuitemoutputstr(Cheque_CA));
//new report not working
this.runReport(menuitemOutputStr(NewReportName));
// launching the ledgerJournal does however work
this.runReport(menuitemOutputStr(LedgerJournal));
BankChequePrint holds the temporary cheque table, tmpChequePrintout. Since this table contains what I need, I have duplicated the ChequeController class for the new report
class NewReportController extends SrsReportController
in the init method, I grab the bankChequePrint object:
bankChequePrint = caller;
The base framework will call the preRunModifyContract which will marshall the tmpChequePrintout to send it to the NewReportDP object.
protectedvoid preRunModifyContract()
{
SrsTmpTblMarshallerContract contract = this.parmReportContract().parmRdpContract() as SrsTmpTblMarshallerContract;
// get the Temp table, and marshall it across to SSRS
new SRSReportRunPermission().assert();
contract.parmTmpTableDataRecId(SRSTmpTblMarshaller::SendTmpTblToDataProvider(tmpChequePrintout));
// set the print destination in contract
if(printDestinationSetting)
{
this.parmReportContract().parmPrintSettings(printDestinationSetting);
}
}
The data provider class is extending from SrsReportDataProviderPreProcessTempDB and it has the following predefined contract:
[SRSReportParameterAttribute(classStr(SrsTmpTblMarshallerContract))]
Debugging the execution show no problem in passing the tmpChequePrintout table from the controller to the data provider. In the SRSProxy class, in the renderReportToPrinter, this line is where everything fails when sending to the network printer (and does nothing when printing to the PDF printer, success returns true!):
success = proxyObject.PrintReportWithPageSettings(reportPath,parameterValueArray,printerName,overridePrintContractSettings,deviceInfo,numberOfCopies,overridePaperSettings,pageSettings);
Thanks in advance for any suggestions,
Eric