Showing posts with label Reports. Show all posts
Showing posts with label Reports. Show all posts

Wednesday, December 20, 2017

Oracle Report Layout
Confine Mode Vs. Flex Mode


In the name of Allah, Most Gracious, Most Merciful      
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

 This is a reminder upon request to Oracle developers concerning dealing with two main component modes of  Oracle Report  layout.

  •        Confine Mode.
  •        Flex Mode.

       These two modes  control  the management of  your report frames and fields. wizards can do the initial layout but wizards are always unsatisfied; you must modify the layout manually. Here comes the need to recognize the functionality of Confine and Flex modes to deal with them efficiently.


Sunday, January 15, 2017

A Report With No Data

  A Report With No Data

  

       In the name of Allah, Most Gracious, Most Merciful 
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

        The Oracle Report is a visual representation of the company data stored in one or more database tables or views. If your report is running correctly, this means, your code behinds calling this report works just fine. In fact, It is just all about the 
execution of a code to achieve the report mechanism of calling it.

        On the other hand, a report running with no data does not mean your report is at the save mode. It's only a warning message that denotes one or more ambitious problems is waiting for you. Even though it is only one problem, but it.causes it has so many reasons 

    Today's task in shaa Allah, I will list the reasons for displaying a report with  no  data even though there is a data stored in the database.


Problem Definition:   

      A report with no data.


Problem Reasons:

 7 Reasons Leads To A Report With No Data:

          1.        No data stored into the database.
         2.        Invalid report query conditions.
         3.        Incompatible parameter name.
         4.        Incompatible parameter types.
         5.        The parameter numbers are not equal.
         6.        Invalid data input.
         7.        Invalid report name.


Problem Task Solution:

7 probabilities for a solution to a report with no data:

  •    Execute the report query into SQLPLUS or Toad to check for data. If it displays data then the problem exists either in the report or the parameter form.

  •     Comment each suspected condition at the where clause query line by line.Then, re-execute the query. Repeat these steps until you get the data displayed.
                
      Start inspection through checking up these questions with answers:

                         i.   Are the database tables' constraints and relationships correct?
                       ii.   Is there any incorrect data inputs by the user himself?  
               iii.    Is  the query parameters are logically correct?
               iv.     Is the  query parameters format mask matches?  
                  v.    Is the specified value for the parameter date has data?
              vi.   Is there any irrelevant conditions in the where clause of the report's query.

3.        Mismatch Parameters' Names 

      This means the report parameter name itself is not the same one as on the parameter form or page. You may have:

           ·        A spelling mistake; So you have to make sure that both names are the same. You may use, copy & pate just to assure equality on both sides.
          ·       One single extra space; using copy and paste may lead to one or more extra character space.
         ·  A colon character, You may copy the parameter preceding colon ':'  in the report query as follow:


 SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER, 'paramform=no'
                                      ||' :P_DEPT_ID='|| TO_CHAR(:DEPTS.DEPT_ID));

 Note:  The report will also display with no data just in case the report parameter has no initial value. Otherwise, it will display data upon the initial value.


4.        Incompatible Parameter Types

        The report parameters' types MUST BE compatible with the parameter form's parameters according to Oracle Explicit & Implicit Data Type Conversion rules, e.g. Oracle treats 1500 the same as '1500'. But using TO_NUMBER  function in a  string contains non-numeric characters, the function returns an error. 


 SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER, 'paramform=no'
                                               ||' :P_DATES='|| TO_CHAR(:EMP.HIRE_DATE, 'DD-MM-RRRR'));


Note:  All parameters in the parameter form called especially date & number parameter data type MUST BE in character data type. Otherwise, no data will be displayed. If  NOT the form item datatype is not defined as the character data type you MUST convert it using TO_CHAR()  as giving in the example.


5.        Unequal parameters' numbers: 

      The number of a report parameters referenced in the report query  MUST BE equal to the parameters' form numbers referenced in the parameter form's code. This involves one or more  extra parameter report not includes in the parameter  form or the vice versa .You have to count them and remove any redundant or extra parameters.


6.        Invalid Data Input:

       This may occur from the application user or the oracle developer or the application testers; they may input incorrect data when calling a report from the parameter form, a developer, e.g. may write the report query contains a range of  date  parameters as the following:
  

WHERE INVOICE_DATE BETWEEN :P_START_DATE AND :P_END_DATE

  
The wrong date input:
From: 15-01-2017   To: 01-01-2017   
  
