Beruflich Dokumente
Kultur Dokumente
AIM
Ajay Solanki
Creation Date:
June 8, 2003
Last Updated:
Document Ref:
NAIO/APP_REPORTS
Version:
DRAFT 1C
Approvals:
Document Control
(v. DRAFT 1C )
Document Control
Change Record
26
Date
Author
Version
Change Reference
8-Jun-03
12-Jun-03
11-Apr-04
Ajay Solanki
Ajay Solanki
Ajay Solanki
Draft 1a
Draft1b
Draft1c
No Previous Document
Added section on multi language report
Added section on printing bitmap reports.
Reviewers
Name
Position
Distribution
Copy No.
Name
Location
Library Master
Note To Holders:
If you receive an electronic copy of this document and print it out, please write your
name on the equivalent of the cover page, for document control purposes.
If you receive a hard copy of this document, please write your name on the front
cover, for document control purposes.
Document Control
(v. DRAFT 1C )
Contents
Document Control
(v. DRAFT 1C )
Document Control
(v. DRAFT 1C )
2.
Parameter
The parameter p_conc_request_id is necessary to run the report on applications if it is
a multi-org report. The concurrent manager passes the concurrent request id to your
report using this parameter.
Name:
p_conc_request_id
Datatype: Number
Width:
20
Address field
Instead of Selecting address1, address2, address3, country, pin etc as separate fields
and then using the format trigger to hide the object if it is null, use CHR(10). The
format triggers make the report slower. Here the formatting is done in the query
itself.
Instead of using:
SELECT
PVS.vendor_site_id
,PVS.vendor_site_code
,PVS.address_line1
,PVS.address_line2
,PVS.address_line3
,PVS.address_line4
,PVS.country
PVS.zip
PVS.city
FROM po_vendor_sites PVS
PVS_vendor_site_id
PVS_vendor_site_code
PVS_address_line1
PVS_address_line2
PVS_address_line3
PVS_address_line4
|| '-' ||
|| ' ' ||
PVS_country_zip_city
PVS.vendor_site_id
PVS_vendor_site_id
,PVS.vendor_site_code
PVS_vendor_site_code
,PVS.address_line1 || DECODE(PVS.address_line1 ,NULL,NULL,CHR(10))
|| PVS.address_line2 || DECODE(PVS.address_line2 ,NULL,NULL,CHR(10))
|| PVS.address_line3 || DECODE(PVS.address_line3 ,NULL,NULL,CHR(10))
|| PVS.address_line4 || DECODE(PVS.address_line4 ,NULL,NULL,CHR(10))
|| PVS.country || '-' ||PVS.zip || ' ' || PVS.city
PVS_address
FROM po_vendor_sites PVS
Format triggers
If you have n fields which have to be formatted with the same condition instead of
using format trigger on each of them separately, put them in a frame and use format
trigger on the frame.
Formula columns
Always write exception no_data_found in the formula columns.
function CF_supplier_contactFormula return Char is
lc_supplier_contact VARCHAR2(40);
BEGIN
Formatting amounts
All the amount columns should use the FND FORMAT_CURRENCY.
Currency formatting support provides a flexible, consistent method to format a
numeric value according to its associated currency. The currency value appears with
the correct thousands separator and radix character 9decimal point) of the users
country. The value appears with positive and negative indicators of users choice.
If you want to format a field called total_amount
Make a formula column CF_total_amount_DISP.
It should be of type character and size 20.
Copy the following code in the formula column.
SRW.REFERENCE (:currency_code);
SRW.REFERENCE (:total_amount);
SRW.USER_EXIT ('FND FORMAT_CURRENCY
CODE
= ":currency_code"
DISPLAY_WIDTH = "18"
AMOUNT
= ":total_amount"
DISPLAY
= "CF_total_amount_DISP"');
RETURN( LTRIM(RTRIM(:CF_total_amount_DISP))) ;
Note: Currency_code has to be selected in the query.
Precision Formatting
If you have a numeric column which has to be formatted according to the precision
parameter (P_qty_precision) then attach the library called inv.pll to your report.
In the format trigger for that field write
get_precision(:P_qty_precision);
return (TRUE);
In this case if you give the value of the precision parameter as 3 then the numeric
column will be shown as 1234.000. If you give the value of the precision parameter as
2 then the numeric column will be shown as 1234.00.
Lexical Parameters
Always use lexical parameters when you have to check in the query if the parameter
value is null or not.
Make a lexical parameter cp_where5
Datatype:
Character
Width:
500
Initial value: AND 1=1
Character comparision:
In the where clause of query, instead of using
AND ( :p_trx_class IS NULL OR
:p_trx_class
RACTT.TYPE)
= RACTT.cust_trx_type_id
= fnd_profile.value('ORG_ID')
= RAT.term_id(+)
= HZPS.party_site_id
RACTT.CUST_TRX_TYPE_ID)
= RACTT.cust_trx_type_id
= fnd_profile.value('ORG_ID')
= RAT.term_id(+)
= HZPS.party_site_id
= RACTT.cust_trx_type_id
= fnd_profile.value('ORG_ID')
= RAT.term_id(+)
= HZPS.party_site_id
10
AND
AND
( :p_print_date_low
IS NULL OR
RACT.printing_last_printed >=
TO_DATE(TO_CHAR( :p_print_date_low ,'YYYY/MM/DD') ||' 00:00:00'
,'YYYY/MM/DD HH24:MI:SS')
)
( :p_print_date_high
IS NULL OR
RACT.printing_last_printed <=
TO_DATE(TO_CHAR( :p_print_date_high ,'YYYY/MM/DD') ||' 23:59:59'
,'YYYY/MM/DD HH24:MI:SS')
)
Debugging reports
You can always return important values by using
SRW.MESSAGE(111,'FAILED TO UPDATE PRINT DATE');
SRW.MESSAGE(112, cp_where2 is || :cp_where2);
These messages can be seen in the log file.
11
No data found
The report should display message *****NO DATA FOUND***** if the query does
not return any rows.
Make a text field with text *****NO DATA FOUND*****
Make a summary column CS_count which gives count of a not null field in the main
query.
Make a format trigger on the text item, if CS_count >0 then hide the object. It should
be center aligned with respect to the page.
End of report
The report should display *****END OF REPORT***** after the last line of the report
is printed. It appears only once per report. If you are printing Pos for the range PO
Number 1 to PO number 20, then the end of report will come after PO number 20 is
printed. It should be center aligned with respect to the page.
Report Conversion
To convert a bitmap report into character report, go to File Administration
Convert
In the Conversion tab enter the following values:
Document Type: Report
Source File:
Report Binary File (RDF)
Source:
Mention the source of the file.
Destination Type: Report Binary File (RDF)
Destination:
Mention the destination
In the Options tab
Destination Unit: Character.
Override: Prompt
Header template
Open the properties of the report. In the comments section, paste the header template
which describes who has created the report, when it was modifed and the
functionality of the report.
12
Others
Transfer the report in binary mode to server.
References
For more information, please refer to
1.
Build_Standards_MD040.DOC
2.
13
Creating Executable
14
Adding Parameters
Click on the parameter button and enter the required parameters.
The important thing to note is that the token should be the same as parameter name
in the report.
15
16
17
Adding columns
Query the Descriptive Flexfield, Flexfield Segment Values.
Unfreeze the segment definition.
Click on the Segment button and add the required number of attributes.
18
19
Click on the DFF and enter the values in the corresponding language.
SELECT
Developing Oracle Application Reports
File Ref: Developing Oracle Application Reports
20
attribute6
--date:
,attribute7
--terms of payment:
,attribute8
--your ref.:
,attribute9
--department
,attribute10
--our ref.:
,attribute11
--tax number:
,attribute12
--page:
,attribute13
--interest on late payment
,attribute14
--invoice no.
,attribute15
--due date
,attribute16
--late payment amount
,attribute17
--days
,attribute18
--rate
,attribute19
--total
,attribute20
--phone:
,attribute21
--fax:
,attribute22
--internet:
,attribute23
--cvr number:
,attribute24
--bank / swift adr. :
,attribute25
--bank account:
INTO
:pl_date
,:pl_terms_of_payment
,:pl_your_ref
,:pl_department
,:pl_our_ref
,:pl_tax_no
,:pl_page
,:pl_interest_late_payment
,:pl_invoice_no
,:pl_due_date
,:pl_late_payment_amount
,:pl_days
,:pl_rate
,:pl_total
,:pl_phone
,:pl_fax
,:pl_internet
,:pl_cvr_number
,:pl_bank_swiftadr
,:pl_bank_account
FROM fnd_flex_values FFV
,fnd_flex_value_sets FFSV
WHERE FFSV.flex_value_set_id
= FFV.flex_value_set_id
AND
FFSV.flex_value_set_name = 'XXSSI_AR_EDIIREP_LANG'
AND
flex_value
= :p_language;
RETURN(TRUE);
End;
21
Layout editor
22
Postscript Printer
Ask the DBA to configure a postscript printer to apps. Let us call this printer as
factprinter.
Ask the DBA to install Acrobat reader on the application server.
Put a pdf file on the server and try printing the pdf file from the OS
OS should be able to print PDF files directly from prompt.
cat < PDF document > | /usr/Acrobat4/bin/acroread -toPostScript -shrink | lp -c d < Printer > -n
Example go to the directory where you have put the pdf file in bitmap mode and
give the following command:
cat test.pdf | /factd4/applmgr/Acrobat5/bin/acroread -toPostScript -shrink | lp -c
-d factckprinter
Where
test.pdf is the name of the test pdf file to be printed.
/factd4/applmgr/Acrobat5/bin/acroread is the location where the acrobat reader is
installed
factckprinter is the name of the printer.
Once the command works from the OS, register a new driver and type as follows.
23
24
25
26