About formula column in oracle report
I want the output value of the formula column in my report between two brackts ....ex: (28.99) ...can anyone give me the idea
Do u mean that brackets have to be appeared only when the value is +ve/-ve. then you need to use (9999) in the format mask of the property pallette of the text column. if you want to use the brackets for all the data, then the solution has been provided by many of our frnds.
Similar Messages
-
Using PL/SQL in a formula column in Oracle Reports Builder.
Hi,
I need to SUM two record from the result of an SQL interrogation.
Here's what it looks like
function CF_1Formula return Number is
nTot1 NUMBER :=0;
nTot2 NUMBER :=0;
begin
select sum(:TOT1) into nTot1 from table(Q1) ;
select sum(:TOT2) into nTot2 from table(Q1) ;
return (nTot1 + nTot2);
end;I'm kind of new to formula column programming any link of interest would be appreciated.
The from table(Q1) part Q1 represents my SQL interrogation name and the group below it is G_MAIN.Hi Hong Kong King Kong,
From looking at that function name (and the group name): Is this an Oracle Reports generated function?
If so, there's also a dedicated Reports forum: Reports
By the way, I like your synonym for 'query'.
I'm sure I'll confuse some of my collegues tomorrow when I will mention 'database interrogation' instead of 'query'. ;)
edit
Doh...I should not underestimate the information that is posted in thread subjects.
Edited by: hoek on May 5, 2010 9:24 PM -
How to add a formula column in a report
Hi
I have made a report based on a query.
There are 3 columns in the query and all the 3 are displayed.
Now I want to add a new column (fomula column) to the report.
I want to write a query inside the formula column. To execute the query col1, col2 and col3 values are required in the formula column.
Could you please tell me how to add a formula column in the report and how to pass database column value to inside the formula column
regardsHere is how you would create a formula column:
Open data model of the report.
Formula column button is on the left side of the tool palette.
Click on that button.
Now click in the query group where you want to place the formula column.
You would see a new field something like CF_1. That is the formula column.
Double click on the field CF_1. It will open property inspector.
You would see, Datatype of the formula column is Number. Change this as per your requirement.
Double click on PL/SQL Formula property. It would open up a editor. Here you can write the code.
And now to access the data model column here, you can use : and column name. i.e. :col1 or :col2, etc
And remember you have to return the value back to the formula column. Like this: RETURN(some value).
You can also take a help from here:
http://download.oracle.com/docs/html/B13895_01/orbr_howto.htm#sthref1309
Hope this helps. -
Howto use formula columns in matrix reports
Hello
How can i use a formula column in matrix report whose function would be
Formula_Column_Result=A-B where A=Cell A
B =Cell B
Regards
FahadHii guys
I solved my problem on my own.
i wrote
SELECT * FROM EMP WHERE EMP.DEPTNO=P_DEPT_NO
and it worked.
Thanks guys..i luv this forum
Regards
Fahad Hameed -
Scope of a placeholder column in Oracle Reports 6i
Hello,
I was under the impression that a placeholder was more like a global variable, i.e., it's accessible throughout the report if defined independently, outside of any group in the layout model?
Well, I am getting this error:
REP-1248 all source columns of placeholder must be in the same group.
Is my understanding incorrect? I really need to have a "global" type variable that's accessible across all groups in the report. How shall I go about it? Please advise.
Regards,
SmitaThanks, but the link didn't help me. Basically, this is the situation:
First, I have a placeholder column independent of any group in the report, which I am trying to access and use as a global variable across multiple groups in the report.
There is a parent group with two child groups. The first child group has a summary columm. I assign the summary column's value to the placeholder column inside a formula column.
In the second child group I decrement the placeholder column's value by one for every record processed in this group inside a formula column. When the placeholder column's value reaches 0, I am doing something in the format trigger on the frame associated with the second child group.
...and I get this error:
REP-1248: All source columns of placeholder 'CP_NumLinesLeft' must be in the same group.
So the placeholder column is really not behaving like a global variable. Please advise as to how I should get around this problem. -
Formula Column in Matrix Report (Running Balance)
Hi all. I hope somebody can help me.
I am working on a matrix report using multi-query data models. The report has 2 groups in the horizontal axis and 3 groups in the vertical axis. The intersection is not just a single row but may consist of multiple rows.
My problem is this. I want to create a column in the intersection which is obtained by using a column value from the lowest group in the vertical axis and a summary column obtained from the rows of the intersection.
Here's what my report looks like:
2002 (accross)
2002(down) january february (accross)
January (down) payments balance payments balance
loan #1 10,000 500 9,000 200 8,800
500
loan #2 5,000 100 4,900 200 4,700
February
loan #3 3,500 0 3,500 50 3,450
loan #4 4,200 0 4,200 0 4,200
As you can see, the loans are grouped by month and year. And the payments are grouped for the month and year too.
The data model is :
For Query 1 (Vertical Axis),
1st group - Loan Yr
2nd group - Loan Mo
3rd group - Loan # and amount
For Query 2 (Horizontal Axis)
1st group - Payment Yr
2nd group - Payment Mo
Intersection Group - Payment Amount
My problem actually is how to compute for the running balance of the loan for each month in the horizontal axis. Ive already created a cross product summary to get the running total of the payments made for the month. I tried creating a formula column to for the running balance by subtracting it from the loan amount but i get the error "incompatible frequency"
I hope i have described my problem well and thanks for the helpThe problem is that you're trying to reference dimension columns(loan Amount) in the calculation of matrix cell values. You can only reference other matrix cell values or cross product columns (summary, formula, placeholders) when calculating matrix cell values. Try moving the (loan Amount) column down to the matrix cell - something like:
For Query 1 (Vertical Axis),
1st group - G_LoanYear(LoanYr)
2nd group - G_LoanMonth(LoanMo)
3rd group - G_LoanNumber(Loan#)
For Query 2 (Horizontal Axis)
1st group - G_PaymentYear(PaymentYr)
2nd group - G_PaymentMonth(PaymentMo)
Intersecion /Detail Group - G_Details(PaymentAmount, LoanAmount)
Then create the following Matrix summary columns:
A running summary - CS_Payments:
- Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
- Source: PaymentAmount
- Function: Sum
- Reset At: G_LoanNumber
The total amount per loan - CS_TotalPayment:
- Product Order: G_LoanYear G_LoanMonth G_LoanNumber
- Source: LoanAmount
- Function: First
- Reset At: G_LoanNumber
The value of the loan after each payment - CF_Countdown:
- Product Order: G_LoanYear G_LoanMonth G_LoanNumber G_PaymentYear G_PaymentMonth
- PL/SQL Formula:
function CF_CountdownFormula return Number is
begin
return(:CS_TotalPayment - :CS_Payments);
end;
You should then be able to display "CF_Payments" and "CF_Countdown" in the matrix cell to show how much has been paid and how much is still owed.
You can still have another "loan amount" as a dimension column - you just don't need to use it when calculating the values in the cell. -
Hi all
i have create one formula column it work properly
my problem is it display the result in rectangle box
i don't wont that box.
how can i do this
please help me.
thanks.Its easy. Just click on that box & select no line in tool pallet.
Hope it 'll work for u.
Capri ! -
Trying to use formula column with an nvl. The problem is that if the record is not there the nvl will not work. How do I force the formula column to return something when the record is not there. Below is the formula.
function CF_1FORMULA0028 return Char is
myComments varchar(50);
begin
select nvl(erActRelData.VALUE,'') into myComments
from dpss_gdats.er_activity eractivity,
dpss_gdats.er_activity_relevant_data erActRelData,
dpss_gdats.er_activity_rel_data_name erActRelDataName
where eractivity.er_case_id = :case_number
and eractivity.date_created is not null
and eractivity.ER_ACTIVITY_ID = erActRelData.ER_ACTIVITY_ID
and erActRelData.ER_ACTIVITY_REL_DATA_NAME_ID = erActRelDataName.ER_ACTIVITY_REL_DATA_NAME_ID
and erActRelDataName.NAME = 'Comments';
return myComments;
end;Modify the last statement to
return nvl(myComments,'Null Value'); -
How I can Fixed Length of Formula Column
Dear All
I have create a formula column in ORACLE REPORT 6i
it consist on 15 length but problem is that formula column return output in this form
123354,000,00
But I want my formula Column return output just like this
123354,000,00
Column values fixed in line Length
Regard
Muhammad NasirHi
I think you are trying to get a proper format of your output on your report.
I will try to help you based on this assumption.
1) Select the field from paper layout
2) Select Format -> Justify -> Right from the menue. -
Formula Column in Report template
I have a report template to use in all the report. I want to have a formula column on it to take a control value(location/Organization) where the report is being printing. Is it possible to have a formula column in a report template? if it possible how can I do it? otherwise how can i achieve this task?
Thank in advance
Muza.What is the application release?
Can you find any details about the error in the OPP log file?
Please search MOS website for "Cannot view XML input using XSL style sheet" and go through the docs.
Thanks,
Hussein -
Formula Column in Discoverer!!!!!
Hi,
Is there any object in discoverer like formaula column of ORACLE REPORTS to store the value?
waiting for reply in detail
bye
santoshHi Chris
That would make sense. As with most things Discoverer when a workbook is saved just about all of the variables are saved with it. You may well have to rebuild the workbooks.
Before doing that though try opening one of the offending workbooks and resaving it. You should then exit Discoverer, reconnect and reopen the workbook. If this results in the correct output then voila - eureka no problem. If it doesn't then a rebuild of the workbook looks like your only option.
Best wishes
Michael -
Is this Oracle Reports bug – "break order property" in "group above" report
Is this Oracle Reports bug – “break order property” in "group above" report
Could anybody confirm that in "group above" report, we could only order the brake column's values with ""none" or "ascending" or "descending" provided by "break order property"?
In the following example, “Dept” is brake column. Oracle Reports allows us to order values in “Dept” with “descending” provided by “break order property”:
Dept 30
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 20
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 10
job ename salary
xxx xxx xxx
xxx xxx xxx
or “ascending” provided by “break order property”:
Dept 10
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 20
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 30
job ename salary
xxx xxx xxx
xxx xxx xxx
I need to do:
Dept 20
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 10
job ename salary
xxx xxx xxx
xxx xxx xxx
Dept 30
job ename salary
xxx xxx xxx
xxx xxx xxx
Could I do this? Could anybody confirm that we could never ever do this, or If yes, how?
Millions of thanks for advice.
M.Z.
Edited by: jielan on Sep 18, 2010 8:23 AMWhy should that be a bug? You have a custom requirement and have to find a way to fulfill it. But, what is your actual sorting order? Do you have only this three departments? If so, you could add an addtional column in your query like
DECODE(DEPT, 20, 1, 10, 2, 30, 3, 4) SORTINGput that column in the same group as dept and sort after that new column. -
Using the 'LOG' Function in a Formula Column
If I write the following SQL statement at the SQL prompt, it works :
SELECT LOG(sal,10) FROM emp ; But, if I write a similar statement in the formula column of a report, then it does not work :
SELECT LOG(sal,10)
INTO x_variable
FROM emp
WHERE empno = :empno ;
return (TRUE) ;
It would be great if someone can help.Try This..
In the formula columns pl/sql place the following:
function cf_1Formula return number is
num number;
begin
num := log(sal, 10);
return ( num );
end;
-- cf_1 is the formula col name
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
If I write the following SQL statement at the SQL prompt, it works :
SELECT LOG(sal,10) FROM emp ; But, if I write a similar statement in the formula column of a report, then it does not work :
SELECT LOG(sal,10)
INTO x_variable
FROM emp
WHERE empno = :empno ;
return (TRUE) ;
It would be great if someone can help. <HR></BLOCKQUOTE>
null -
Hide number (or format number) on Oracle Report with Barcode
Hi al !
i have done a example about print Barcode on Oracle Report
with help link :
[http://download-west.oracle.com/docs/html/B10602_01/orbr_barcode.htm|http://download-west.oracle.com/docs/html/B10602_01/orbr_barcode.htm]
However
I want to hide number under Barcode images or Format number !
Ex:
|||||||||||||| --> images barcode
1234567 --> number barcode
i want : hide : "123456" or format it : "123.456"
Thanks !Hello,
The Image is generated by the java code in oraclebarcode.jar
It is possible to "hide" a part of the image by puting an object ("rectangle" for example ) over the part of the image you want to hide.
Regards -
Dynamic SQL in Formula Column in OracleReports6i
Following code is in formula column of my report. passing dynamic sql str1(actullay, this string comes from after parameter trigger form) into SQL and executing thru DBMS_SQL.PARSE function. it's failed with 'Fatal PL/SQL error occured' ...
Coupld any one help me on this...
function CF_1FORMULA0006 return Number is
Credits1 NUMBER(10,2);
str1 VARCHAR2(50) := 'AND b.PROGRAMID = 2 ';
c1 INTEGER := dbms_sql.open_cursor;
c2 INTEGER;
begin
begin
dbms_sql.parse(c1,
'SELECT NVL(SUM(a.AMOUNT),0) INTO Credits1' | |
'FROM SPONSOR_TRAN_DATA a, SPONSOR b ' | |
' WHERE ' | |
' a.TRANTYPE = 41 ' | |
' AND a.SPONSORID = b.SPONSORID ' | |
str1 | |
'AND a.amount > 0 ' | |
'AND a.timestamp >= :reportdate ' | |
'AND a.timestamp < :reportdate + 1' ,2);
c2 := dbms_sql.execute(c1);
exception
when no_data_found then
Credits1 := 0;
end;
return Credits1;
end;
Thanks in advance......It looks like forms are not supporting text functions like FR yet, I gave it a try <<MemberName("<Formname>","<POV DIM Name>)>> in the formula header area and it didn't like it. It is just displaying what ever I typed in there.
Maybe you are looking for
-
JProgressBar inside JDialogBox doesn't show up.
Hi, I have a problem and kind of stuck. Here is the scenario..... Inside my actionPerformed method I create an instance of a class that extends java.lang.Thread and inside this class run method I create an instance of another class that extends JDial
-
Password hint required in password reset through console
We are using OID to handle our user database. One of the problems we are having is that the forgot password feature through the Oracle Identity Management Provisioning Console doesn't really enforce required fields for password reset. I currently hav
-
Why cann't setText to a JTextField??
Need your help! I produce an array of JTextField and add it to a JPanel. But I can only set text when initialized. In other place,even I call setText function, it doesn't work. Who know the reason?? thanks in advance!! hgs.
-
Blast from the past: How do I draw image maps in Dreamweaver CC 2014?
Need to update some old stuff, and can´t find where to draw image-maps on images.
-
I have tried to turn Match off and on several times on both the computer (iTunes 12.1.0.50) and iPhone 6 (64 GB). It syncs correctly to my laptop, but not to iPhone 6 or 2nd Gen iPad (64GB) both running IOS 8.1.3. This seemed to work fine prior to