Skip to main content
Solved

Create Pdf with code. Report values are not the same in that both right-click and manually invoked to the report?

  • 17 June 2020
  • 1 reply
  • 441 views

ugursinans
Sidekick
Forum|alt.badge.img+3

below report is coming when i am in IFS right-click and execute report;

but when I create a pdf with plsql code below this values are coming different

 

PROCEDURE az_emailing_print_report(value_       IN varchar2,
												 lu_          IN varchar2,
												 layout_name_ IN varchar2,
												 report_id_   IN varchar2,
												 attr_in_     IN varchar2,
												 result_key_  OUT NUMBER) is

	 report_attr_       varchar2(2000) := '';
	 parameter_attr_    varchar2(2000) := '';
	 distribution_list_ varchar2(2000) := '';
	 instance_attr_     varchar2(2000) := '';
	 print_job_id_      varchar2(2000) := '';
	 print_attr_        varchar2(2000) := '';
	 attr_              varchar2(3000) := '';
    package_           varchar2(50) := '';
    view_              varchar2(50) := '';
    key_               varchar2(10) := '';
    printer_id_        varchar2(50) := 'PDF_PRINTER';

    CURSOR lu_params_ is
      SELECT dsvc.column_name, dsw.view_name, dsl.base_package
        FROM DICTIONARY_SYS_LU          DSL,
             DICTIONARY_SYS_VIEW        DSW,
             DICTIONARY_SYS_VIEW_COLUMN DSVC
       WHERE DSL.LU_NAME = DSW.lu_name
         AND DSW.lu_name = DSVC.lu_name
         AND DSW.view_name = DSVC.view_name
         AND DSVC.type_flag = 'K'
         AND DSw.type_of_view = 'Base'
         AND DSL.lu_name = lu_;
  BEGIN
    OPEN lu_params_;
    FETCH lu_params_
      INTO key_, view_, package_;
    CLOSE lu_params_;

    Client_Sys.Clear_Attr(report_attr_);
    Client_Sys.Clear_Attr(parameter_attr_);
    Client_Sys.Clear_Attr(attr_);
    Client_Sys.Clear_Attr(print_attr_);
    Client_Sys.Clear_Attr(instance_attr_);

    Client_Sys.Set_Item_Value('REPORT_ID', report_id_, report_attr_);
    Client_Sys.Set_Item_Value('LAYOUT_NAME', layout_name_, report_attr_);

    Client_Sys.Set_Item_Value(key_, value_, parameter_attr_);

    archive_api.New_Client_Report(result_key_,
                                  report_attr_,
                                  parameter_attr_,
                                  distribution_list_,
                                  print_attr_);

    Client_Sys.Set_Item_Value('PRINTER_ID', printer_id_, attr_);
    print_job_api.New(print_job_id_, attr_);

    client_sys.Set_Item_Value('PRINT_JOB_ID',
                              print_job_id_,
                              instance_attr_);
    client_sys.Set_Item_Value('RESULT_KEY', result_key_, instance_attr_);

    print_job_contents_api.New_Instance(instance_attr_);

    print_Job_API.Print(print_job_id_);

       dbms_scheduler.set_attribute(name      => 'IFSAPP.send_mail',
                                 attribute => 'REPEAT_INTERVAL',
                                 value     => 'freq=minutely; interval=2; bysecond=-7;');

    dbms_scheduler.set_job_argument_value(job_name          => 'IFSAPP.send_mail',
                                          argument_position => 1,
                                          argument_value    => value_);

    dbms_scheduler.set_job_argument_value(job_name          => 'IFSAPP.send_mail',
                                          argument_position => 2,
                                          argument_value    => result_key_);

    DBMS_SCHEDULER.enable('IFSAPP.send_mail');  

    commit;  
  END;

And the output with this code is;

 

I could not solve this. 

Best answer by paul harland

Hello

I would recommend that you look into the _REP view and compare the data generated via the 2 methods - there will be multiple rows of data per report key (job) - you probably know this.

If you can see specific differences in the rows of data in the _REP view, it should be a little easier to work out what is causing it.  Just looking at the PDF output adds more layers of potentially misleading information.

View original

paul harland
Superhero (Employee)
Forum|alt.badge.img+24

Hello

I would recommend that you look into the _REP view and compare the data generated via the 2 methods - there will be multiple rows of data per report key (job) - you probably know this.

If you can see specific differences in the rows of data in the _REP view, it should be a little easier to work out what is causing it.  Just looking at the PDF output adds more layers of potentially misleading information.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings