Formula column in forms property
Hi All
I have a table
SQL> desc sale_order_detail;
Name Null? Type
ID NUMBER
PROD_ID VARCHAR2(20)
STYLE VARCHAR2(100)
COLOR VARCHAR2(20)
XS NUMBER
S NUMBER
M NUMBER
L NUMBER
XL NUMBER
PCS NUMBER
TOTAL_QTY NUMBER
COMMENTS VARCHAR2(100)
GRAND_TOTAL NUMBER
PRICE_TOTAL NUMBER
DISCOUNT_PRICE NUMBER
TOTAL_PRICE NUMBER
PRICE NUMBERi have a non database item on form with the name of total
and calculation mode of this field is formula and formula is
:sale_order_detail.s + :sale_order_detail.l + :sale_order_detail.m + :sale_order_detail.xl +:sale_order_detail.xs+:sale_order_detail.pcs
And a trigger on block level pre-insert the code is
:sale_order_detail.TOTAL_qty:=:sale_order_detail.TOTAL;
when i take two style with different color but same prod_id it will calculate both but when i store it or you can say save then in the database only one prod_id data is calculate and store in database
like
PROD_ID COLOR TOTAL_QTY
80031 CHAMPANE 2
80020 GREEN 2
80025 KHAKI 2
50015 DARK RULTI 2
50014 STEEL GREY 0
50014 NEW BLUE 1
50029 CHOCO 0
50029 MILITARY 1
50011 CHOCO 1
50011 STEEL GREY 1
80018 BLUE 2Please guide where i am wrong
Thanks And Regards
Vikas Singhal
hi
you can just see the above given data there is a filed total_qty there are two rows showing 0 why it happens i dont understand because i wrote same as for others. all were showng what my input but when the prod_id repeats then it was not taken the total_qty it wll show me 0
Please Guide
Thanks And Regards
Vikas Snghal
Similar Messages
-
Suppress Missing Data not work in web form with formula column inside
Dear All,
I've a planning web form with formula column inside to calculate the variance and % variance. But missing cell can't be suppressed, although I've checked the 'Suppress Missing Blocks' and 'Suppress Missing Data' options.
Anyone have face the same problem..?? and how to fixed it..??
thanks.
Regards,
VieNThere is a known issue that sounds like the problem you are experiencing
10358200 - If a formula column exists in a data form, selecting the Suppress missing option does not hide rows that do not contain data.
Cheers
John
http://john-goodwin.blogspot.com/ -
Form Layout Formula Column Bar
Dear All,
Need help to create a formula column in the data form. I need to sum amount from january to september in the formula column. I'm unable to figure out the syntax.
here is the scenario,
I have column A in which I have 3 Dimension i.e. Headcount, Year, Months. I need to sum values of months from january to september.
Head Count
FY13
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Branch Managers 2 2 2 2 2 2 2 2 2 2 2 2
Your help will be highly appreciated.
ThanksUnless you have the periods explicitly stated in the webform design, im not sure it is possible to sum up just certain periods from one column (im assuming you have selected periods as ILvl0Descendants("Time") or similar).
Someone else may be able to shed further light on this...but as far as im aware you can only reference columns or rows (in terms of [A] or [1]) within dataform formulas.
JB -
Formula column value not updating in table?
Hi all,
I create the sample for master/detail form. In detail for prdcode,rate,qty,amount is there. When select prdcode it fetching prdcode,rate in a record and if you type the qty the amout will come based on formula(property) :qty*:rate.
It is available on screen. But when i store the data, in backend table the amount is be a null.
What is the problem.
Help me in this regards,
kanishHi kanish
Regarding Nul...
-u have to make sure that the formula is working fine and displaying the result in the form screen
-then the item u r storing MUST be a db item >yes and has a column name
-first of all select Help > display_error in the forms runtime may a db item error arais and the record is not correctly saved as u imagined.
u have 2 choices for the solution , i had both before may be it's not very cute but it will work...
1. In when-validate-item Trigger or related item triggers pls follow
SELECT Nvl(( :qty*:rate ) ,0)
INTO :UR_ITEM
FROM DUAL;2.In Pre-Update,Pre-Insert & Pre-Delete Triggers Pls assign the result of ur formula column to the item u want to calc as supposing u r doing the calc of formula in non-db item , then put the following in triggers mentioned ...
: item_name :=:qty*:rate;Hope this helps...
Regards,
Amatu Allah. -
Hi all!
I am using Report Builder 6i.
My report has several Groups (shown below)(that are user created, ie. not created due to the query).
Group_Organiser1
------Group_Organiser2
------------Group_Organiser3
-------------------Group_Organiser4
I have a Formula Column(FC) in Group_Organiser1. I want this FC to be executed only once, regardless of the number of rows included in/by the group. Hence, i want the FC to execute only when the value for Organiser1 changes (Eg. if there are 4 rows with Organiser1 = O1 and another 3 rows with Organiser1 = O2, I want the FC to execute only once when value changes from O1 to O2).
Currently the FC executes each time a row (that meets the grouping criteria, ie. 4 times for O1) is included in the group.
Hope this is enough information to solve this problem.
Eagerly waiting for any response...
Thank You.
Message was edited by:
OneThanx Aguero for your reply but sorry to say it does not solve my problem.
I really need to control the number of times the FC executes because if it executes too early (or too often) it does not count all the people below Organiser1, hence i need it to execute just before the value for Organiser1 changes.
This is my 'program logic' for the FC:
-depending on who(hence designation) is retrieved below Organiser1, increment the User Parameters(UP) :AC, :DC, :MOMM etc (which indicate/represent the various designations).
-then when Organiser1 is about to change, using the non-zero UP return an output of the form "AC: 1, DC: 3, MOMM: 2"; and also reset the UPs to 0 (zero).
So, you can see that if the FC executes too early (or too often), the UPs are reset too early.
To give an analogy, my requirement (for the FC) is similar to 'Reset At' property of Summary Columns; my FC needs to Reset At/Execute only when Organiser1 changes.
(Another problem with what Aguero has suggested is that Organiser1 values are retrieved from the database so i have no way of knowing who is going to be retrieved.)
Thank You. -
Formula column and database item yes
Hi,
i have a master detail form where one column of master block is formula column as well as its database item property is set to yes , i want the column value to be save in the database,
what should i do
using Forms 6i,
Regards,Hi,
You cannot use a formula column as a database item. It won't save to the database. Use another item for calculated item, and then in the PRE-INSERT or PRE-UPDATE trigger, assign the value of the calculated item to the database item.
Regards,
Manu.
If my response or the response of another was helpful, please mark it accordingly -
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. -
Formula Column in Report 9i Builder
Hi,
I use this configuration
Report Builder 9.2.0.1.0
Windows XP Service Pack 1
NLS_LANG "BRAZILIAN PORTUGUESE_BRAZIL.WE8ISO8859P1"
When I try to create a formula column that returns number, I have to choose datatype 'Nu'mero' (with accented u)as this is the only avaiable in the combo box. However when I write this PL/SQL code for the column:
function CF_17Formula return Number is
begin
RETURN(1);
end;
Reports gives me the message:
REP-0737: Deve ser uma funcao com retorno do tipo 'nu'mero'.
In English this message could be
REP-0737: Should be a function with return type 'nu'mero'.
I don't have this problem with Character or Date formula columns (these datatypes are called Caracter and Data in Portuguese).
It seems that Reports is having problems with u' (accented u) character. If I change NLS_LANG to AMERICAN_AMERICA.WE8ISO8859P1 everything works fine because I can choose Number in the Formula Column Datatype in the Property Inspector.
The problem is in the function declaration not in the Return statement.
Could anyone help me? Tks.
EdmarEdmar,
You are right. I could reproduce this issue.
I have filed a bug to fix it from the development in next patch
Thanks
The Oracle Reports Team -
Formula column help needed(urgent)
Hi ,
I am using the data template for generating XML data.
BIP provided functions like SUM(), AVG(), COUNT(), MAX(), etc to use as
below
<group name="G_DEPT" source="Q1">
<element name="DEPT_NUMBER" value="DEPTNO" />
<element name="DEPTSAL" value="G_EMP.SALARY" function="SUM()"/>
<group name="G_EMP" source="Q2">
<element name="EMPLOYEE_NUMBER" value="EMPNO" />
<element name="NAME" value="ENAME"/>
<element name="JOB" value="JOB" />
<element name="SALARY" value="SAL"/>
</group>
</group>
but suppose if I want to do a sum like
Sum(ALLdebits - All credits - All refunds).
We use to have formula good old formula column. like in ORACLE Reports...
below is my query in the data template....can someone please suggest?
<dataTemplate name="R007" dataSourceRef="xyz">
<properties>
<property name="include_rowsettag" value="false"/>
<property name="include_rowtag" value="false"/>
<property name="xml_tag_case" value="as_are"/>
</properties>
<parameters include_in_output="false">
<parameter name="DATE_FROM" dataType="varchar2" include_in_output="false"/>
<parameter name="DATE_TO" dataType="varchar2" include_in_output="false"/>
<parameter name="BANK_GIRO_NUMBER" dataType="varchar2" include_in_output="false"/>
</parameters>
<dataQuery>
<sqlstatement name="Q1">
<![CDATA[SELECT
DISTINCT
SYSDATE todayDate
,substr(trim(CR_BG_NO),3,8) creditorBGNumber
,CREDITOR_SHORT_NAME creditorName
,COUNT(*) itemCount
FROM
R00777_REPORT R1
WHERE
R1.TXN_DATE BETWEEN TO_DATE(:DATE_FROM,'YYYY-MM-DD') AND TO_DATE(:DATE_TO,'YYYY-MM-DD') AND
R1.CR_BG_NO = :BANK_GIRO_NUMBER
GROUP BY
substr(trim(CR_BG_NO),3,8)
,CREDITOR_SHORT_NAME]]>
</sqlstatement>
<sqlstatement name="Q2">
<![CDATA[
SELECT
TXN_DATE
,substr(trim(CR_BG_NO),3,8)
,PAYMENT_TYPE
,TXN_SERIAL_NO
,decode(PAYMENT_TYPE,'AGDEBIT_TRANSFER',DR_TXN_AMOUNT,'AG_REFUND',-RE_TXN_AMOUNT,'AGCREDIT_TRANSFER',-CR_TXN_AMOUNT)
SIGN_AMOUNT
FROM
R00777_REPORT R2
WHERE
R2.TXN_DATE BETWEEN TO_DATE(:DATE_FROM,'YYYY-MM-DD') AND TO_DATE(:DATE_TO,'YYYY-MM-DD')
AND R2.CR_BG_NO = :BANK_GIRO_NUMBER
]]>
</sqlstatement>
</dataQuery>
<dataStructure>
<group name="response" source="Q1">
<group name="head" source="Q1">
<element name="itemCount" value="itemCount"/>
<element name="todayDate" value="todayDate"/>
<element name="creditorBGNumber" value="creditorBGNumber"/>
<element name="creditorName" value="creditorName"/>
</group>
<group name="list" source="Q2">
<group name="listItem" source="Q2">
<element name="transactionDate" value="TXN_DATE"/>
<group name="transactions" source="Q2">
<group name="transaction" source="Q2">
<element name="transactionType" value="PAYMENT_TYPE"/>
<element name="serialNumber" value="TXN_SERIAL_NO"/>
<element name="amount" value="SIGN_AMOUNT"/>
</group>
</group>
<element name="netSum" value="transaction.SIGN_AMOUNT" function="SUM()"/>
</group>
</group>
</group>
</dataStructure>
</dataTemplate>Hi Rainer,
Many Thanks for your reply
I had done all the calculations in the report view earlier
and when i accessed it in the data template as follows
<element name="netSum" value="netSum" />
the xml output that i got was like
<R007>
<response>
<head>
<itemCount>8</itemCount>
<todayDate>2009-02-05T15:50:12.000+01:00</todayDate>
<creditorBGNumber>01829209</creditorBGNumber>
<creditorName>ANDROMEDA</creditorName>
</head>
<list>
<listItem>
<transactionDate>2008-09-03T00:00:00.000+02:00</transactionDate>
<netSum>-6647999</netSum>
<transactions>
<transaction>
<transactionType>AGCREDIT_TRANSFER</transactionType>
<serialNumber>5</serialNumber>
<amount>-1687200</amount>
</transaction>
</transactions>
</listItem>
</list>
</response>
</R007>
But the output that i want is something like this
<R007>
<response>
<head>
<itemCount>8</itemCount>
<todayDate>2009-02-05T15:50:12.000+01:00</todayDate>
<creditorBGNumber>01829209</creditorBGNumber>
<creditorName>ANDROMEDA</creditorName>
</head>
<list>
<listItem>
<transactionDate>2008-09-03T00:00:00.000+02:00</transactionDate>
<transactions>
<transaction>
<transactionType>AGCREDIT_TRANSFER</transactionType>
<serialNumber>5</serialNumber>
<amount>-1687200</amount>
</transaction>
</transactions>
<netSum>-6647999</netSum>
</listItem>
</list>
</response>
</R007>
Hence I used the BIP built in template function like this
<element name="netSum" value="transaction.SIGN_AMOUNT" function="SUM()"/>
but the sum() function is adding up all amounts as expexted,I want
the above newsum value as
Sum(AGdebit-AGCREDIT-AG_refund). -
How to use a Formula Column in the main query?
Hi All,
I've tried to use a formula columns defined in some query in the condition of that query like this:
where (:cf_ex - :cf_ex2) >= 5
but when I run the report no data returned! Why? and how to use it the condition of the query?
Note: I'm using Forms 6iwhere (:cf_ex - :cf_ex2) >= 5You cannot do that. Formula columns are not part of the select statement (which runs in the database), but are processed in the report.
When you created this query, my guess is that you got the message "Note: the query Q1 has created the bind parameter(s) cf_ex, cf_ex2". Check these User Parameters in your data model. So, you are actually referencing user parameters in the query, not formula columns.
I made a computations and things using PL/SQL that can't be done in the select statement in the data model!If it's pl/sql you can probably use that in your query. Create some database functions for cf_ex and cf_ex2 and use these in your query. -
URL defined in formula column not converting as proper HTML tags
We are migrating a report to 10Gr2 (10.1.2.0.2) from reports 9i (9.0.2.03); This report has to route to a different web page. For this we have a formula column with meta tag call to refresh;its Contains HTM property set to Yes. But when run, the view source of HTML shows as if the tag is truncated and put in <tt> tag around it.
Any help on this is very much appreciated.Hi svee,
Thanks for the reply.
For an example i tried with the bold option in the edit formula inorder to portray the html tags problem while exporting it to the pdf inspite of using the default bold option within the column properites like u said.
Suppose if i used html tags like
<br>, </br>
in the edit formula section or if i used any other html tags which is not present as a default option in bi like bold. At that time while exporting the report to pdf i can face the issue.
And also i need ur suggestion regarding with the values disappearing for the numeric column if a tooltip is used in it while exporting it to the pdf.
Regards,
Saro -
Dynamic name in formula column header
Greetings, i have a question - is it possible to create dynamic header of formula column?
For example - year on the form is 2012? in the header i want something like ratio "current year picked from forms year" to "current year -1", i.e. ratio 2012 to 2011
Is it possible?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.
-
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.
-
Hi All....
Hope all had a good weekend......any way
how can i order my results in a report using the formula column
the problem is that i have a query which give me one column(group by) and from the column i'm linking some othe formula column ....and i want to order my report using the formula columns....
Looking forward to hear from you guys.....
Se yahai,
i think u r using formula column in your report.then you can give
break order for this column in the property palete.
bye -
Hi All,
I have a formula column and I want to display this formula column as paramter in the report.
Kindly help...
Thanks..user12058432 wrote:
Thanks for the reply..
Actually I have a computed value i.e., formula coumn and this should appear as a parameter so that the records can be filtered based on
this value..
Thanks..use before parameter trigger
do your computation there
pass the computed value to a parameter
so that your parameter get value when parameter form appears
Maybe you are looking for
-
My Note 4 is slow to download apps, sometimes won't at all.
Since I bought my Note 4, it has been slow to download apps... usually it is so slow it won't finish at all. I usually show 4G and three or four bars. When at home and connected to my wireless router, there is no difference. In fact, sometimes it
-
Error: java.lang.nullPointerException when process is complete
Hello, I keep getting the below error in the log file when the process is complete, does any one has this error before? The error does not affect the process but it is kind of annoying when looking at the log file. I try to use the other component
-
Play Sound Rule Acting Backwards
Hi, I've created a Mail rule that my MPB should play a sound when From is my wife's email address. However, incoming mail from her does not play the sound. The odder thing is that when I email her -- which is to say when mail goes out -- the sound pl
-
Pacman -Syu - show which repo the updates are in + current versions?
Hi, I couldn't find a way (other then write shell script workarounds ;-) ) to show this additional information: - the repository the update is in - the current installed version of the package dieter@dieter-ws ~ $sudo pacman -Syu Targets (4): abiword
-
How to tell which version of 1130AP
The Aironet 1130AG Series is available in: A lightweight version An autonomous version that can be field-upgraded to lightweight operation A single-band 802.11g version for use in regulatory domains that do not allow 802.11a/5 GHz operation Is this f