Column dynamically calculates the records entered
Hi all,
anyone could pls help with placing a column in oaf creates page which calculates the no of records entered and updated automatically.
Ok,
There are couple of ways in which you can achieve this. The one i can think of right now is,
Create a transaction variable when the page loads and name it as v_count. When ever a row is updated, increase the count of this variable. Once the page is submitted, release the transaction variable value.
So as long as the page is active, you can keep track of the value in that variable v_count .
Regards
Pavan , K
Similar Messages
-
How to create some columns dynamically in the report designer depending upon the input selection
Post Author: ekta
CA Forum: Crystal Reports
how to create some columns dynamically in the report designer depending upon the input selection
how export this dynamic report in (pdf , xls,doc and rtf format)
report format is as below:
Element Codes
1
16
14
11
19
10
2
3
Employee nos.
Employee Name
Normal
RDO
WC
Breveavement
LWOP
Sick
Carers leave
AL
O/T 1.5
O/T 2.0
Total Hours
000004
PHAN , Hanh Huynh
68.40
7.60
76.00
000010
I , Jungue
68.40
7.60
2.00
5.00
76.00
000022
GARFINKEL , Hersch
66.30
7.60
2.10
76.00
In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
Can anybody help me how do I design such report....
ThanksHi Developer life,
According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric values) in the details, add an filter to filter the data base on this column group, but if
the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
Similar threads with details steps for your reference:
https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings
If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
Any question, please feel free to let me know.
Best Regards
Vicky Liu -
How to spilt columns dynamically in the report based on Date Parameters
Hi All,
We have an XML Publisher report in which the parameters are Fom date and To date.
User wants the data in the report to be split dynamically based on the months in the From date and To date interval.
Eg. if the From date is 01-JAN-2013 and To date is '31-MAR-2013' then the report should show 3 columns JAN,FEB and MAR and the corresponding data.
if the From date is 01-JAN-2013 and To date is '31-MAY-2013' then the report should show 5 columns JAN,FEB,MAR,APR and MAY and the corresponding data.
Can anyone please advise, how can we spilt the months and data dynamically in the report.
Regards,
Shrutiwell you wanted the columns to be added dynamically. the easiest way would be to use a Pivot since the columns are based on the values in the data. and if the values of that column are Month Name/Abbreviation for that date then you will get month columns.
Have you worked with Pivots before? -
A column that counts the records......need some help
say i have a table with values {a, b, c, d, f};
i want a column that counts the rows of these records with out putting the value manually.
COL1 COL2
0 a
1 b
2 c
3 d
4 f
I have created a data block (wizard) for inserting the values into the table. But i want it to insert the values in COL1 automatically. Seems easy but i dont seem to be able to figure this out...with tab1 as
(select 'a' col2 from dual
union all
select 'b' col2 from dual
union all
select 'c' col2 from dual
union all
select 'd' col2 from dual
union all
select 'f' col2 from dual
-- End of test data
select rownum - 1 col1, col2 from
(select col2 from tab1 order by col2)
COL1 COL2
0 a
1 b
2 c
3 d
4 f Regards
Dmytro -
Report painter-want to hide period columns dynamically if the period is not closed
Hi All,
I have made report with 12 columns like JAN, FEB till DEC in report painter (GRR1)
Requirement is that if say, currently only period no.4(APR) is closed and we are in period no.5( MAY) or system date is in MAY, then the report should not show the data for the current period no.5(MAY), eventhough data is there. Or else it should show data for JAN to APR (closed periods)
For this I defined 12 different period formula variables in GS11, based on system paramters like
S008 Year (from Local System Date)
S002 Month (from Local System Date)
S003 Day of Month (from Local System Date)
S012 Current Period in Current Year (per CO Fiscal Yea
But the issue is that eventhough the variable is defined as formula variables, still the default values are given by system and default value only getting passed to the report and thus data is displayed for the unclosed period.
But SAP help says that formula variables are without default values unlike the value type variable.
Any help in this will be highly appreciated.Hi All,
I have cracked it and got the solution with redefining the formula variables.
Details
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
No.of days in each Month
31
28
31
30
31
30
31
31
30
31
30
day number in year
31
59
90
120
151
181
212
243
273
304
334
result available after 15 days
47
75
106
136
167
197
228
259
289
320
350
Formula variable definition for 11 months in current year
ZTPFR01
ZTPFR02
ZTPFR03
ZTPFR04
ZTPFR05
ZTPFR06
ZTPFR07
ZTPFR08
ZTPFR09
ZTPFR10
ZTPFR11
IF '#S005' <47
IF '#S005' <75
IF '#S005' <106
IF '#S005' <136
IF '#S005' <167
IF '#S005' <197
IF '#S005' <228
IF '#S005' <259
IF '#S005' <289
IF '#S005' <320
IF '#S005' <350
THEN 1
THEN 2
THEN 3
THEN 4
THEN 5
THEN 6
THEN 7
THEN 8
THEN 9
THEN 10
THEN 11
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0
ELSE 0 -
Dynamically calculate the value
Dear all,
Hope you are well.
i am in need a feature in OAF pages.
suppose i have fields like advance_amount,total_amount,return_amount,amount_to_be_taken
when employee log in this page advance_amount will automatically loaded and based on input of total_amount other
fields amount will be calculated and shown dynamically.
how can i activate this feature.
please suggest.Hi,
Here is the code:
CO PFR:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if("TextinputEvent".equals(pageContext.getParameter(EVENT_PARAM)))
if(pageContext.getParameter("TextInputID")!=null)
String Text1=pageContext.getParameter("TextInputID").toString();
---Do the calucaltion and fetch into String Text2...
String Text2=Text1;
OAMessageStyledTextBean Bean=(OAMessageStyledTextBean)webBean.findChildRecursive("Text2");
Bean.setValue(pageContext,Text2);
Regards
Meher Irk -
How to calculate the Percent change in a dynamic
hi All,
I'm trying to get the percent increase/change of two dynamic
colums. In my report, the user has a checkbox where he can select two colums to calculate the percent growth.
My DataSet is PilarName, Calification(is a decimal value) and Period (this is a string). I created the Matrix this way:
PilarName [Period]
[PilarName] [Calification]
Which give me these values:
So, now I need to create another column to calculate the percentage change between these two colums. I tried this:
I added a Adjacent column group for Period column and I grouped by the calculated column "ColumnDiff". Add the following expression.
=(SUM(Fields!Calificacion.Value)- Previous(SUM(Fields!Calificacion.Value),"ColumnDiff"))/Previous(SUM(Fields!Calificacion.Value),"ColumnDiff")
After that I get:
I'm getting the sum of the two columns instead.
Any clue about what I'm doing wrong? Please help me, I've been looking for the answer but any solution works for me.
Luis CarlosHi Luis,
According to your description, you have a report with different dynamic columns. Now what you want is show your user percentage growth in your matrix report after your user select two of those columns (I think you may use parameter to achieve your “checkbox”
function). Is my understanding correct?
In Reporting Service, we can’t calculate dynamic columns with our build-in arrogation functions. So we need to add custom code into our report, and call those functions which defined in custom code in our expression. We have tested your scenario in our local
environment. Here are steps and screenshots for your reference.
Go to your Report Properties, add the custom code below into your report:
Dim Shared Num1 As Double
Dim shared Num2 As Double
Public Function GetCalification(Calification as Double,Type as String,Type2 as String)
If Type = Type2 Then
Num1=Calification
Else
Num2=Calification
End If
Return Calification
End Function
Public Function GetPec()
Return (Num2-Num1)/Num1
End function
Create a matrix. Put PilarName into Row field, put Period into Column field. In Data field, put the expression below into the textbox:
=Code.GetCalification(Fields!Calification.Value,Fields!Period.Value,Parameters!Period.Value(0))
In our sample report, we created a parameter (named Period) for selecting two columns. You can replace “Parameters!Period.Value(0)” with your own parameter.
Add an outside column at right (%Growth), put the expression below into the textbox:
=Code.GetPec()
Save and preview. The matrix and result looks like below:
Reference:
Custom Code and Assembly References in Expressions in Report Designer (SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Is there a way to dynamically calculate values for the IN operator?
I am looking to see if there is a way to dynamically calculate the criteria to include inside an IN operator in the WHERE clause. For example when I try to run the following I get an Oracle error message 'OR!-01722: invalid number'. The script below is just an example to help illistrate the problem, I do not want to hardcode the values assigned to v_test directly within the IN operator becasue the values in v_test will change from user to user.
DECLARE
v_test VARCHAR2(10) := '1,15,25,55';
v_tmp VARCHAR2(50) := NULL;
BEGIN
SELECT d.metric_title INTO v_tmp FROM tbl_health_metric_definition d
WHERE d.metric_status = 'Active' AND d.metric_id IN (v_test);
END;Hi Jason,
When ever you use IN operator your values should be either seperated by a comma. If the column is of type number then your values should not enclosed in single quotes.
Eg: Wrong - '1,2,3,4,5'
Correct - 1,2,3,4,5
If your column is of type varchar then your values should be seperated by a comma and each value should be enclosed in single quotes.
Eg : Wrong - '1,2,3,4,5'
Correct - '1','2','3','4','5'
Correct - 'sam','boy','girl'
So correct you query so that the values in the IN operator are with out single quotes.
DONOT USE IN OPERATOR IN PL/SQL BLOCK WITH OUT A CURSOR._
If you use IN Operator and fire a query with out a cursor, it throws an error multiple rows returned. If at all you want to use in operator then use cursor.
Regards,
Rajesh
Edited by: Rajesh Gudipati on Jun 23, 2009 9:49 PM -
How to caculate the records count for a measurement with a filter?
I have a fact table which add relationship to a datetime dimension. I create a measurement based on the fact table, like [MeasureA]. I want to calculate the record counts of [measureA] of today, how to write the mdx query? Thanks!
Hi Lavandula,
According to your description, you want to calculate the numbers of the record of a measure for a specific day, right? In this case, you can use
Count function which returns the number of cells in a set to achieve you requirement. Here is a sample query on Adventure Works for your reference.
WITH
MEMBER [Measures].[SetCount] AS
COUNT([Product].[Product].[Product].Members)
SELECT
{[Measures].[SetCount]} ON COLUMNS
FROM
[Adventure Works]
Besides, if you want to count the cell numbers with a condition, you can use
Filter funtion inside the Count function.
WITH MEMBER [Measures].[High Volume Products Count] AS
Count(Filter([Product].[Product].[Product], [Measures].[Internet Order Quantity] > 5))
SELECT [Customer].[Customer Geography].[Country] ON 0
, [Date].[Calendar].[Date].MEMBERS ON 1
FROM [Adventure Works]
WHERE [Measures].[High Volume Products Count]
Regards,
Charlie Liao
TechNet Community Support -
Displaying Columns dynamically
Hi,
My reqiurement is to display n number of columns depending on the month entered
for example
if mar report should show 3 columns
if apr it should show four columns..etc...
How can we possibly hide and display the columns as per user entry.
Kindly provide useful pointers to the same.
Thanks & Regards,
RathyHi,
Number of columns with the forecast values are to be from Forecast 1&2 till the month before the chosen selection. In order for us to calculate the variance, you should have 2 forecast values.
If March is chosen please show Forecast 1& 11, Forecast 2&10
If April is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9.
If November is chosen please show Forecast 1& 11, Forecast 2&10, Forecast 3&9, Forecast 4&8, Forecast 5&7 ..Forecast 10&2.
Please guide how can this be achieved.
Regards,
Rathy -
OSB DB Poller deleting the record when there is a failure
Hi All,
My project consists of below OSB services..
DB Poller -> Proxy service A -> Proxy service B
DB Poller is JCA Based and it should delete the polled record after the complete flow is successful. If there is any error in my OSB Proxy services, the record should not be deleted.
Proxy service A calls Proxy service B using routing(static). My Proxy service B is throwing error and the record is getting deleted.
If I change to Dynamic routing the record id not getting deleted and the flow works as expected. The routing option configuration is same for both static and dynamic routing.
The only configuration in my routing option is QOS="Exactly once" .
Can anyone let me know why the record is deleted if I use static routing?
Thanks in advanceIn your scenario record will be deleted as your DB Poller will commit the transaction once the message has been delivered to Proxy Service A.
If you want the message not to be deleted then you must have only the DB Poller proxy include the logic of proxy A and must make a call to proxy B. -
How can I calculate the maximum number of days between two dates in a range of dates?
I have a column of dates spanning the couse of a few months. I would like to know if I can calculate the maximum number of days between each row and display the highest number. I currently have another column that calculates the days betwen the rows and I am currently just looking at the totals and highlighting the highest period.
Is this possible? Any help or suggestions are appreciated.
Thank you,
TrevorThis sounds totally possible, Can you post a screen shot of your table to make responding more focused? If you mean you want to:
A) compute the difference (in days) between two date in the same row, then
B) find the max duration (in days)
Here is my take on this problem:
D2 = C2-B2
select D2 and fill down
F1=MAX(D)
to perform the conditional formatting (to highlight the max duration) select column D, then set up conditional formatting as shown in the 1st image -
Can we change the Record Group Type through Custom.pll
Hello All,
I have a small requirement on Changing the Record Group Dynamically.
Can i set the Record group type to 'Query' from 'Static'. i.e Can i change the Record group type dynamically through custom.pll. I know that we can dynamically change the Record group query.
Please help me its a bit urgent.
Thanks inadvance,
Amarnadh Jsyou can control your record group runtime without create any recordgroup at design time..
1.static group
declare
rg_name VARCHAR2 (40) := 'Global_Rgp_Menu'; --global record group name for menu use
rg_id recordgroup; --global record group id
gc_id groupcolumn; --global record group coulmn id
errcode NUMBER; --error code
grp_row PLS_INTEGER := 0; --global record group row count
begin
rg_id := FIND_GROUP (rg_name);
IF NOT ID_NULL (rg_id)
THEN
DELETE_GROUP_ROW (rg_id, all_rows);
ELSE
rg_id := CREATE_GROUP (rg_name, global_scope);
gc_id := ADD_GROUP_COLUMN (rg_id, 'menu_item', char_column, 100);
gc_id := ADD_GROUP_COLUMN (rg_id, 'p_type', char_column, 100);
gc_id := ADD_GROUP_COLUMN (rg_id, 'p_no', char_column, 100);
END IF;
grp_row := 0;
for 1 in 1..10 loop
grp_row := grp_row + 1;
ADD_GROUP_ROW (rg_id, grp_row);
SET_GROUP_CHAR_CELL (rg_name || '.menu_item', grp_row, 'menu' || to_char(i) );
/*type*/
SET_GROUP_CHAR_CELL (rg_name || '.p_type', grp_row, 'type' || to_char(i) );
/*program_no */
SET_GROUP_CHAR_CELL (rg_name || '.p_no', grp_row, 'programno' || to_char(i) );
end loop;
end;
2. query group
declare
FACT_SQL VARCHAR2(500) :=NULL;
rg_name1 VARCHAR2(40) := 'Global_Rgp_fact';
rg_id1 RecordGroup;
Error_Flag number:=0;
group_error exception;
begin
rg_id1 := Find_Group( rg_name1 ); IF NOT Id_Null(rg_id1) THEN Delete_Group( rg_id1 ); END IF;
FACT_SQL := ' SELECT * FROM MYFACTORY ' ;
rg_id1 := Create_Group_From_Query( rg_name1,FACT_SQL ,global_scope);
Error_Flag := POPULATE_GROUP(rg_id1);
IF Error_Flag <>0 THEN
error_msg:='Error while populating factory group';
raise group_error;
END IF;
exception
when group_error then
message(error_msg);
raise;
end;Edited by: nolemlin on 2010/3/23 上午 7:50 -
I have created Product entity in MDS. It's having the following values:
Name Code Owner
Bike 1 ABC
Car 2 XYZ
Cycle 3 RRR
owner XYZ can change the record of RRR. But if owner XYZ or any other owner in this entity tried to update the ABC's record, access should be denied. That means, no one should have the permission to change the records which are entered by ABC.
For this i have executed this code
CREATE TRIGGER mdm.party_trial_readonly ON mdm.tbl_1042_1278_EN AFTER UPDATE, DELETE AS
IF EXISTS (SELECT * FROM deleted WHERE readonly = 1)
BEGIN
ROLLBACK TRANSACTION
RAISERROR ('Attempt to change a read-only row', 16, 1)
RETURN
END;
After executing this code i couldn't edit any of the records.
Please help me out in this.I have created 2 entities called Party and Owner. Party has following columns (name, Code, Owner (Domain Based Attribute)) Owner has following columns (name, Code) And I have Created one Derived Hierarchy.
From user and Group Permision Section, Hierarchy Members tab I have given read only permision to me (administrator of the Model). When I gave the permision I have selected users and Inherited from group in permission tab. And I'm not the part of any group.
Now I'm not able to see my model except the explorer area. And I'm not able to delete the permission from the user. As per the admin guide we need to delete permission from group.
Though I'm not the part of any group, I'm not able to proceed further to delete the permission.
Please help me out in this regard. Thanks! -
How to update all the record for a particular column in a table based on search criteria.
Hi All,
I am new to ADF. I have a requirement, where i have to perform mass update on a table.
Scenario:
Ex: I have a dept manual search region. where i search with deptId: 20. I get 20 records in my table. now i have another region where i have a inputchoice list which contains all the columns names that exists in dept table. Beside that i have a input text box and an update button
Now user, first searches with dept id:20 and clicks on search button, where it shows 20 record in the table. He then select a column from input choicelist(ex: ManagerId), then enters new value in the input box(ex: abc) then clicks on update button.
Now i want, all the records in the ManagerId column with dept id:20 to be updated with the new value "abc"
Can anyone help me with the code.
Thanks in advance..Hi,
If you go to your VO and generate the ViewObjectImpl, in there you can create a method which will contain two parameters, 1 the attribute name and 2 the value.
Then you can follow something like explained in this post:
ADF Tutorial: How to apply bulk actions to a view object rows
The only difference is that you will need to create a method like this:
public void updateAttribute(String attribute, Integer value){
RowSetIterator iter = createRowSetIterator(null);
while (iter.hasNext()){
Row row = iter.next();
row.setAttribute(attribute, value);
Then you expose that as a client interface and then after you filter your table by your criteria you just need to execute this method passing the right parameters.
Regards
Maybe you are looking for
-
Fan doesn't come on at all but no error messages
I previously had a HP laptop that kept getting a cooling fan error message on startup. I updated the BIOS and tried a few other things suggested by HP support but nothing worked. I ended up ignoring the message, pressing to continue and usually after
-
Mac not connecting to internet
I am having issues getting my mac to connect to the internet via airport extreme wireless. I have a wireless network set-up, my pc's are connected fine, it is a WEP network. However my mac shows that it is connected to the network, but when I open sa
-
Stationery Template - appearance breaks when recipient opens
I've tested several Mail Stationery Templates. They seem to break their formating when I send them to non Mac users (my mother). When I send a test email to myself it looks fine. Any solutions or suggestions? Wish I could attach my mom's reply to sho
-
Integrating Dialog/App server into 4.7 system
We are on SAP R/3 4.7 using Oracle 9.2.0.6 and Solaris 8. To test the performance of a Linux application server on our QA system, we installed Suse Linux 9 on a server and have performed the SAP installation as per the Installation Guide "SAP R/3 Ent
-
We are upgrading EHP 3 on ECC 6.0, but we received the following error:
The installation was stopped, since an error occurred during the phase DDIC_ACTIVATION, which the Add-On Installation Tool is unable to resolve without your input. After you have corrected the cause of the error, continue with the import by choosing