Home » Developer & Programmer » Reports & Discoverer » Inserting values when running a report! (Reports 6i, 10g Database)
Inserting values when running a report! [message #466376] |
Mon, 19 July 2010 06:22 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/152402.jpg) |
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
Dear,
I have a report, where there are opening balance and closing balance, so i have to store the closing balance values
in a separate table during runtime and should show this closing value as opening balance for next month.
is it possible in a report how can we do?
Pls Help.
Stalin Ephraim.
|
|
|
|
|
|
|
Re: Inserting values when running a report! [message #466500 is a reply to message #466386] |
Mon, 19 July 2010 23:22 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/152402.jpg) |
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
Dear Littlefoot,
Its not calculated in that table, formula columns used to calculate from different tables and finally the table values from all the tables has to be added in a separate table(opcl) when the values were calculated and showed in respective closing value columns.
So we can use this closing values from that table(opcl), when we needed to display it in opening balance column in next month.
do you have an idea? how can we write the insert for these values.
[Updated on: Mon, 19 July 2010 23:24] Report message to a moderator
|
|
|
|
|
Re: Inserting values when running a report! [message #466992 is a reply to message #466510] |
Wed, 21 July 2010 23:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/152402.jpg) |
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
function AfterReport return boolean is
begin
--if (:total_credit) is not null then
insert into opcl (fiscal_yr_cd,Period_no,Col1,Col2,Col3,Col4,Col5,Col6)
Values (:P_Fiscal_yr,:P_Period,:total_credit, :total_cess_cf,
:total_sec_cess_cf, :cf_tot_serv_tax1, :cf_tot_serv_tax2,
:cf_tot_serv_tax3);
--end if;
commit;
return (TRUE);
end;
I have written this insert, but not data is saved!
|
|
|
|
|
|
Re: Inserting values when running a report! [message #467568 is a reply to message #467496] |
Mon, 26 July 2010 01:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/152402.jpg) |
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
Dear Md. Mehedi Hossain and All Dear ones,
Thank you for your kind reply,
well i am attaching that report as a sample copy.rdf, and you can see the table which i want to insert as a comment, in the After Report Trigger.
In that report what we have to do is just i need to display the closing balance amount should be shown for next months Opening Balance.
for this i have written a insert in the after report.
pls check.
All are formula columns, just i have given what i need.
pls see it.
Reply soon as possible.
Stalin Ephraim
[Updated on: Mon, 26 July 2010 01:53] Report message to a moderator
|
|
|
|
Re: Inserting values when running a report! [message #467575 is a reply to message #467570] |
Mon, 26 July 2010 02:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Another idea: how do you, exactly, test the report? Do you run it from Reports Builder? So - output is displayed, report is (obviously) done. Then what? You turn it off? Check whether there's something in the table, but - it is empty?
If so, well, you can't test it that way because After Report simply won't fire (in Reports Builder). You could, though, try the following: generate the output to a file (such as PDF):
![/forum/fa/8078/0/](/forum/fa/8078/0/)
This will make the After Report trigger fire, and you'll probably see something in the table. At least, that worked fine for me (I created a dummy report based on Scott's schema).
On the other hand, if you ran the report from the application, the trigger should have fired. If that was the case, huh, no idea at the moment.
|
|
|
Re: Inserting values when running a report! [message #467609 is a reply to message #467575] |
Mon, 26 July 2010 04:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/152402.jpg) |
stalin4d
Messages: 226 Registered: May 2010 Location: Chennai, Tamil Nadu, Indi...
|
Senior Member |
|
|
Dear,
I get the Value Rs. 4026603 as closing amount(:total_credit) for the month of Jun, but as we know that we cant show this formula column value in opening balance of July. because it would arise
this error;
REP-1241 Circular column dependency originating with column 'cenvat_opening'
so as advised i have to insert or store the other column values in a table [OPCL]which has already no data, because i created with no values and should insert values when i run the report.
so i wrote the insert command in that after report trigger for the insertion!
create table OPCL
(
FISCAL_YR_CD VARCHAR2(1),
PERIOD_NO VARCHAR2(2),
COL1 NUMBER(30,3),
COL2 NUMBER(30,3),
COL3 NUMBER(30,3),
COL4 NUMBER(30,3),
COL5 NUMBER(30,3),
COL6 NUMBER(30,3)
)
but why this insertion doesn't took place.
the values like
opening balance + credit taken on input on invoices + credit taken on capital goods + total credit availed - credit utilised for payment of duty goods = Closing Stock.
so i solidly get the values but this values i cant able to insert through a after report trigger.
i Need to know will this query effect or Not?
how to insert a value through a report?
function AfterReport return boolean is
begin
srw.message(100,'Hai');
if (:total_credit) is not null then
insert into opcl (fiscal_yr_cd,Period_no,Col1,Col2,Col3,Col4,Col5,Col6)
Values (:P_Fiscal_yr,:P_Period,nvl(:total_credit,0), nvl(:total_cess_cf,0),
nvl(:total_sec_cess_cf,0), nvl(:cf_tot_serv_tax1,0), nvl(:cf_tot_serv_tax2,0),
nvl(:cf_tot_serv_tax3,0));
commit;
end if;
return (TRUE);
I Hope you understand!!!
I give the Input fiscal year code as 'J' and Period no = '02'
here J = 2010, and Period_no = June.
Fiscal Year Code J = 2010, K = '2011' etc.
Period Nos June = '02', July = '03' etc.
[Updated on: Mon, 26 July 2010 04:16] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Feb 11 23:14:17 CST 2025
|