Dynamically Company Name Change When Report Print

 


STEP-1
=====

CREATE TABLE STRUCTURE.


 CREATE TABLE     OTHERS_COMPANY    

   (     ID     NUMBER, 

    COMPANY_NAME     VARCHAR2(50), 

    ADDRESS     VARCHAR2(255), 

    LOGO     BLOB, 

    MIMETYPE     VARCHAR2(255), 

    FILENAME     VARCHAR2(400), 

    IMAGE_LAST_UPDATE     TIMESTAMP (4) WITH LOCAL TIME ZONE, 

    IMAGE_CHARACTER_SET     VARCHAR2(100), 

CONSTRAINT     PK_OTHERS_COMPANY_ID     PRIMARY KEY (    ID    )

  USING INDEX  ENABLE

   ) ;


-------------------


 CREATE TABLE     DEBIT_MST     

   (     ID     NUMBER, 

    INVOICE_NO     VARCHAR2(25), 

    DEBIT_DATE     DATE, 

    PRICE     NUMBER, 

    VAT_RATE     NUMBER, 

    SUBTOTAL     NUMBER, 

    DISCOUNT_AMOUNT     NUMBER, 

    DEFAULT_COMPANY_ID     NUMBER, ---- when New Data insert then always DEFAULT_COMPANY_ID inserted from DEFAULT_COMPANY Table

    OTHERS_COMPANY_ID     NUMBER, 

    NOTE     VARCHAR2(500)

   ) ;



STEP-2
=====

Create new Region and Radio group Item.

Item Name: P41_OTHERS_COMPANY_SETUP

LOV: SQL Query 


select 'Default My Company' d, null r from Dual

union all

SELECT COMPANY_NAME d, ID r FROM OTHERS_COMPANY;


STEP-3
=====

Create Dynamic Action this Item (P41_OTHERS_COMPANY_SETUP)

Action Name : Others Company Setup

Event : Change

Selection Type : Item

Item(s): P41_OTHERS_COMPANY_SETUP


Action : Execute Server-side Code 

PL/SQL Code : 

update DEBIT_MST set  

OTHERS_COMPANY_ID=:P41_OTHERS_COMPANY_SETUP

where id=:P41_DEBIT_ID;


Items to Submit : P41_OTHERS_COMPANY_SETUP



STEP-4
=====


Create Query for Jasper Report.

.

.

.

.

.

.

STEP-5
=====

Hide & Show company.

Post a Comment

Previous Post Next Post