The correct date input:
From:   01-01-2017    To: 15-01-2017

Note
         The date range is reversed, so you can solve this problem if you correctly reverse the wrong date range to the correct one. A good developer can expect this problem and handle it through writing a date range validation on each item on the parameter form to enforce the user to input the correct logical date range and etc.


7.        Invalid Report Copy:

         This case rarely happens, a developer may mistakenly replace an old report copy of the new one. So you have to pay more attention to this mistake. So you have to test and review all report copy from the correct working folder and the valid path. Making sure you have the correct generated run time copy of both the page or form and the report. 


Learn more about:

·        Calling Oracle Report 10G
·        Oracle Arabic Report 10G




Hope this helps...

My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.



Monday, July 6, 2015

Calling Oracle Report 10g


 Calling Oracle Report 10g 



     In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,

Oracle Reports is a tool for developing reports against data stored in an Oracle database. Oracle Reports consists of Oracle Reports Developer (a component of the Oracle   Developer Suite) and Oracle Application Server Reports Services
 (a component of the Oracle Application Server )


ask Definition:T


. Calling a Report 10G from a Parameter Form 10G


 Five Steps To Call a Report:  
  1. Create a parameter form; click new form module.
  2. Create a non database block with the following input text item e.g. date_from and date_to with a format mask the same as the report date parameter.
  3. Create a report node with the report name.
  4. Invoke the report node property fill Filename Property with the report name, select  run_time for the Execution Mode Properties, select synchronize for the Execution Mode Properties.
  5. Create a program unit e.g. run_report procedure paste the code and do the necessary changes required according to you own report and server report name.


PROCEDURE run_report IS

    v_report_id                REPORT_OBJECT;
    vc_report_job_id        VARCHAR2(100); -- Unique ID for each report.
    vc_rep_status            VARCHAR2(100);  -- The report job status 
-- Note: You have to change the next report server name
-- initialized between two single quotes
-- according to your report server name
v_report_server          VARCHAR2 (30) := 'report_server_ora';
BEGIN
  /* The next three code lines point to the report object previously created in form's report object node */

 v_report_id  := FIND_REPORT_OBJECT('your_report_name');

  SET_REPORT_OBJECT_PROPERTY(v_report_id ,REPORT_COMM_MODE,SYNCHRONOUS);
  SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,CACHE);
/* Set the report output format; choose one and only one format out of the following options e.g. 'PDF' or ''HTML' etc. */
 SET_REPORT_OBJECT_PROPERTY(v_report_id,
REPORT_DESFORMAT,  'HTML|HTMLCSS|PDF|RTF|XML|DELIMITED'); 
 /* Replace the report server name with the name of the Reports
Services defined in your tnsnames.ora file*/
SET_REPORT_OBJECT_PROPERTY(v_report_id, REPORT_SERVER,'v_report_server');
/* Define different user parameters; global, parameter form and date to be passed to the report.
Note: All parameters MUST be character datatype */
/* The Report's Parameter form is suppressed by setting param form parameter to 'NO'.*/
 SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER, 'paramform=no'
                                              ||' P_USER_ID='||:GLOBAL.USER_ID                       
||' P_SECTOR_ID='|| :PARAMETER.PARAMETER_SECTOR                                           
||' P_FROM_DATE='|| TO_CHAR( :FROM_DATE,'DD-MM-RRRR')
                                             ||'P_TO_DATE='||TO_CHAR(:TO_DATE,'DD-MM-RRRR');
 /* Finally, run the report and retrieve the report job id as a handle to the report process*/
vc_report_job_id := RUN_REPORT_OBJECT(v_report_id);
/*Display the report in the browser in a separate browser you follow*/
web.show_document ('///getjobid='|| vc_report_job_id ||'?server='|| '','_blank');
/*Sample Example valid to a report server on the same pc or vm not a remote one. */
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||
SUBSTR (vc_report_job_id,instr(vc_report_job_id,'_',-1)+1)||'?','_blank');
ELSE
       MESSAGE (' Report Status is : ' || vc_rep_status );
PAUSE;
END IF;
END;
  
Note
  • To access a Remote Reports Server on a different machine: you must use the following prefix   http://hostname:port/...
  • You can NOT use REPORT_FILENAME or REPORT_DESNAME with (CACHE)
When Calling the Report output to be displayed in a separate browser window.
 
Learn more about:


Hope this helps…

My success only comes from Allah, pls. note your comments and suggestions are great 
help for me in progress thanks in advance.