Display Product Rating Icons Dynamically in APEX Report

Display Product Rating Icons Dynamically in Oracle APEX Report

Display Product Rating Icons Dynamically in Oracle APEX Report

 

1. CREATE TABLE - PRODUCT_RATING.....
 
CREATE TABLE  "PRODUCT_RATING" 
   (	"OID" NUMBER, 
	"PRODUCT_ID" NUMBER, 
	"PRODUCT_CODE" VARCHAR2(250), 
	"PRODUCT_NAME" VARCHAR2(250), 
	"START_DATE" DATE, 
	"PRODUCT_RATING" VARCHAR2(50)
   )
/
2. Create a function GET_PRODUCT_RATING. 
CREATE OR REPLACE FUNCTION GET_PRODUCT_RATING (p_value IN NUMBER)
    RETURN VARCHAR2
IS
    l_return       VARCHAR2 (4000);
    l_checked      VARCHAR2 (240)
        := '';
    l_un_checked   VARCHAR2 (240)
        := '';
    l_max_value    NUMBER := 5;
    l_remaining    NUMBER;
BEGIN
    IF p_value BETWEEN 1 AND 5
    THEN                                -- Check given values are in the range
        l_remaining := l_max_value - p_value;

        /* Add checked user ratings */
        FOR i IN 1 .. p_value
        LOOP
            l_return := l_return || ' ' || l_checked;
        END LOOP;

        /* Add unchecked user rating if remaining is greater than Zero */
        IF l_remaining > 0
        THEN
            FOR j IN 1 .. l_remaining
            LOOP
                l_return := l_return || ' ' || l_un_checked;
            END LOOP;
        END IF;
    ELSE
        l_return := NULL;
    END IF;

    RETURN l_return;
END GET_PRODUCT_RATING;
3. Create a new interactive report........................ 
SELECT PRODUCT_ID,
       PRODUCT_NAME,
       TO_CHAR (start_date, 'DD-Mon-RRRR')     START_DATE,
       GET_PRODUCT_RATING (PRODUCT_RATING)     PRODUCT_RATING
  FROM PRODUCT_RATING
4. Go to report attribute, PRODUCT_RATING and set Escape special characters = No
 

🔗 Demo Application-
            URL- Demo Application
            Username - demo, Pass- demo
 

I hope everyone will like it. Please watch the full video,
Comment on any of your problems, I will try my best to solve the problem, In-Shah Allah. Everyone's cooperation is desirable. Visit my blog site, new technology related videos, you will get different types of tutorials of Oracle Apex, and hopefully, you can use them in your daily work.
Please stay tuned by subscribing to the YouTube channel, and encourages new videos to be uploaded.
=================
Visit my site to get more collaborative posts about Oracle Apex and subscribe to my YouTube channel. Thanks.
Comment on any of your issues, I will try my best to solve the problem, In-Shah Allah. Everyone's cooperation is desirable.
Visit my blog site, new technology-related videos, you will get different types of tutorials of Oracle Apex, and hopefully, you can use them in your daily work.
==============================

🙍🏾‍ Md jABER HOSSEN
📲 Mobile- +8801760688286
📨 Email- jaberit786@gmail.com
🌐 FB- facebook.com/mdjaber.hossen1
Please Subscribe to My Channel

Many thanks for visiting the site.

Then Enjoy.........................

2 Comments

Hlo Sir

Previous Post Next Post