Placeholder column's "initial value"
Hello,
I have a report with 2 queries, the master query contains some placeholder columns, and the detail query contains a formula column that sets values for these placeholders:
- MASTERQUERY: database columns, PlaceHolder1, PlaceHolder2, PlaceHolder3
|
|
-- DETAILQUERY (linked to MASTERQUERY): database columns, CF_PlaceHolder_Changer (change values of PlaceHolderX)
The problem is: for a particular record of MASTERQUERY, if the DETAILQUERY doesn't have any row then PlaceHolders are not set.
(They will keep the values from previous MASTER record). Is there any way that I can specify "initial value" for placeholder columns?
And another question: what is the formula attached to the placeholder used for?
Please help!
You could have a "count" column in the master group that determines how many rows are in the detail group. Then alter the value of the field displaying the placeholder value by adding a format trigger with srw.set_field_char/date/number(0, <initial value>); when the count is '0'.
Similar Messages
-
How do I assign the value of a Boilerplate Text Object to a Placeholder Column?
I have a Boiler plate File Link. This references a .txt file. I want to generate XML tags for it.
Is it possible to read the content of the file link object into a Placeholder column so that I can get a tag generated for that?Hi Frank,
The key is already passed from a previous page. To set the scene a little, I have three pages:
1. Project list, has a table listing all projects.
2. Drill down to tasks for a project, passing the project key as a page property. This is a master/detail page. This currently works well.
3. Create a new task for the project from page 2. I want to pass the project key obtained from page 1 to page 3 via page 2, so that the user does not have to re-select a project when creating a task.
Here is my registrydef from page 2 (the tasks for a project):
<bc4j:rootAppModuleDef name="ProjectModule"
defFullName="ProjectPackage.ProjectModule"
configName="ProjectModuleLocal"
releaseMode="stateful">
<bc4j:viewObjectDef name="ProjectsVO1">
<bc4j:rowDef name="ProjectRow" autoCreate="false" usesCurrency="true">
<bc4j:propertyKey name="key"/>
</bc4j:rowDef>
</bc4j:viewObjectDef>
<bc4j:viewObjectDef name="TasksVO2" rangeSize="20"/>
</bc4j:rootAppModuleDef>
This works well, I can display the selected project and then list the tasks in a table.
My problem is that in page 2 the project record is not in a table, so I cannot use a table selection mechanism to set the key value in the event which calls page 3 (see my earlier post for this code). As the key that I need is sittng there in the URL as a page property, I want to pass that instead. How to I reference it from within an event?
Does this make sense or is there a better way of doing it? Do I actually need a new page to create a new task - I don't think I can add new records in a table!
Thanks for the tip on ctrl: , I'm slowly getting the hang of the namespace thing.
Steve -
Hi,
I'm working on a multilingual report (Dutch, French and English) and I want to have the labels on the report in the correct language based on user selection.
I already know I can achieve this with placeholder columns.
I also know I can set the values for these columns in the beforereport trigger by reading the correct value for each placeholder column from a table.
This works but I have to make a call for every other placeholder column. If I have a report with 30 or more labels this requires 30 calls or more.
If possible I want to retrieve the values and the columns where the values have put into from a table by using a ref cursor or another cursor in the before reports trigger.
There is no problem wrting the code to get the values but there is one to put the values in the columns.
I want to reference the placeholder columns as variables in my code.
e.g.
select report_col, ml_col from report_labels;
wher ml_col is the value and report_col the bname of the palceholder.
thereafter I want to do the assignment as
:CF_ || treport_col = ml_col;
The closest I can get is by using srw_set_field but this works only if the code is put on a trigger on the column itself.
Is there a way to get to the desired result?ANother way of doing this would be to make a seperate query for the label table which just returns a single row with all label values. Now in Reports layout, insert a top most repeating frame which moves on this label query and set all your label using &column_name.
thanks
rohit -
How to generate unique values while initializing values
I am initializing values in my pl/sql program and want to use a sequence to set my unique ids but it errors out. Below is what I use.
ie. table_id := table_seq.nextval;
How can I use my sequence to initialize values or is this possible?The method suggested by user605919 will work. However, you don't need to initialize a variable like this. It is better and more performant to do it like the third example below:
SQL> create table mytable
2 ( id number(6)
3 , description varchar2(30)
4 )
5 /
Tabel is aangemaakt.
SQL> create sequence table_seq start with 1 increment by 1
2 /
Reeks is aangemaakt.
SQL> declare
2 table_id mytable.id%type := table_seq.nextval;
3 begin
4 insert into mytable
5 ( id
6 , description
7 )
8 values
9 ( table_id
10 , 'Some description'
11 );
12 end;
13 /
table_id mytable.id%type := table_seq.nextval;
FOUT in regel 2:
.ORA-06550: line 2, column 41:
PLS-00357: Table,View Or Sequence reference 'TABLE_SEQ.NEXTVAL' not allowed in this context
ORA-06550: line 2, column 12:
PL/SQL: Item ignored
ORA-06550: line 9, column 5:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 9, column 5:
PL/SQL: ORA-00904: "TABLE_ID": invalid identifier
ORA-06550: line 4, column 3:
PL/SQL: SQL Statement ignored
SQL> declare
2 table_id mytable.id%type;
3 begin
4 select table_seq.nextval
5 into table_id
6 from dual
7 ;
8 insert into mytable
9 ( id
10 , description
11 )
12 values
13 ( table_id
14 , 'Some description'
15 );
16 end;
17 /
PL/SQL-procedure is geslaagd.
SQL> begin
2 insert into mytable
3 ( id
4 , description
5 )
6 values
7 ( table_seq.nextval
8 , 'Some description'
9 );
10 end;
11 /
PL/SQL-procedure is geslaagd.And if you need the id value for some code after the insert, you use the RETURNING clause.
Regards,
Rob. -
# instead of initial value in reports
Hi,
I'm trying to solve the following problem: When I create a report in Query Analyzer, in some columns, instead of the initial value(spaces) for some fields, there is the # sign.
Do you know from where does this issue come from? Is there an option inside the query analyzer to suppress this?
Thanks in advance,
George ArdeleanuHi George,
This is the default property of reports in BW. You see # instead of blank values in the data targets.
Are you using WAD (Web Application Designer) in your scenario. If yes, there is a solution to remove these #es from the report output. You just need to add a small html script in the html tab of the WAD.
Regards,
Yogesh -
Need to test if a column have unique values or not
Hi all,
in ETL process I need to check if some cols have unique values or not using sql or plsql.
Suppose we need to load a big file data with external table initially and then test if values
on one or more columns have unique values in order to proceed with ETL process.
What is the faster test I can execute to verify that a column have unique values or not?
It's better for the ETL performance, use:
a. techniques regard constraints like described on Ask tom forum
"ENABLE NOVALIDATE validating existing data"
(Ask Tom &quot;ENABLE NOVALIDATE validating existing da...&quot;)
b. "simply" query on the data?
like this:
select count(count(*)) distinct_count,
sum(count(*)) total_count,
sum(case when count(*) = 1 then 1 else null end) non_distinct_groups,
sum(case when count(*) > 1 then 1 else null end) distinct_groups
from hr.employees a
group by A.JOB_ID
c. use analytics function?
d. use some feature directly on external table?
Bye in advanceHere is the example to handling the errrs using LOG_ERRORS into concept. You will check this and let me know if any doubt you have
DATAFILE:-
1000,ANN,ZZ105
1001,KARTHI,ZZ106
1002,PRAVEEN,ZZ109
1002,PARTHA,ZZ107
1003,SATHYA,ZZ108
1000,ANN,ZZ105
----- Original Table With unique constraints
SQL> CREATE TABLE tab_uniqtest(student_id NUMBER(10) UNIQUE,
student_name VARCHAR2(15),
course_name VARCHAR2(15)
2 3 4
Table created.
----- External table
SQL> CREATE TABLE tab_extuniqtest(student_id NUMBER(10),
2 student_name VARCHAR2(15),
3 course_name VARCHAR2(15)
4 )
5 ORGANIZATION EXTERNAL
6 (
7 DEFAULT DIRECTORY ann_dir
8 ACCESS PARAMETERS
9 (
10 RECORDS DELIMITED BY NEWLINE
11 BADFILE 'tabextuniqtest_badfile.txt'
12 LOGFILE 'tabextuniqtest_logfile.txt'
13 FIELDS TERMINATED BY ','
14 MISSING FIELD VALUES ARE NULL
15 REJECT ROWS WITH ALL NULL FIELDS
16 (student_id,student_name,course_name)
17 )
18 LOCATION ('unique_check.csv')
19 )
20 REJECT LIMIT UNLIMITED;
Table created.
---- Error logging table to log the errors
SQL> CREATE TABLE dmlerrlog_uniqtest(ORA_ERR_NUMBER$ NUMBER ,
2 ORA_ERR_MESG$ VARCHAR2(2000),
3 ORA_ERR_ROWID$ ROWID,
4 ORA_ERR_OPTYP$ VARCHAR2(2),
5 ORA_ERR_TAG$ VARCHAR2(4000),
6 inserted_dt VARCHAR2(50) DEFAULT TO_CHAR(SYSDATE,'YYYY-MM-DD'),
7 student_id VARCHAR2(10)
8 );
Table created.
---- Procedure to insert from external table
SQL> CREATE OR REPLACE PROCEDURE proc_uniqtest
2 AS
3 v_errcnt NUMBER;
4 BEGIN
5 INSERT INTO tab_uniqtest
6 SELECT * FROM tab_extuniqtest
7 LOG ERRORS INTO dmlerrlog_uniqtest('PROC_UNIQTEST@TAB_UNIQTEST') REJECT LIMIT UNLIMITED;
8 SELECT COUNT(1) into v_errcnt
9 FROM dmlerrlog_uniqtest
10 WHERE ORA_ERR_TAG$ = 'PROC_UNIQTEST@TAB_UNIQTEST';
11 IF(v_errcnt > 0) THEN
12 ROLLBACK;
13 ELSE
14 COMMIT;
15 END IF;
16 DBMS_OUTPUT.PUT_LINE ( 'Procedure PROC_UNIQTEST is completed with ' || v_errcnt || ' errors') ;
17 EXCEPTION
18 WHEN OTHERS THEN
19 RAISE;
20 END proc_uniqtest;
21 /
Procedure created.
SQL> SET SERVEROUTPUT ON
SQL> EXEC proc_uniqtest;
Procedure PROC_UNIQTEST is completed with 2 errors
PL/SQL procedure successfully completed.
SQL> SELECT STUDENT_ID,ORA_ERR_MESG$ FROM dmlerrlog_uniqtest;
STUDENT_ID ORA_ERR_MESG$
1002 ORA-00001: unique constraint (
SCOTT.SYS_C0037530) violated
1000 ORA-00001: unique constraint (
SCOTT.SYS_C0037530) violated -
Hi everyone,
I am pretty new to oracle reports, if you think this question is too basic, please bear with me.I also tried searching the forum and looked into documentation. Why should we use a formula column to assign value to a placeholder column, why cant it be done directly in the plsql formula portion. Why does it not accept any return values in the plsql formula portion of the placeholder column, when i add the code, it acpets and gets compiled, but does not get reflected during runtime. Can someone help me ab this.
Thanks
SandeepFormula and Placeholder columns work together to give a calculated or processed value. The formula column calculates or processes the data and then assigns the result to the placeholder column. Bit like in PL/SQL when you have a variable (placeholder col) being set by a function (Formula col).
HTH!! -
WEB DYNPRO ALV GRID : CELL CONTENT - Initial Value
I created a sort of 'Timesheet' in web dynpro...
Unfortunatly, for all days of the month it displays '0.00' as initial value...
Is it possible to not display this initial value or display space/empty ?
In gui alv it is possible, I don't know if it could be done in web dynproHi,
For the node to which the ALV is bound. For the column (context attribute) check the property of the attribute check the formatting propertioes as ZEROS AS BLANKS
for ex: price is the context attrbiute check the properties.
This FORMATTING options for the context attribute is found in the latest verions like EHP4.
Regards,
Lekha. -
Help with Formula/Placeholder columns for group totals
I have select that is broken into 2 groups (a COMPANY group and a DETAIL group within company). I need to determine the COMPANY group totals based on values in a column in the DETAIL group. I.E. the column is a transaction description and can have up to 15 different values and it did not appear that a summary column would work for what I need. I have currently set up 15 formula columns in the DETAIL group and check the value of the REASON to accumulate totals and return the total to a PLACEHOLDER column (which is numeric and defined in the COMPANY group).
I then report the Placeholder columns at break of COMPANY. This all works fine if I run only one company. If I run with multiple companies the Placeholder columns are used as a running total.
My question is how do I reset the PLACEHOLDER columns at company break if at all, or is there a simpler way to accomplish what I need.
Any and all assistance would be greatly appreciated.
Tom VereeckeIf you are using one placeholder column in different formula columns just ignore the following solution. It will not work in that case. I will post it here if i find out any way to initialize placeholder columns at different groups or anyother way to solve this issue.
I think if you remove placeholder columns and create summary columns at Company Level, that will work. And formula columns will be changed as follows:
Formula Column:
active_total number(10) := 0;
begin
if :status_1 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_2 = 'ACTIVE' then
active_total := active_total + 1;
end if;
if :status_3 = 'ACTIVE' then
active_total := active_total + 1;
end if;
return active_total;
end;
And in summary columns source will be formula columns. And reset the summary columns at Company.
Hope this helps.
Message was edited by:
fs -
Friends !
Can anyone tell me the purpose and the difference with others of the following of Report Builder,
PLACEHOLDER COLUMN
REF CURSOR QUERY
EXTERNAL SQL QUERY
EXPRESS QUERY
Actually I want to use these controls but i did not know better about them, as there might be a
situation where i should use these controls instead of FORMULA COLUMN etc.
Anyone's help or better to have examplary code will add a great help.
Many Thanks !
[email protected]
nullIf you have a formula column that returns multiple values, e.g. from a select, you would assign them to placeholder columns instead of writing a stand-alone-formula for each value.
-
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. -
Diff. between Formula column and Placeholder column
Can any one explain me the difference between a formula column and place holder column in Reports.
Place holder columns are used to hold a value and they are populated by formula columns and in the following places.
- the Before Report Trigger, if the placeholder is a report-level column
- a report-level formula column, if the placeholder is a report-level column
- a formula in the placeholder's group or a group below it
(the value is set once for each record of the group)
But Formula columns perform a user defined computation on one or more columns including placeholder columns. You can set the value of placeholder column in a formula column. But you cannot set the value of a formula coulmn in a placeholder column's PL/SQL.
Regards,
Siva B -
What the Initial value for sy-tabix & sy-index
Hi Folks
I have a small doubt.
What the Initial value for sy-tabix & sy-index?
Can anyone please clarify me?
Regards,
Sreehi sree,
both values are initialized to 0 before processing and after processing values are changed according to used scenarios.
if helpful reward some points.
with regards,
suresh babu aluri. -
Initial value and value in the database
Hello world ,
i want to add initial value with value in the database depend on the date
for example i have initial value for 30/09/2009
i and to all it with value in the database in 31/12/2009
take a look what i did
PROCEDURE pkd_prem IS
cursor gr_pkd_prem is select
SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
SUM(DECODE(FMS,'01',LS,NS) b
from fr_treaty_profile ftp, fr_monthly_summary
where
(ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
AND (ftp.tpr_class = fr_monthly_summary.fms_class )
AND (ftp.tpr_type = fr_monthly_summary.fms_type )
AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
AND
(fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
(fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
(fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
(fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
AND (FMS_TYPE ='P')
AND FMS_SERIAL = '01'
AND (FMS_OFC_ID !='X')
and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
---Initial value
cursor base is select EO_GR_BKD_PREM from FR_EN
where
EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
EO_CLASS=:BLK1.EO_CLASS AND
EO_TREATY_TYPE=:BLK1.EO_TYPE AND
EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
EO_YEAR=:BLK1.EO_YEAR;
A number(18,3);
B number(18,3);
v_base number(18,3);
BEGIN
open base;
open gr_pkd_prem;
fetch gr_pkd_prem into a,b;
fetch base into v_base;
:BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
close gr_pkd_prem;
close base;
END;
the proceudre is correct and the values come as i want
but here
FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
suppose i will add from 6 to 9
the value will come down to add with base value
but next time i want from 10 to 12
it will add value 10 to 12 with the base for just period 10 to 12
i want to keep adding
if i start from 6 to 9
then shoud be
add the value of 6 to 9 to 10 to 12
butlook ..
i created a form and let's say there is one field called Base ..
and i inert value on that field and saved .
then
i created cursor to fetch value from another table
that value which i fetched from another table must add to past value
take this scenario
i started with value 6
then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
first action
6+33
then
i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
the result of first action must add with the last value which is 2
(6+33) from first action plus(+) 2 and display the result on the secreen -
In DEV system, this piece of code is working fine. However when it moves to Testing system it dump due to cl_fpm_factory=>get_instance( ) return initial value. What could be the reason for this? Thanks!
data lo_fpm type ref to if_fpm.
lo_fpm = cl_fpm_factory=>get_instance( ).
wd_this->go_message_manager = lo_fpm->mo_message_manager.Hi Anthony,
how sure are you that the DEV and Test system running the same Netweaver SP versions ?. My doubt is that the test system is not NW7.01 (Ehp-1) . Or some thigs are not enabled in the configuration.
Regards
Senthi
Maybe you are looking for
-
HP Pavilion Ultrabook 15: sound crackles/ hangs
Hi all, My PC is a HP Pavilion Ultrabook 15-b080sb and I work with Windows 8.1 (but the problem was also there when I worked with Windows 8). Information about my video: Adapter = Intel(R) HD Graphics 4000 version 10.18.10.3316, status Aero enabled.
-
Hey I have been really wanting to add an interface were users can create multiple usernames and passwords on my iweb page instead of the password protect feature that only allows 1 username and pass. is this possible?
-
Error while installation of Outlook Integration Add On
Hi Experts, Problem encountered upon installation of outlook add-on The message box shows "The Procedure point ??OCBFDbDef@@QAE@....... could not be located in dynamic link library BFFramework.dll". I'm watching this thread . I cannot open the link f
-
Win 8.1 and HP Officejet Pro 8600 not connecting
Priior to installing Windows 8.1, my printer worked fine. I installed Windows 8.1 and came across the message - Printer Error - Before you can perform printer-relate tasks... I removed and reinstalled the printer and it worked. I printed several d
-
Where is the keyboard click sound located?
Hi, I would like to change the sound the Mac plays when using keyboard click sounds. Any idea where the sound file is located? I figure I can just swap in a new one. Thanks, Allan