Tuesday, April 28, 2020

BI Publisher With Oracle Apex

Here are the Steps to create Report with BI publisher on Apex

Need to generate xml data of your query 

So to generate the XML data of the query there are various methods and here is the simple method to generate XML data of your query

STEP 1: Go to Shared components → Report Queries


STEP 2: In the Report, Queries add a name and desired output format, I have selected as PDF as my report will be downloaded as PDF file 


STEP 3: Type in your query and click Next 
Note(in a single query you must have all data that you are going to display in the report)

STEP 4: Select data source for the report as XML and click Download this will download the xml file of the query output 

STEP 5: Select Create report query in this wizard and select create in the final wizard



Our XML file has been generated and now we need to Create an RTF layout for report

We need to have BI Publisher Add-ins in our MS WORD to generate RTF FILE

STEP 6: Open MS WORD Select the BI Publisher Tab and in Load Data select Sample XML
and select the downloaded employee details XML here 



STEP 7: After loading it successfully, select all fields as marked below to get the entire data in a table format which will loop the data automatically.


STEP 8: Now you can customize your report as you wish, add or remove columns from the table

I have  shown a sample layout of the invoice table in the below image(don't confuse it with the employee table xml data )

   

STEP 9: Select RTF in the Preview tab 

STEP 10: Which will be saved as a separate rtf file and your data will be shown in that file 


STEP 11: Go to Shared components → Report Layout
STEP 12: Select Create and select Report layout type as RTF and  click next 

STEP 13: Name the layout and choose the RTF File generated from MS word here and select create layout 


STEP 14:Go to Shared components → Report Queries, select the report query we have already created  and select the report layout as invoice layout that we have created in report layout 

 You can use the session values in the page where you are going to download the PDF be checking the session state checkbox and we need to list the page items below it 

STEP 15: Copy the URL ie in the print URL item,
Create a button in a page and in the button behaviour make it as a redirect to URL and in the Target paste the copied URL. That's all now user can download the pdf report 



so when the user clicks the button they can able to download the PDF report with the data 

Wednesday, January 22, 2020

How to Change the Label of an item dynamically

If you want to change the label of any item dynamically based on conditions

Add a dynamic action based on your conditions, Here I added a dynamic action  on  the page load
with client-side condition  item is not null (P7_CUSTOMER_ID) so this DA is executed only for the existing record


Now I am going to change the label of the page item P7_CUST_FIRST_NAME from First Name to First Name(Edit)

In the set value of the DA, select the static assignment and give the new label name you want to display and select the affected element as P7_CUST_FIRST_NAME_LABEL.


  Any Item name followed by _LABEL will be used to change the label of an item.

Result:

Lable is the default here as the First Name

The label has been changed from the First Name to First Name(Edit)



Tuesday, January 21, 2020

Apply Dynamic styles using dynamic action on oracle Apex

Hai Here is my first post!

Have you ever wondered how to dynamically apply CSS styles on Apex if yes you are on the right page.

Here I am going to explain to you how to make a page item as read-only and remove item borders to the Phone number page item.

So here I have added a style which will make the phone number as read-only and I will remove the border of the page item phone number only if it is an existing record if it is a new record user can type the phone number

I have added a Dynamic action on page load with a client-side condition on it and made it perform JS





In the JS I have added the following code to make the item readonly and remove the borders of the page item "P7_PHONE_NUMBER1" any page item will have its own name as ID so you can use that in the getElementById property




JS CODE:
document.getElementById("P7_PHONE_NUMBER1").readOnly = true; document.getElementById("P7_PHONE_NUMBER1").style.borderStyle = "none"; Result:
When creating a new customer Phone number field is editable



While editing an existing customer phone number field is read-only