Dynamic column headings
You will need to run a report on the budget for the past 3 calendar years. I can produce the report but has difficulty to print the column position properly review this report need to run each year. Is it possible to appoint the year on appropriate using bi publisher and APEX V4 column header?Oracle: 10G
ex:
If the report runs this year: column must be 2010,2009,2008.
If the report is run next year: column name must be 2011,2010,2009
.....
Thank you.
Tai
Published by: tai84 on October 27, 2011 12:27
Oops, Yes, the password has expired. I have reset. Try again... same settings.
I was not aware of the position PL/SQL column type. You can specify in the 'Report of the attributes' tab in your area. At the top of this page, there is a section of Type "headings". If you click on the option button "PL/SQL", it displays a text box field to specify PL/SQL code to determine the column headers. This is what is used in my sample application. It calls the function 'GET_QUERY_COLS', you can find the SQL Workshop of my sample workspace area.
A brief description of what is happening in my example...
In my area "Dynamic motion", I run a dynamic SQL query because the values of the year for the columns are unknown. It runs the report of dynamic query and stores the dynamic query to the P1_REPORT_QUERY point. Then, this value of the element is passed in the function GET_QUERY_COLS that returns the name of the column, that I need. Of course, I have the user selects a range which essentially defines the columns, I need.
Thank you
Mark
Tags: Database
Similar Questions
-
OBIEE dynamic column headings based repository Variables
Hello
How can we provide variable name of the repository (from RPD) as column headings in reports (presentation Services).
Can you please suggest me how to do it?
Thanks in advance...
RAM
Hello
You can use the following link.
Oracle Business Intelligence 11g: OBIEE 11 g dynamic column headings
I used the variable presentation here, you can substitute the variable repository. The difference is that you don't need to create variable presentation, instead you use repository variable there.
If you are not clear with this, pleas come back. I'll write a new message on your problem.
-
OBIEE 11 g dynamic column headings
Thank youHow to achieve this and is for the column headers!I doubt I should do some dynamic column headings in OBIEE 11 gbut in the report I want column header to be something as if showing 1 do Jan...I have guest months (1,2,3...)
NK
I fixed that with a dummy work around
created a new prompt and pass values of the previous message and put this quick as a filter on the dashboard (dashboard properties).
and used this new prompt variable as a header for the report
He worked
Thank you
NK
-
OK, so I know I can use the names of dynamic column headings. Is it possible to use the colspan HTML option to combine just the column headings? Is it possible to add an extra header above the standard report header line to offer options of 'grouping '?
Here's what I'm trying to do:
I don't want to generate the report using PL/SQL commands and htp.p (), unless there is no other choice. I can probably get away with the creation of the text elements to display/region above the report, but these look tacky in comparison.[ What Time did the delay occur ][ Total Time of Delay ][ nbsp; ] [ Hr ][ Min ][ AM/PM ][ Hrs ][ Min ][ Reason for Delay ]
Think you look at the model of the region and not the report model.
Go to share components-> models-> reports should be down at the bottom.
Trent
-
I use
DB 10g Release 10.2.0.1.0
Oracle 6i 6.0.8.8.3 reports
in the table below.
How can I have the dynamic columns 'fault' in reports in the order of its highest value of occur_times.
and a view that gives me no reports (formats below).
CREATE TABLE dem
(trid NUMBER (9.0),)
tr_date DATE,
point VARCHAR2 (10),
failure VARCHAR2 (5).
occur_times NUMBER (9.0))
/
INSERT INTO dem
VALUES
(1, 26 - JAN 2016', 'MC', 'AB', 3)
/
INSERT INTO dem
VALUES
(2, 26-JAN 2016', 'MC', 'FM', 2)
/
INSERT INTO dem
VALUES
(3, 26 - JAN 2016', 'MC', 'SO', 5)
/
INSERT INTO dem
VALUES
(4, 27 - JAN 2016', 'MC', 'AB', 8)
/
INSERT INTO dem
VALUES
(5, 27-JAN 2016', 'MC', 'FM', 2)
/
INSERT INTO dem
VALUES
(6, 27-JAN 2016', 'MC', 'SO ', 1).
/
Commit
/
example1
"Report of input parameter: count 26 January 2016 ' to 26 January 2016"
Output format of report
point defects Total SW AB FM
------- ---------------- ---- ----- -----
MC 10 5 3 2
e.g.2
"Report of input parameter: count 26 January 2016 ' January 27, 2016"
Output format of report
point defects Total FM SW AB
------- ---------------- ---- ----- ----- 21 11 6 4 MC
in example1 in date range, the flaws in the order of its value max occur_times is FM SW, AB,
but in e.g.2. in view of the date range default by order of its value max occur_times is AB, SW, FM
THE FAULT of MAX VALUE should take precedence i.e. dynamically in the reports.
concerning
teefu
Lahore, pakistan.
You must create the parameter in the oracle reports. When the report of the form calling create the parameter list and then pass the required parameter.
SELECT the item,
fault,
Sum (occur_times) tot_times,
ROW_NUMBER() over (ORDER BY SUM (occur_times) DESC) rn
DEM
WHERE the fault ("AB", "FM", "SW")
AND tr_date BETWEEN TO_DATE(:p_dt1,'dd-Mon-yyyy') AND TO_DATE(:p_dt2,'dd-Mon-yyyy')
GROUP BY item, fault
;
-
Dynamic columns based on the user login
Dear Experts,
Is it possible to display the columns dynamically according to the connection of the BI Publisher user?
For example, if the report of RTF model has 10 columns in total and if I connect with a user named "abc", I should be able to see, say 6 columns containing information about the user "abc".
And if I have connection with "xyz", I should be able to see, say 7 columns containing information about the user "xyz".
I will be able to assign to which column should be displayed to the user who?
If there is a way to achieve this scenario, please let me know as soon as possible, since there is an urgent need.
Your help will be very appreciated.
Thanks in advance!
Yes, using: xdo_user_name in the SQL data model, you can get the details for user identification.
Then use this model column RTF for display of the dynamic columns.
Example:
Select: xdo_user_name as USER_ID of the double
In RTF
Column header Column data -
Creating a dynamic column editable
I tried to make my dynamic columns as editable. The problem is that my dynamic columns are nested.
Now editable column works fine when I have diff columns with a different name. For example, col1, col2, col3 (not nested)
Or I nested columns like "pass"(parent) given two columns col1 and col2. ".
But, when I use them in a dynamic of columns in which all of them have the same name, in the example below, each with the same name 'col', I can change all of them, but the textfield never faded away, when I click on ENTER.
Suppose I have an editable column with col name:
and cellfactory as:for (final CategoryTypeVO type : typeList) { TableColumn<ItemVO, Integer> col = new TableColumn<ItemVO, Integer>(type.getTypeName()); col.setMinWidth(100); col.setEditable(true); col.setCellFactory(cellFactory); col.setOnEditCommit( new EventHandler<TableColumn.CellEditEvent<ItemVO, Integer>>() { public void handle(TableColumn.CellEditEvent<ItemVO, Integer> t) { ((ItemVO)t.getTableView().getItems().get( t.getTablePosition().getRow())).getListType().get(type.getTypeId()).setQuantity(t.getNewValue()); } }); quantity.getColumns().add(col); }
and Editing class asfinal Callback<TableColumn<ItemVO, Integer>, TableCell<ItemVO, Integer>> cellFactory = new Callback<TableColumn<ItemVO, Integer>, TableCell<ItemVO, Integer>>() { public TableCell call(TableColumn p) { return new EditingCell(); } };
Now what happens is this thing works fine if I separate columns with distinct names. But when it comes to dynamic columns, it fails, once I have edit a cell, the text field never leaves his place. It gets stuck in the cell. Any help!class EditingCell extends TableCell<ItemVO, Integer> { private TextField textField; public EditingCell() {} @Override public void startEdit() { super.startEdit(); if (textField == null) { createTextField(); } setGraphic(textField); setContentDisplay(ContentDisplay.GRAPHIC_ONLY); textField.selectAll(); Platform.runLater(new Runnable() { @Override public void run() { textField.requestFocus(); } }); } @Override public void cancelEdit() { super.cancelEdit(); setText(String.valueOf(getItem())); setContentDisplay(ContentDisplay.TEXT_ONLY); } @Override public void updateItem(Integer item, boolean empty) { super.updateItem(item, empty); if (empty) { setText(null); setGraphic(null); } else { if (isEditing()) { if (textField != null) { textField.setText(getString()); } setGraphic(textField); setContentDisplay(ContentDisplay.GRAPHIC_ONLY); } else { setText(getString()); setContentDisplay(ContentDisplay.TEXT_ONLY); } } } private void createTextField() { textField = new TextField(); //textField.setText(getString()); textField.setText("0"); textField.setMinWidth(this.getWidth() - this.getGraphicTextGap()*2); textField.focusedProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> arg0, Boolean arg1, Boolean arg2) { if (!arg2) { commitEdit(Integer.parseInt(textField.getText())); } } }); textField.setOnKeyReleased(new EventHandler<KeyEvent>() { @Override public void handle(KeyEvent t) { if (t.getCode() == KeyCode.ENTER) { commitEdit(Integer.parseInt(textField.getText())); } else if (t.getCode() == KeyCode.ESCAPE) { cancelEdit(); } } }); } private String getString() { return getItem() == null ? "" : getItem().toString(); }
Published by: abhinay_a on January 21, 2013 12:31 AMDo not know what is the problem in your code, but it is easier to use TextFieldTableCell than building your own TableCell from scratch.
This change to the example I posted in How to create a tableview for this? works for me:
package itemtable; import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.scene.Scene; import javafx.scene.control.ChoiceBox; import javafx.scene.control.TableColumn; import javafx.scene.control.TableColumn.CellDataFeatures; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.control.cell.TextFieldTableCell; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; import javafx.util.Callback; import javafx.util.converter.NumberStringConverter; public class ItemTable extends Application { @Override public void start(Stage primaryStage) { final DAO dao = new MockDAO(); final ChoiceBox
choiceBox = new ChoiceBox (); choiceBox.getItems().setAll(dao.getCategories()); final TableView - table = new TableView
- (); // Make table editable: table.setEditable(true); final TableColumn
- nameCol = new TableColumn
- ("Name"); nameCol.setCellValueFactory(new PropertyValueFactory
- ("name")); nameCol.setCellFactory(TextFieldTableCell.
- forTableColumn()); final TableColumn
- priceCol = new TableColumn
- ("Price"); table.getColumns().addAll(nameCol, priceCol); choiceBox.getSelectionModel().selectedItemProperty() .addListener(new ChangeListener
() { @Override public void changed(ObservableValue extends Category> observable, Category oldValue, Category newValue) { table.getItems().clear(); priceCol.getColumns().clear(); for (final Type type : newValue.getTypes()) { final TableColumn - col = new TableColumn
- (type.getName()); col.setCellValueFactory(new Callback
, ObservableValue >() { @Override public ObservableValue call(CellDataFeatures - cellData) { Item item = cellData.getValue(); if (item == null) { return null; } else { return item.priceProperty(type); } } }); // Make column editable: col.setEditable(true); col.setCellFactory(TextFieldTableCell.
- forTableColumn(new NumberStringConverter())); priceCol.getColumns().add(col); } table.getItems().setAll(dao.getItemsByCategory(newValue)); } }); BorderPane root = new BorderPane(); root.setTop(choiceBox); root.setCenter(table); Scene scene = new Scene(root, 600, 600); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } }
Edited by: James_D January 22, 2013 07:22
- table = new TableView
-
Adding dynamic columns to datagrid at the beginning of the datagrid
Hello friends,
There is a datagrid that is static. and I m adding a dynamic column. It is added at the end of the static data grid
but I want to add dynamic at the begning of the datagrid column can someone help me on this.
Thanking you,
Kind regards
Gallot
datagridfeeamount.dataProvider = new ArrayCollection (event.result.rows.row) collection;
the word 'new', after that the = was supposed to be red and larger
-
Dynamic columns in dashboard prompt
Hi all
I have to 'TOP' dispay & dynamic value 'BOTTOM' in the drop-down list of the dashboard invites the creation of a dynamic column value in the drop-down list prompt dashboard? I'm trying to create in writing view sql result but not getting does not correctly according to the selection of HIGH and low, I must make a report changesSELECT CASE WHEN 1=0 THEN ExistedPresentationColumn ELSE 'TOP' END FROM SubjectArea
UNION ALL
SELECT CASE WHEN 1=0 THEN ExistedPresentationColumn ELSE 'BOTTOM' END FROM SubjectArea
-
Missing cells in the table of dynamic columns
Hello
I am creating a table using dynamic columns. Here's an example simplified data that I use:
< sales >
... < drive >
... Honda < brand > < / brand >
... < color > green < / color >
... < / car >
... < drive >
... Nissan < brand > < / brand >
... < color > blue < / color >
... < / car >
... < drive >
... Honda < brand > < / brand >
... < color > blue < / color >
... < / car >
< sales >
I am grouping the brands for the lines, and I want a number of colors as my dynamic column. I find myself with a table that looks like this:
----------------------------------------------------------------------------------
Brand | Blue | Green |
----------------------------------------------------------------------------------
Honda | 1. 1.
----------------------------------------------------------------------------------
Nissan | 1
--------------------------------------------------------
Since there is no green Nissan, a cell not created so I find myself with a hole in my table. Ideally, I would want a cell containing 0 to be in this space.
Is it possible, or to all the least have a cell in this space, so I did not have a table with gaps?
Thank you!Hi cc22
If you have a look at these. http://winrichman.blogspot.com/search/label/cross%20tab
you will identify yourself,its simple... If this is not the case, let me know.
-
Help by calling the dynamic columns in anonymous blocks
my code:
DECLARE
col1 VARCHAR2 (20): = "City";
BEGIN
I'm in (select * from xbd.cus_ord where rownum < 10)
LOOP
- I would call col1 dynamically here in my outings DBMS.
DBMS_OUTPUT. Put_line (i.col1);
END LOOP;
END;
/
The code above I tried to call a dynamic column. How can I do that.
I Heve been tried differently using EXECUTE IMMEDIATE. It still does not work.
THX,
VIDECLARE col1 VARCHAR2(30) := 'object_name'; TYPE REF_CURSOR IS REF CURSOR; refCursor REF_CURSOR; text VARCHAR2(4000); BEGIN OPEN refCursor FOR 'SELECT ' || col1 || ' FROM all_objects WHERE ROWNUM < 10'; LOOP FETCH refCursor INTO text; EXIT WHEN refCursor%NOTFOUND; DBMS_OUTPUT.PUT_LINE(text); END LOOP; END; /
-
Extraction of dynamic columns in table
I have table with 1000 rows and 200 columns. The columns have additional suffix IE
Table = 'X '.
Columns = ID, A, B, C, D1, D2, D3... D200
I would like to get the values of each column so that I can treat them accordingly.
OPEN c1 to SELECT * FROM X
LOOP
C1 FETCH BULK COLLECT INTO l_dies;
FOR indx IN 1... l_dies. COUNTY
LOOP
FOR indx to 0... 200
LOOP
colStr: = l_dies (indx). || » D'|| INDX; <-trying to dynamic column of concat name, but it gives an error.
Dbms_output.put_line ('indx =' | indx |) 'col = value' | colStr);
END LOOP;
END LOOP;
END LOOP;
Maybe it's not the right way, but just an example of what I want to achieve.
Thanks in advance.http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:1035431863958
Visit this link especially the very first post of Tom (Proc print_table).
I hope this helps.
Concerning
REDA
-
From dynamic column change for quick selection of values.
Hello
Requirement is based on the selection of value FAST I need to change the column values as like: "QTD_MONTH"
for example. If the prompt value is February then the column value must be "QTD_February"
This QTD_February is must be dynamic based on the quick selection.
Thank you
A Penning.
Hello
Instead of making the quick selection. Build separate column in the report. According to the requirement.
Try the following formula,
for example,.
FILTER ("measue' to the HELP of CAST (SUBSTRING("TIME_Dimension"FROM 2 FOR 2) AS INTEGER) IN (@{wk} {26}))
Thank you.
-
Hi guys,.
As a basis for the application of the requirement of the company, I used the post of Vincent Deelen here:
http://vincentdeelen.blogspot.ro/2014/02/interactive-report-based-on-dynamic-SQL.html
However, since our upgrade to APEX 5.0, I get the following error:
ORA-01445: cannot select ROWID, or sample, join without table views preserved key
I can see in the debug statement that the query that fails is the following:
SELECT apxws_row_pk,
"C001."
"C002."
"C003."
"C004."
"C005."
"C006."
"C007."
"C008."
"C009."
"C010."
"C011."
"C012."
"C013."
"C014."
"C015."
"C017."
"C018."
"C019."
"C021."
"C022."
"C023."
"C024"
"C030."
"C031."
"C032."
"C041."
"C042."
"C043."
"C044."
"C045."
"C046."
Count (*) (AS apxws_row_cnt)
Of
(SELECT *)
Of
(SELECT b.ROWID apxws_row_pk,
b.*
Of
(SELECT *)
Of
(SELECT * FROM APEX_collections WHERE collection_name = "IR_COLLECTION_877")
)
) b
+ 0
+ 0
WHERE rownum < = to_number(:APXWS_MAX_ROW_CNT)
ORDER BY apxws_row_pk
From my understanding, the ROWID is a new implementation for APEX 5.0, this post has not been monitoring since may:
Can this be repaired? Does anyone have a solution?
Marc Sewtz-Oracle, I'm sorry for the intrusion, but I saw your last answer in this particular post above, and maybe you have some news!
Thank you
Digital
Hi all
I did the simplest thing! Reproduce the solution:
-L'IR
-Elements of Page 50
-Conditions placed on all 50 columns
Basically, I re-did everything and it works great!
It's amazing how such a simple solution does work sometimes!
Thank you
Digital
-
Hi all
Suppose I have table, whose structure changes frequently on a daily basis.
For example. / / desc my_table gives you after the name of the column the day 1
SQL > my_table DESC;
Output
Name
Age
Phone
Day 2, two other columns are added, viz, address and salary.
SQL > my_table DESC;
Output
Name
Age
Phone
Address
Salary
Now, I want to create a Dynnamic RTF report which made extracting data from all columns from my_table daily. For this, I have defined a simultaneous program with XML output type and include in annex a data/definition of data model that takes XML as input and gives the final result of the conc program in EXCEL layout. I am able to do that for a constant number of columns, but don't know how to do it when the number of columns to display dynamically changes.
For 1 day my XML file should be like this.
<?xml version="1.0" encoding="UTF-8"?> <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0"> <dataQuery> <sqlStatement name="Q2"> <![CDATA[ SELECT Name ,Age ,Phone FROM my_table ]]> </sqlStatement> </dataQuery> <dataStructure> <group name="G_my_table" source="Q2"> <element name="Name" value="Name" /> <element name="Age" value="Age" /> <element name="Phone" value="Phone" /> </group> </dataStructure> </dataTemplate>
And my day 1, EXCEL output RTF model should be like this.
Name age phoneSwapnill 23 12345
For 2 days my XML file should be like this. With 2 new columns selected in the SELECT clause.
<?xml version="1.0" encoding="UTF-8"?> <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0"> <dataQuery> <sqlStatement name="Q2"> <![CDATA[ SELECT Name ,Age ,Phone ,Address ,Salary FROM my_table ]]> </sqlStatement> </dataQuery> <dataStructure> <group name="G_my_table" source="Q2"> <element name="Name" value="Name" /> <element name="Age" value="Age" /> <element name="Phone" value="Phone" /> <element name="Address" value="Address" /> <element name="Salary" value="Salary" /> </group> </dataStructure> </dataTemplate>
And my day 2, exit EXCEL model RTF should be like this.
Name address telephone pay23 12345 Madrid 100000 Swapnill
Now, I don't know below things.
- Make the dynamic XML as we did in the day 1 there are 3 columns in the SELECT statement and the day 2, 5 columns. I want to create a dynamic XML which must not be changed if the new columns are added into my_table. I don't know how to create this query and also create their corresponding items below.
- Make the RTF model dyanamic as day 1 there are 3 exit EXCEL columns and the day 2, 5 columns. I want to create a dynamic RTF model that would display all the columns selected in XML dynamic. I don't know how the RTF will create new XML tags and how it will know where to place them in the report. Means, I can create model RTF day 1, by loading the XML data for 3 columns and place 3 tags XML in the model. But how he will create and place the tags for the new columns the day 2?
Hope so, you got my requirement, it's difficult. Please let me know how I can implement the necessary solution using the RTF dynamically without any manual intervention.
Kind regards
Patricia K.
Post edited by: SwapnilK
Hi guys,.
I was able to solve above the requirement.
I created a procedure that would create & update (attached to the data definition) XML file dynamically for each race. This dynamic XML contains the SQL statement for the data query that is built dynamically. I am updating this XML file using XDOLoader utility to the definition of data. Then run my program customized to generate the excel output.
Exit excel retrieves correct number of columns dynamically (3 on Day1 and Day2 5), with corresponding data records.
Kind regards
Patricia K.
Maybe you are looking for
-
How to remove the battery on SP M10?
Hello I have a M10 Pro Sat and the removable battery does not come out.Any idea of what can be done to get it out?
-
Satellite C660 1E2 - memory upgrade help
Hello I have this laptop which came with Windows 7 and 1 GB of memory - I found very slow the 1 GB and bought an extra 4 GB of crucial DDR3 PC3-8500. When I install the new memory it is bios but Windows crashes (blue screen). I don't check before han
-
shutter of Bluetooth on iOS 9.2 problem
After that I have upgraded to iOS 9.2, my bluetooth on selfie stick pane doesn't work anymore. My other iPhone still on iOS 9.1 works very well. It seems that iOS 9.2 has the bug or turn off the bluetooth pane. Anyone has the same problem? Thank you
-
export of data to exiesting excellent shhet
Hi all... How to export existing data excel sheet? That is to say, I would like to export to the same sheet whenever the program runs. If the card already contains data, then have to crush... Thanks in advance
-
How to enter the firewall what is underway
When the firewall snaps