Custom report Development (Html/xml)

Source: Internet
Author: User

    1. Define a package or stored procedure for report execution:

--Create Baotou

CREATEORREPLACEpackage xxplm_aarontest001 is

PROCEDUREMAIN(errbuf outVARCHAR2,

Reccode out number ,

???????? CNT in number );

???? END;

?

Note: Here are two parameters errbuf out VARCHAR2,reccode out number

Must be taken, even if not used.

?

--Create Package body

CREATEORREPLACEpackageBODY xxplm_aarontest001 is

PROCEDUREMAIN(errbuf outVARCHAR2,

Reccode out number ,

???????????? CNT in number ) is

v_cnt number: =0;

???? BEGIN

--log

Fnd_file.put_line(fnd_file.log,' ************************** ');

Fnd_file.put_line(fnd_file.log,

' Program Start: '| |

To_char(sysdate,' yyyy/mm/dd HH24:MI:SS '));

Fnd_file.put_line(fnd_file.log,' ************************** ');

--create XML file

Fnd_file.put_line(fnd_file.output,' <XXPLM_AARONTEST002> ');

Fnd_file.put_line(fnd_file.output,' <LIST_DETAIL> ');

--line OUTPUT

While v_cnt < cnt LOOP

???????????????????? Fnd_file.put_line(fnd_file.output,' <LIST_DATA> ');

???????????????????? Fnd_file.put_line(fnd_file.output,

' <b> '| | v_cnt | | ' </b> ');

???????????????????? Fnd_file.put_line(fnd_file.output,' </LIST_DATA> ');

v_cnt : = v_cnt +1;

ENDLOOP;

???????? --create XML file

???? Fnd_file.put_line(fnd_file.output,' </LIST_DETAIL> ');

Fnd_file.put_line(fnd_file.output,' </XXPLM_AARONTEST002> ');

?

ENDMAIN;

END;

?

--To test

DECLARE

Errbuf VARCHAR2(+);

???? Reccode number;

BEGIN

???? xxplm_aarontest002. MAIN(errbuf,reccode,2);

END;

After the test is no problem, make the report configuration.

  1. To configure a report:

    To define an executable program:

    Report Definition:

    Note: This test must be consistent with the previous executable definition, preferably in uppercase.

    Define parameters:

    To define a request:

    --See which duty you want to put the report in (Note: Here you just need to see the responsibility, no need to create): and record the "request Group" name to prepare for subsequent definition requests

    ?

    In the group, add the program that we defined. Xxplm_aarontest001_ Report Test

  2. To execute the request:

    Switch responsibilities to the previous we define the request, the name of the responsibility we are looking at:

    Perform View--Request:, click Submit new request, name Select Define request, System jump input parameter box, enter parameters, click OK, and submit.

    View Request Execution:

    To view the output:

    Select the browser and see the output in the browser:

  3. To create a template RTF Template:

    Save the browser results as a local XML file.

    Create a new Word document, open, select Add-ons, and see "Oracle BI Publisher", if you don't have this option, you'll need to install Oracle BI Publisher and download the installation yourself.

    See in, data and insert two functions, we mainly use these two functions. 1. Load data: Data-"Load sample XML data." 2, Insert-"Table Wizard."

    Data-"Load the sample XML data and select the XML document we saved earlier."

    Insert-"Table Wizard, follow the steps, next, notice the steps, you need to select the left field to the right to be displayed." Click Done.

    When finished, the template is saved as shown in, Save as, and other, select Rich Text Format.

  4. Data definition and Template creation:

    Switch responsibilities to: Oracle XML Publisher. Select home-Data definition, the Data definition page opens in the browser:

    Create a Data definition page: For example, note that the code must be consistent with the abbreviation in the previous program-definition and is case-sensitive. If the error is detected,

    The defined program and the defined RTF template will not be able to connect, the data cannot be exported to Excel, there will only be XML.

    Click on the template page on the left: Create a template, such as note that the code is consistent with the abbreviation in the previous program-definition, and is case-sensitive. Data definition Selection

    Define the data definition, type Select RTF, default language can be English or Chinese, region optional. Default output Type: Excel must be selected.

  5. To re-execute the request:

    Refer to 3 to execute the request item. When the output is different from before, after the template is defined, if the hook succeeds, the output will be output by default. XLS format, unlike before, you can select XML.

    See:

    To save the output result:

    The above is a custom report step and note that will continue to post some two development articles later.

Custom report Development (Html/xml)

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.