Six report formats provided by Oracle reports

Source: Internet
Author: User

We all know that Oracle reports is a tool for Oracle Data Statistics and graphical reports. Oracle reports provides six different report formats, but we often use tabular and matrix, the following articles will introduce you.

Regardless of the report type, the number of printed tables changes dynamically. In a tabular report, the number of columns is fixed, but the number of rows is not fixed. In a matrix Report, the number of rows and the number of columns are not fixed. In Oracle reports, how does one set the report length and width? In the actual development process, I have summarized an effective method for the above two types of reports for your reference.

For tabular reports, you can use reports to trigger sub-after parameter form and after report to achieve fixed-length output. The method is to determine the number of rows printed on each page according to the actual situation. When the number of records on the last page is less than the number of rows printed on each page, fill in the blank record. Insert an empty record in the trigger sub-after parameter form and delete the empty record in the trigger sub-after report. The following is an example.

Assume that there is a data base table wzdm: storing the material code information. Its data structure is:

Field name meaning length type

Wzdm material code 9 c

Wzmc material name 20 c

Xhgg model specification 20 c

Jldw measurement unit 6 c

Requirement: output the material code table based on the specified length, and x rows are output on each page (x can be determined based on the actual situation ).

1. Start Oracle reports, create a material code print report (omitted), and add the following code to the report trigger subitem after parameter form:

 
 
  1. declare  
  2. v—jls number(2);  
  3. i number(2):=1;  
  4. begin  
  5. select count() into v—jls from wzdm;  
  6. if mod(v—jls,x)〈〉0 then  
  7. loop  
  8. exit when i〉=(x-mod(v—jls,x))+1;  
  9. insert into wzdm(wzdm,wzmc,xhgg,jldw)  
  10. values(′′,′′,′′,′′);  
  11. ii:=i+1;  
  12. end loop;  
  13. commit;  
  14. end if;  
  15. end;  
  16.  

Add the following code to the report trigger subafter report:

 
 
  1. begin  
  2. delete from wzdm where wzdm is null;  
  3. commit;  
  4. end;  

2. After running the report, you can output the fixed-length material code table.

Note: For other tabular reports, when writing the above two triggers, you only need to modify the base table name and column name based on the actual situation and determine the value of x.

The above content is the introduction of Oracle reports to Oracle's data statistics and graphical reporting tools. I hope you will get some benefits.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.