Home » Developer & Programmer » Forms » Dynamically Add Text Item on Canvas
Dynamically Add Text Item on Canvas [message #623151] Fri, 05 September 2014 04:09 Go to next message
Mayur Shinde
Messages: 60
Registered: August 2014
Location: Pune, Maharashtra
Member
Hi,
On "WHEN-BUTTON-PRESSED" event how to add text item dynamically.
I have to display customer code on canvas whose count is more than 100.
I wrote a procedure for that as given below:

PROCEDURE PROC_DISPLAY_MISSING_CUST_CODE IS
CNT NUMBER(6) :=0;
COMPAIR NUMBER(6) :=0;

BEGIN
  	SELECT COUNT(MISSING_CUST_CODE) INTO CNT
	FROM 
	   ( SELECT TO_CHAR((:CUST_MST.TXT_CUST_SERIES||'000') + LEVEL) MISSING_CUST_CODE 
  	     FROM DUAL
             CONNECT BY LEVEL <=999
           ) WHERE MISSING_CUST_CODE NOT IN 
  					(
  					SLECT CUST_CD
  					FROM CUST_MST
  					WHERE CUST_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  					UNION
  					SELECT SL_CD
  					FROM FAS.GL_MST 
  					WHERE GL_CD IN ('J100') AND SL_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  					UNION
  					SELECT SL_CD
  					FROM FINACC.SUBMST_T 
  					WHERE GL_CD IN ('1300','13100') AND SL_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  					)
    ORDER BY MISSING_CUST_CODE;
  
  WHILE COMPAIR < CNT LOOP
  		SELECT MISSING_CUST_CODE INTO :CUST_MST.TXT_CUST_SERIES
			FROM 
			 ( SELECT TO_CHAR((:CUST_MST.TXT_CUST_SERIES||'000') + LEVEL) MISSING_CUST_CODE 
  			   FROM DUAL
  			   CONNECT BY LEVEL <=999
			 ) WHERE MISSING_CUST_CODE NOT IN 
  						(
  						SELECT CUST_CD
  						FROM CUST_MST
  						WHERE CUST_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  						UNION
  						SELECT SL_CD
  						FROM FAS.GL_MST 
  						WHERE GL_CD IN ('J100') AND SL_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  						UNION
  						SELECT SL_CD
  						FROM FINACC.SUBMST_T 
  						WHERE GL_CD IN ('1300','13100') AND SL_CD LIKE ':CUST_MST.TXT_CUST_SERIES%'
  																		)
  	  ORDER BY MISSING_CUST_CODE;
  END LOOP;
  EXCEPTION 
	WHEN TOO_MANY_ROWS THEN 
	  ERR_MESSAGE('Too Many Records Found in the Master');
	  RAISE FORM_TRIGGER_FAILURE;
	WHEN NO_DATA_FOUND THEN
	  ERR_MESSAGE('No Data Found ');
  RAISE FORM_TRIGGER_FAILURE;
	WHEN OTHERS THEN
	  :CUST_MST.TXT_CUST_SERIES := NULL;		
  
END;









Re: Dynamically Add Text Item on Canvas [message #623157 is a reply to message #623151] Fri, 05 September 2014 05:00 Go to previous messageGo to next message
cookiemonster
Messages: 13919
Registered: September 2008
Location: Rainy Manchester
Senior Member
I have no idea what the procedure has to do with the problem, and the procedure will error out if you have more than 1 missing cust code.
You can't dynamically add items to a form. You can dynamically make invisible items visible.
Re: Dynamically Add Text Item on Canvas [message #623171 is a reply to message #623157] Fri, 05 September 2014 08:28 Go to previous message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
You can't dynamically create new Block Items. Block Items can only be created during design. You can, however, create numerous generic Items and set them to VISIBLE = NO. Then during runtime, you can set them to VISIBLE = YES to give it the appearance of dynamically creating new Text Items. The problem with this method is that once you have displayed all of the items, you can't create/display more.

Craig...
Previous Topic: Form connectivity with ms-access
Next Topic: Menu roles in Forms 3.0
Goto Forum:
  


Current Time: Tue Apr 16 06:37:01 CDT 2024