Oracle9iAS Reports Services Publishing Reports to the Web Release 2 (9.0.2) Part Number A92102-01 |
|
If you have a number of reports that you wish to register in Oracle9iAS Portal, it is often preferable to register them as a group in a batch script rather than individually in the Oracle9iAS Portal user interface. Likewise, if you have a large number of reports that you wish to unregister, a batch script is more efficient.
To batch register reports in Oracle9iAS Portal, you need to perform the following steps:
To generate a SQL script that you can execute in SQL*Plus to register your reports, do the following:
Following is an example RWCONVERTER command line on Microsoft Windows:
rwconverter.exe dtype="register" stype="rdffile"
source="(security.rdf,earnings.rdf,acc_pay.rdf)" dest="(output.sql)"
p_owner="Oracle9iAS Portal" p_servers="(repserver,acct_server)"
p_description="restricted report" p_privilege="(SCOTT,JABERS,ACCT)"
p_availability="production" p_types="(Cache,printer)"
p_formats="(HTMLCSS,PDF)" p_printers="(sales_printer,acct_printer)"
p_pformTemplate="public.finance_template"
p_trigger="Is begin IF UPPER(DESTYPE) = ''PRINTER'' AND
EMPNAME = ''SMITH'' THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; end;"
The above command line would generate a SQL script file named output.sql that contains the following:
SET SERVEROUTPUT ON VAR STATUS NUMBER; EXEC :STATUS := RWWWVREG.REGISTER_REPORT (P_NAME=>'Security',
P_OWNER=>'Oracle9iAS Portal', P_SERVERS=>'repserver,acct_server',
P_FILENAME=>'security.rdf', P_DESCRIPTION=>'restricted report',
P_PRIVILEGE=>'SCOTT,JABERS,ACCT', P_AVAILABILITY=>'production'
P_TYPES=>'Cache,printer', P_FORMATS=>'HTMLCSS,PDF)',
P_PRINTERS=>'sales_printer,acct_printer
P_PFORMTEMPLATE=>'public.finance_template' P_PARAMETERS=>'(P_LASTNAME)
(P_SSN)', P_TRIGGER=>'Is begin IF UPPER(DESTYPE) = ''PRINTER'' AND
EMPNAME = ''SMITH''THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; end;'); EXEC :STATUS := RWWWVREG.REGISTER_REPORT (P_NAME=>'Earnings',
P_OWNER=>'Oracle9iAS Portal', P_SERVERS=>'repserver,acct_server',
P_FILENAME=>'earnings.rdf', P_DESCRIPTION=>'restricted report',
P_PRIVILEGE=>'SCOTT,JABERS,ACCT', P_AVAILABILITY=>'production'
P_TYPES=>'Cache,printer)', P_FORMATS=>'HTMLCSS,PDF)',
P_PRINTERS=>'sales_printer,acct_printer',
P_PFORMTEMPLATE=>'public.finance_template',
P_TRIGGER='Is begin IF UPPER(DESTYPE) = ''PRINTER'' AND EMPNAME = ''JABERS''
THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; end;'); EXEC :STATUS := RWWWVREG.REGISTER_REPORT (P_NAME=>'Acc_pay',
P_OWNER=>'Oracle9iAS Portal', P_SERVERS=>'repserver,acct_server',
P_FILENAME=>'acc_pay.rdf', P_DESCRIPTION=>'restricted report',
P_PRIVILEGE=>'SCOTT,JABERS,ACCT', P_AVAILABILITY=>'production'
P_TYPES=>'Cache,printer', P_FORMATS=>'HTMLCSS,PDF',
p_printers=>'sales_printer,acct_printer',
P_PFORMTEMPLATE=>'public.finance_template'
P_TRIGGER=>'Is begin IF UPPER(DESTYPE) = ''PRINTER'' AND
EMPNAME = ''JABERS''THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; end;');
For more information about the contents of this SQL script file, refer to PL/SQL Batch Registering Function.
P_PARAMETERS=>'(P_LASTNAME)(P_SSN)',
In this case, you can optionally define the default, low, and high values, or a list of values for each user parameter if you want to restrict the values the user may enter at runtime. Similarly, if you want to restrict system parameters, such as COPIES, to limit the number of copies a user can make, you do so by using the P_PARAMETERS parameter. The edited P_PARAMETERS keyword might look like the following:
P_PARAMETERS=>'(P_LASTNAME, LOV=LASTNAME_LOV)(P_SSN)
(COPIES, DEFAULT=1,LOW=1,HIGH=2)'
This revised code segment imposes the following restrictions on the report:
To actually register your reports in Oracle9iAS Portal, you must run the script generated for you by RWCONVERTER:
@ output.sql
The script will execute and create packages in Oracle9iAS Portal for each report listed in the script with the specified parameters.
To remove many reports from Oracle9iAS Portal at once, do the following:
VAR STATUS NUMBER; EXEC :STATUS := RWWWVREG.DEREGISTER_REPORT (P_NAME=>'Security'); EXEC :STATUS := RWWWVREG.DEREGISTER_REPORT (P_NAME=>'Earnings'); EXEC :STATUS := RWWWVREG.DEREGISTER_REPORT (P_NAME=>'Acc_pay');
@ rmv_rdfs.sql
The script will execute and remove the packages from Oracle9iAS Portal for each report listed in the script.
The SQL script that RWCONVERTER generates for you to batch register reports in Oracle9iAS consists mainly of calls to the rwwwvreg.register_report function. The syntax of rwwwvreg.register_report is as follows:
Function Rwwwvreg.register_report(
p_owner varchar2,
p_name varchar2,
p_servers varchar2,
p_filename varchar2,
p_description varchar2,
p_privileges varchar2,
p_availability varchar2,
p_types varchar2,
p_formats varchar2,
p_printers varchar2,
p_pdformTemplate varchar2,
p_parameters varchar2,
p_trigger varchar2)
return number;
-- =0 : succeeded;
-- !=0 : failed;
The table below describes each of the parameters taken by rwwwvreg.register_report.
Parameter | Description |
---|---|
P_OWNER |
Is the owner of the schema. The default is the current Oracle9iAS Portal schema that you are logged in to when you start the SQL*PLUS script. For example: P_OWNER=>'Oracle9iAS Portal' |
P_NAME |
Is the name used to identify the report in Oracle9iAS Portal. P_NAME corresponds to the Name field in the Create Report Definition File Access wizard. For example: P_NAME=>'Earnings' |
P_SERVERS |
Is the names of the Reports Servers on which the report definition files defined in the P_FILENAME parameter have access privileges. The list of Reports Servers is comma delimited. P_FILENAME corresponds to the Reports Servers field in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_SERVERS=>'repserver,acct' Note: The Reports Servers you list for P_SERVERS must already be registered in Oracle9iAS Portal. For more information, refer to Chapter 5, "Controlling User Access". |
P_FILENAME |
Is the name of the report definition file that is being registered. P_FILENAME corresponds to the Oracle Reports File Name in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_FILENAME=>'earnings.rdf' |
P_DESCRIPTION |
Is a description of the report. P_DESCRIPTION corresponds to the Description field in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_DESCRIPTION=>'restricted report' |
P_PRIVILEGE |
Is the users or roles given privileges to run the report definition file defined in P_FILENAME. This list is comma delimited. P_PRIVILEGE corresponds to the Grantee list on the Access tab of the Manage Component page for the report. Note that you must uncheck Inherit Privileges from Portal DB Provider in order to see the Grantee list. For example: P_PRIVILEGE=>'SCOTT,JABERS,PORTAL90' |
P_AVAILABILITY |
Is the name of the availability calendar that determines when the report definition file defined in the P_FILENAME parameter will be available for processing. P_AVAILABILITY corresponds to the Availability Calendar Name field in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_AVAILABILITY=>'production' Note: The availability calendar must already exist in Oracle9iAS Portal. For more information about creating an availability calendar, see Chapter 5, "Controlling User Access". |
P_TYPES |
Is the destination types to which the report definition file defined in the P_FILENAME parameter can be sent (e.g., cache, printer). This list is comma delimited. P_TYPES corresponds to the Types multiple select box in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: |
P_FORMATS |
The destination formats to which the report definition file defined in the P_FILENAME parameter can be sent (e.g., HTML, PDF). This list is comma delimited. P_FORMATS corresponds to the Formats multiple select box in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: |
P_PRINTERS |
The printers to which the report definition file defined in the P_FILENAME parameter can print. This list is comma delimited. P_PRINTERS corresponds to the Printers multiple select box in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: Note: The printers you list for P_PRINTERS must already be registered in Oracle9iAS Portal. For more information, refer to Chapter 5, "Controlling User Access". |
P_PFORMTEMPLATE |
Is the parameter form template that determines the page style of the Runtime Parameter Form. P_PFORMTEMPLATE corresponds to the Parameter Form Template field in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_PFORMTEMPLATE=>'public.finance_template' |
P_PARAMETERS |
Is the user and system parameters' default, high, and low values, or list of values name. Note: The P_PARAMETERS parameter does not have a corresponding RWCONVERTER argument. Hence, if you want to batch import user parameter values, ranges, or lists of values, you must manually edit the SQL script generated by RWCONVERTER. P_PARAMETERS corresponds to the (parameter) Name, LOV, Low Value, and High Value fields in the Create Report Definition File Access wizard and the Edit Report Definition File page. The default corresponds to the value set in the Runtime Parameter Form for the specified parameter. For example: P_PARAMETERS=>'(P_LASTNAME, LOV=LASTNAME_LOV) P_LASTNAME, P_SSN, and COPIES are parameter names. LOV is the name of the list of values. LOW is the low value in a range of values. HIGH is the high value in a range of values. |
P_TRIGGER |
Is the validation trigger written in PL/SQL that returns a boolean statement (e.g., true (succeeded) or false (failed)). P_TRIGGER corresponds to the text box in the Create Report Definition File Access wizard and the Edit Report Definition File page. For example: P_TRIGGER=>'Is begin IF UPPER(DESTYPE) = ''PRINTER'' AND EMPNAME = ''SMITH'' THEN RETURN(TRUE); ELSE RETURN(FALSE); END IF; end;' |
|
![]() Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|