Hi,
Below is an issue raised by a customer,
“Document Revision is NOT created and attached to ProjectInvoice object when using the “.rep” layout in Report Rule.”
They need documents (pdf) that will be produced from an operational report and attached to ProjectInvoice object and would like to use Report Rule to set this up.
A Report Rule was created for the original PROJECT_INVOICE_REP with some hardcoded values for testing.
When testing the print job functionality for the report_id_ := ‘PROJECT_INVOICE_REP’ and layout_name_ := 'ProjectInvoiceRep.rdl', the result pdf is visible in Report Archive, the document is created and attached to the ProjectInvoice object, so the Report Rule works fine.

However, Document Revision is NOT created and attached to ProjectInvoice object when using the “.rep” layout in Report Rule.
The result pdf appears in the Report Archive and it looks as expected, but no document has been created by the Report Rule.
Why is .rdl ok to create Document Revision and .rep is not? The Report Rule is the same, the only change is the layout name.
Report Definition:

With LayoutFile=ProjectInvoiceRep.rdl; the document revision is created and attached to COMPANY=10^INVOICE_ID=23^ ProjectInvoice, it works fine.

With LayoutFile=TestProjIInv.rep; the document is NOT created, but the report can be found in Report Archive and the pdf can be downloaded.

According to Report Rule Log, everything has went well, both times.



Test script used:
DECLARE
-- layout_name_ VARCHAR(2000):='ProjectInvoiceRep.rdl';
layout_name_ VARCHAR(2000):='TestProjIInv.rep';
invoice_no_ project_invoice.invoice_no%TYPE := '83';
report_id_ VARCHAR2(2000) := 'PROJECT_INVOICE_REP';
report_attr_ VARCHAR2(2000) := '';
parameter_attr_ VARCHAR2(2000) := '';
distribution_list_ VARCHAR2(2000) := '';
instance_attr_ VARCHAR2(2000) := '';
print_job_id_ VARCHAR2(2000) := '';
printer_attr_ VARCHAR2(2000) := '';
printer_id_ VARCHAR2(2000) := 'No Printout,SERVER,NO_PRINTOUT';
result_key_ VARCHAR2(2000) := '';
attr_ VARCHAR2(2000) := '';
BEGIN
--get attributes needed from (create new schedule report)
client_SYS.clear_attr(report_attr_);
client_SYS.add_to_attr('REPORT_ID', report_id_, report_attr_);
client_sys.add_to_attr('LAYOUT_NAME', layout_name_, report_attr_);
--client_sys.add_to_attr('LANG_CODE', 'en', report_attr_);
--client_sys.add_to_attr('ORDER_LANGUAGE', 'en', report_attr_);
client_SYS.clear_attr(parameter_attr_);
client_SYS.add_to_attr('COMPANY', 'FINPP01', parameter_attr_);
client_SYS.add_to_attr('INVOICE_NO', invoice_no_, parameter_attr_);
client_SYS.add_to_attr('SERIES_ID', 'PR', parameter_attr_);
client_SYS.clear_attr(attr_);
client_SYS.add_to_attr('PRINTER_ID', printer_id_, attr_);
archive_API.new_client_report(result_key_, report_attr_, parameter_attr_, distribution_list_, printer_attr_);
archive_API.get_info(instance_attr_, parameter_attr_, result_key_);
print_job_API.new(print_job_id_, attr_);
client_SYS.add_to_attr('PRINT_JOB_ID', print_job_id_, instance_attr_);
client_SYS.add_to_attr('RESULT_KEY', result_key_, instance_attr_);
print_job_contents_API.new_instance(instance_attr_);
print_job_API.print(print_job_id_);
dbms_output.put_line(result_key_);
dbms_output.put_line(print_job_id_);
END;
Appreciate if anyone could share their experiences regarding using Report Studio Layouts in Report Rules.
Also is there an documentation available to set Document Format when the action is “Check In To Document Management” in Report Rule?
Thanks in advance!