Home » Developer & Programmer » Reports & Discoverer » Oracle Report Printing Authorization Problem
Oracle Report Printing Authorization Problem [message #205891] Tue, 28 November 2006 01:01 Go to next message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Hi All,
I am new to this Forum .I am Currently using Reports 6i for Reportings and the Requirement is to Print Reports on Some Authorization as we have Some Accounts in Login Basis

For Example if I would logged as :Jak's A/C After Showing Report in Previwer it Should allow to Print.
But Should not Allow to Print in Mike's A/C,But Still Allow to Show the Preview. Is that Possible as Oracle Help is not available for that Topics ?



Javed A. Khan
3i-Infotech Ltd.
Mumbai (India)
Re: Oracle Report Printing Authorization Problem [message #206159 is a reply to message #205891] Wed, 29 November 2006 00:21 Go to previous message
javed.khan
Messages: 340
Registered: November 2006
Location: Banglore
Senior Member

Razz Hi All,
Regarding Previous Problem Just want to Share what the Solution I have appilied for the Same...My Problem was to Giving Print authority only for Some Selected Users but Still they can see the Preview so After heading alot i come to a Solution although you guys are able to Suggest a Better One.

I have Alterd Three of my System Validation Triggers and Now its Working accoring to my Need.here the Code for Triggers.

In Copies Parameter
-------------------
----COPIES ---
---ADDED BY JAVED ON 271106

function COPIESValidTrigger return boolean is

M_AS_PRINT_ALLOW_YN PM_APPR_SETUP.AS_PRINT_ALLOW_YN%TYPE;

/*this is a form component i have added which return Y/N for recognizing the Print authority*/

CURSOR C1 IS
SELECT AS_PRINT_ALLOW_YN FROM PM_APPR_SETUP
WHERE AS_USER_ID = :P_USER_ID;
/* All the Y/N Values Fetching into a Cursor*/

begin
OPEN C1;
FETCH C1 INTO M_AS_PRINT_ALLOW_YN;
CLOSE C1;
IF NVL(M_AS_PRINT_ALLOW_YN,'N') ='N' THEN
SRW.MESSAGE(1,'Not authorised to print policy');
:COPIES := 0;
RETURN(TRUE);
ELSE
:COPIES := 1;
RETURN(TRUE);
END IF;
END;


For Desformat Parameter
-------------------------

---DESFORMAT --
---ADDED BY JAVED ON 271106


function DESFORMATValidTrigger return boolean is
begin
If :DESFORMAT ='rtf' Then
srw.message('1001','Cannot generate in RTF formatt');
raise srw.program_abort;
ElsIF
:DESFORMAT ='pdf' Then
srw.message('1002','Cannot generate in PDF formatt');
ElsIF
:DESFORMAT ='html' Then
srw.message('1003','Cannot generate in HTML formatt');
elsif
:DESFORMAT ='eps' Then
srw.message('1004','Cannot generate in PosScript formatt');
raise srw.program_abort;
elsif
:DESFORMAT ='csv' Then
srw.message('1005','Cannot generate in TXT formatt');
elsif
:DESFORMAT ='CSS' Then
srw.message('1006','Cannot generate in TXT formatt');
elsif
:DESFORMAT ='xml' Then
srw.message('1006','Cannot generate in XML formatt');
END IF;
return (TRUE);
end;

-------------
As User Want a Specific Message While generating the Partcular Format
-------------

And in PrintJob Parameter
---------------------------


--PRINTJOB ---
---ADDED BY JAVED ON 271106


function PRINTJOBValidTrigger return boolean is

M_AS_PRINT_ALLOW_YN PM_APPR_SETUP.AS_PRINT_ALLOW_YN%TYPE;

CURSOR C1 IS
SELECT AS_PRINT_ALLOW_YN FROM PM_APPR_SETUP
WHERE AS_USER_ID = :P_USER_ID;

begin
OPEN C1;
FETCH C1 INTO M_AS_PRINT_ALLOW_YN;
CLOSE C1;

IF NVL(M_AS_PRINT_ALLOW_YN,'N') ='N' THEN
SRW.MESSAGE(1,'Not authorised to print policy');
:PRINTJOB := 'NO';
RETURN(TRUE);
ELSE
:PRINTJOB := 'YES';
RETURN(TRUE);
END IF;
END;
----------
Please note that I havent Changed any Default Value for those parameters
I come to know that if we place COPIES as 0 and PrintJob as No it will show you the Preview but doesnt allow to print,But Still I got a System message "VALIDATION TRIGGER ERROR" Please suggest me to Override the Message with My Personlised One.As i want to Show thge Message as " Not Authorised to Print".

Thanks & Regard
Javed A. Khan Razz
Previous Topic: Detail line is changing my summary results to zero
Next Topic: Paper Size Set Letter to A4
Goto Forum:
  


Current Time: Tue Jul 02 17:41:56 CDT 2024