Table dynamic columns
hi pro´s,
i just got a problem, which i can't solve.
i got a table with about 15 columns.
column A is the master
when A is filled with value RA then i want to print columns 2-8
when A is filles with value GS then i want to print columns 2,6, 9-15
example
A | B | C | D | E
RA | 1.1.10 | 100,-- | Test |
GS | 2.1.10 | - | - | some long Text
then the output should be like
Date Price myText
1.1.10 100,-- Test
2.1.10 some long Text
in smartforms i got no problem; i am switching rowtypes with the condition"flag".
is adobe forms able to do this?
would be great, if someone can help me...
Edited by: Peter Erbeznik on Jan 4, 2011 1:15 PM
Edited by: Peter Erbeznik on Jan 4, 2011 1:18 PM
Edited by: Peter Erbeznik on Jan 4, 2011 1:19 PM
You need to learn about scripting. Get a guide from the internet and in the last chapter there are problems+solutions for quick use/ learning by doing. Or use google to learn how to manipulate the visibility of the subform (or field).
That of course means you need to have your table created from subforms and not a table generated by LCD.
Cheers Otto
Similar Messages
-
I looked over the posts on CFChart but did not find anything
that addresses my specific problem with the cfchart. So if you can
help, I'd appreciate it very much!
What I want to do is take the dynamic name of the column
derived from the first query and use that name in the Legend. E.G.
A_R1_DIS is the first dataset, A_R1_J is the second dataset, and
A_R1_PPLI is the third dataset. Then show a line graph with each
dataset based on the first query. The X Axis displays the Date/Time
value and the Y Axis displays the number of points for each record
of time for each dataset individually. I was able yesterday to get
all three datasets to display individually but when I tried to show
the legend it either displayed only the first Dataset name
"A_R1_DIS" or it displayed "NONE". Currently the code will not
display any line on the chart and the legend repeats the A_R1_DIS
as many times as there are records in the table (60+).
I use the following query to get the dynamic column name
"SelectedDatasetColName" from the MasterDataList table.
<CFQUERY name="getSelectedDatasetColName"
datasource="#getcfdbname.EventCFDBName#">
SELECT MDL_TestName + '_' + MDL_DatasetID + '_' +
MDL_MeaningfulName as SelectedDatasetColName
FROM MasterDataList
</CFQUERY>
Here is where I'm using the "SelectedDatasetColName" value:
******************************************* queries
<CFQUERY name="DatasetHistogramQry"
datasource="#getcfdbname.EventCFDBName#">
SELECT
<cfset i = 1>
<cfloop query="getSelectedDatasetColName">
#SelectedDatasetColName# as col#i#,
<cfset i = i + 1>
</cfloop>
JDay, TheHour, TheMinute,
convert(varchar(12), JDay, 114) + ' ' + convert(varchar(12),
TheHour, 114) + ':' + convert(varchar(12), TheMinute, 114) as
DateTime
FROM vPositionHistogram
ORDER BY JDay, TheHour, TheMinute
</CFQUERY>
Here is the code for the table; which works correct:
**************************** Report Code
<TABLE>
<TR>
<TH>Day</TH>
<TH>Hour</TH>
<TH>Minute</TH>
<CFOUTPUT QUERY="getSelectedDatasetColName">
<TH>#SelectedDatasetColName# Message Count</TH>
</CFOUTPUT>
</TR>
<CFOUTPUT QUERY="DatasetHistogramQry">
<TR BGCOLOR="###IIF(DatasetHistogramQry.currentrow MOD 2,
DE('DCDCDC'), DE('FFFFFF'))#">
<TD ALIGN="center">#JDay#</TD>
<TD ALIGN="center">#TheHour#</TD>
<TD ALIGN="center">#TheMinute#</TD>
<CFSET i = 1>
<CFLOOP INDEX="X" FROM="1"
TO="#getSelectedDatasetColName.recordcount#">
<TD ALIGN="center">#evaluate("col#i#")#</TD>
<CFSET i = i + 1>
</CFLOOP>
</TR>
</CFOUTPUT>
</TABLE>
Here is the output for the table; Dynamic Column Name used to
repeat counts for each dataset.
********************************* output
Day Hour Minute A_R1_DIS Message Count A_R1_J Message Count
A_R1_PPLI Message Count
37 17 36 0 2 35
37 17 37 19 6 32
37 17 38 28 30 33
37 17 39 40 27 27
37 17 40 66 64 32
Here is the problem code. I have tried several variations on
this code but currently all it does is display a blank chart.
**************************** Chart Code
<CFCHART FORMAT="flash" CHARTHEIGHT="340" CHARTWIDTH="600"
SHOWXGRIDLINES="yes" SHOWYGRIDLINES="yes" SHOWBORDER="no"
FONTBOLD="no" FONTITALIC="no" XAXISTITLE="Timeline (Day
Hour:Minute)" YAXISTITLE="Message Counts" SHOW3D="no" ROTATED="no"
SORTXAXIS="no" SHOWLEGEND="yes" TIPSTYLE="MouseOver"
SHOWMARKERS="no">
<CFOUTPUT QUERY="DatasetHistogramQry">
<CFSET i = 1>
<CFLOOP INDEX="X" FROM="1"
TO="#getSelectedDatasetColName.recordcount#">
<CFCHARTSERIES QUERY="DatasetHistogramQry" TYPE="line"
ITEMCOLUMN="#DateTime#" VALUECOLUMN="#evaluate("col#i#")#"
SERIESLABEL="#getSelectedDatasetColName.SelectedDatasetColName#">
<CFSET i = i + 1>
</CFLOOP>
</CFOUTPUT>
</CFCHART>
Please let me know if you need any additional info on my
problem and if you can help, it is greatly appreciated!!!!
- DebraDateTime is a column in the vPositionHistogram (View). Col#i#
is the variable used to loop through the column names derived from
the getSelectedDatasetColName query. The view is populated
dynamically and the columns in it vary depending on the dataset
used to populate the view. The view can have 1 to many columns.
That is why I pull the column names from the MasterDataList table
and use a variable to get the values from each column. My column
names end up being Col1, Col2, Col3, and so on. I use that variable
in the loop to get the data from vPositionHistogram for each column
in the report/chart. I made some headway on Friday before I called
it a day, but I will try the last suggestion and post my findings
in a little while. Thanks! -
How to find the number of columns in an internal table DYNAMICALLY ?
Hi,
How to find the number of columns in an internal table DYNAMICALLY ?
Thanks and Regards,
saleem.Hi,
you can find the number of columns and their order using
the <b>'REUSE_ALV_FIELDCATALOG_MERGE'</b>
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = sy-repid
changing
ct_fieldcat = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif
now describe your fieldcat . and find no of columns.
and their order also..
regards
vijay -
How to make columns in a table dynamic
Hi,
I want to make the columns of a table dynamic.
At design time I dont know how many columns will be required.
Rows are made dynamic by using the bean concept.
Please help me in this reference(columns).
Thanks
PoojaHi, i don't know how you create the rows dynamically but
have you tried to use a forEach?
<af:table ...>
<af:forEach items="..." var="...">
<af:column headerText="...">
<af:outputText value="..."/>
</af:column>
</af:forEach>
</af:table>
here there is an example of a dynamic panelList:
<af:panelList rows="3" maxColumns="6">
<af:forEach items="#{bindings.ContratosView1.rangeSet}" var="li">
<af:commandLink text="#{li.Codigo}" action="Edit"/>
</af:forEach>
</af:panelList> -
Setting the header of a Column group in a Advanced table dynamically
Hi All,
There is a requirement to set the Header of a column group in a Advanced table dynamically by fetching the values from a view attribute.
Code :
OAAdvancedTableBean spiderTbl1 ;
Problem:
It is not able to set the value for the header inspite of getting the handle of the bean.
Analysis:
the same piece of code works for
1) Setting the text of the advanced table
2) Setting the header of a column in a column group
Please let me know if there is anything more that needs to be done for setting the prompt of a column group header.
Thanks in advance!I have posted it without giving the complete code by mistake. Below is the code:
OAAdvancedTableBean spiderTbl1 ;
OASortableHeaderBean spiderHdr1;
spiderTbl1 = (OAAdvancedTableBean)webBean.findChildRecursive("SpiderCatTbl1RN");
if (spiderTbl1!=null){
spiderHdr1= (OASortableHeaderBean)spiderTbl1.findChildRecursive("AnalogHdr");
if (spiderHdr1!=null) {
spiderHdr1.setAttributeValue(OAWebBeanConstants.PROMPT_ATTR,
new OADataBoundValueViewObject(spiderHdr1,
"SpiderCategory1",
"ProjRegPVO1"));
} -
Multiple dynamic column in cross table
Hi all,
I have a cross table which stored the sale's quantity and amount.
The layout in view result likes below:
saler quantity1 quantity2 quantity3 quantitysummary amount1 amount2 amount3 amount4 amountsummary
S3 100 20
S2 50 30
S1 300 40
The layout in view structure likes below:
saler quantity quantitysummary amount amountsummary
S3 100 20
S2 50 30
S1 300 40
the quantity1...n and amount1...n columns is not fixed.the 2 columns is dynamic.
It's easy that only one column is dynamic,but now there are two columns is dynamic,I don't know how to achieve it.
Has anyone an idea how to accomplish this?
Thank you trying to help me!You cant do this on BO , you can add static columns but if you put some dynamic column in the left or right i turns dynamic...
Regards -
Pivot Table with Dynamic Columns and Headers
Hello,
I'm trying to pivot a table of data where the column headers will be dynamic. While I know how to pivot the table to get what I want how will I be able to pick up the table column header from the Pivot to display in the report?
For example:
Unpivoted data is Employee Code, Branch Code, Problem Code, # of Problems.
There is many records for a given Employee and Branch that I want to pivot so the Column headers are the Problem Codes and the data below is the SUM(num_problems) for that Problem.
So the data may look like this for Tech Bob, Branch NY.
Problem = LEAK, Num_problem = 5
Problem = DAMAGE, Num_problem = 2
Problem = OTHER, Num_problem = 3
Which problem codes may appear is unknown but selecting the DISTINCT(problem) across all techs gives me the column headings to use.
So if I pivot this data, I get this Row:
Tech = Bob, Branch = NY, DAMAGE = 2, LEAK = 5, OTHER = 3
So first can SSRS handle having dynamic columns? Only Tech and Branch are known and the remaining columns are dynamic based on how many Problems they worked on.
Second, how can I set the column heading in my Tablix to be the Problem Code?
SherryYou just need to use a matrix container
Use EmployeeCode and BranchCode for row group
ProblemCode as column group and SUM([No Of Problems]) as the data expression and it will generate the columns for you based on ProblemCode values automatically.
See an example here
Sample Matrix
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Change Table control Column Header text dynamically
Hi,
I have an requirement to change table control column header text dynamically.
i.e. I have about 10 columns in table control, out that need to change 5 columns header text. These header texts are stored in an internal table.
I had looked into the below link but could not get exactly how to do it.
Dynamic headers in table control
Could you please tell me how to do that.
Thanks in Advance.Hi Saba,
What you will need to do is this.....
1. First replace the column Header Text box by I/O Fields and name them accordingly.
Say for example we will consider the same example which i had explained in the link.
there in the column header we want the header to change when some dates and entered into two fields which are out of table control say
Start Date: 01.01.2010 to End Date: 06.01.2010
Now we want the header to look like this,
Column No. - 1 2 3 4 5 6
Header label - 01/FRI 02/SAT 03/SUN 04/MON 05/TUE 06/WED
Header name - SPOTS1 SPOTS2 SPOTS3 SPOTS4 SPOTS5 SPOTS6
then you go as per the instructions in the link......
Let me know if you need further help,
Hope this solves your problem....
Regards,
Abhijit G. Borkar -
HOW to add Dynamic Columns in ADF Faces CORE Table
In ADF im going to display the dynamic column in Coretable,
Header are displaying very fine. but im unable to display rows sucessfuly,how to resolve.
Second thing is that JSF page isn't getting the value from dataList, whats wrong in JSF code.
// JSF PAGE CODE
<af:table binding="#{backing_test1.table1}" id="table1"
value="{backing_test1.dataList}" var="myRec"/>
public void setTable1(CoreTable table1) {
this.table1 = table1;
public CoreTable getTable1() {
//create this table
table1 = new CoreTable();
CoreColumn dynamicCol;
CoreOutputText outText;
Application app=FacesContext.getCurrentInstance().getApplication();
DCIteratorBinding iter = (DCIteratorBinding)bindings.get("listAllMonthsIter");
RowSetIterator rsIter = iter.getRowSetIterator();
rsIter.reset();
Row row;
while (rsIter.hasNext()) {
row = rsIter.next();
String header = (String)row.getAttribute("element");
// element contain the value JAN, FEB...
dynamicCol = new CoreColumn();
dynamicCol.setHeaderText(header);
String currRec = table1.getVar();
outText = new CoreOutputText();
ValueBinding vb = app.createValueBinding("#{myRec.value}");
outText.setValueBinding("value",vb);
outText.setRendererType("Text");
dynamicCol.getChildren().add(outText);
table1.getChildren().add(dynamicCol);
public void setDataList(List dataList) {
this.dataList = dataList;
public List getDataList() {
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("listAllMonths");
if (operationBinding == null)
return null;
List dataList = (Vector)operationBinding.execute();
return dataList;
}Well issue is that
I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
and in an other page i need a data table having these fruits as coulmns and their details as rows...
how to achieve this..
we can not guess the number of columns before time.. so can make the estimate and hide them. -
Adding dynamic columns in Table Control
Hi All,
Can we add dynamic columns in a table control? The requirement is something like this. When the user clicks a button it should add a column to the table. Also is it possible for the same column to refer to different fields of the Internal Table of the Database table. Example. The first row in the table control must refer to MARA-MATNR and the second row must refer to MAKT-MAKTX.
Regards,
SudhindraHello Sudhindra,
If you know all the columns that the table control will ever contain, then I suppose it is possible to add and delete the columns dynamically.
What cannot be dynamic, is the determination of which coulmn would be displayed in the table control.
To elaborate, In SE51, you have to define the table control with all the possible columns. In the program, during the PBO, you can choose to hide some of these columns. When the user performs certain action (PAI), you can determine which opf the hidden columns would be displayed in the table control after the next PBO.
Coming to your second requirement, I don't think it is directly possible in case of table conrols. You will have to do some manipulation to achieve it. But even if you can I think you should not. Because, It is not elegant from a good-UI design perspective. ANd during the course of the necessary manipulations, we might have to forgo some of the features like Automatic Field Validation, Automatic Input Help etc. You can use ALV for the same.
Please be judicious in deciding which approach to consider and if you run into some more problems, please do get back with some more details like how many columns you have, how many different row-types do you want, what are the features for the fields that you wish to provide (eg. F4 help) an so on...
Regards,
Anand Mandalika. -
Create a Table Dynamically in WEB Dynpro Java with diferent type of column
Hi everyone, I have a question if is possible to create a table dynamically in Web Dynpro Java?, depending of the RFC consults create the rows dynamically, ,this table must have diferent type of columns, for example link column (when the user click this link execute an action and show a adobe interactive form in another view), image column (show an image depending of the information)
Thank you everyone
Atte IsraelHello,Israel.
Yes , it is possible through dynamic programming in wdModify of the View.
You can do this ,for example, using cell variants.
IWDTable tab = (IWDTable) view.getElement("TABLE_NAME");
IWDTableStandardCell cellV= (IWDTableStandardCell) view.createElement(IWDTableStandardCell.class,"TableStandardCell"+i);
cellV.setVariantKey("NotEditableVariant");
cellV.setCellDesign((WDTableCellDesign)wdContext.nodeTableDaysTitle().currentTableDaysTitleElement().getAttributeValue("CellDesign"+i));
IWDTextView textViewi= (IWDTextView) view.createElement(IWDTextView.class,"TextView"+i); // -- here you control the type of the object that is displayed in the cell
textViewi.bindText(dayAttrib);
cellV.setEditor(textViewi);
tabColumn.addCellVariant(cellV);
tab.addGroupedColumn(tabColumn,tab.numberOfGroupedColumns());
Using this code you can control even specific cells in the table and not only columns.
Hope this helps you,
Constantine -
How to create New columns for the Internal Table Dynamically?
HI Guys,
In my logic i have to create new columns depending on the logic which i am executing.
My requirement is .I have to display o/p like this
Material || Year || Period || Mix ratio || Vendor ||Mix Ratio || Vendor || Mix Ratio Vendor || Mix ratio || Vendor || Mix ratio.............................from table's CKMLMV003 and CKMLMV001.Her i have to display the o/p in the above format and i have to display Vendor and Mix Ratio for 5 columns irrespective of data .If i have more than 5 columns for any record then i have to create a New columns dynamically for Vendor and Mix ratio.If anybody want my code i can Submit But plz tell with example how to do?
<b>The O/P must be finally shown in ALV Grid</b>
Thanks,
GopiYou must create the entire internal table dynamically, you can not add columns to a statically define internal table. Here is an example of creating a dynamic internal table.
Creation of internal table dynamically based on the Date Range entered
Regards,
Rich Heilman -
How to add columns for existing table dynamically?
Hi,
I created table structure only. I want to add columns for this existing table. Columns are not fixed, according to the user choice i need to write code.
Plz give me reply asap.
Thanks
ShirishaHi Shirisha,
I think the following code snippet will help you.
int l_no_cols = 0;
//Get the number of columns in this variable, something like the following
//l_no_cols = wdContext().currentContextElement().get<Context_attribute_name>;
IWDTable l_tab;
IWDTransparentContainer l_tbl_cont = (IWDTransparentContainer)view.getElement("TableDataCont");//ID of Container
l_tab = (IWDTable)view.getElement("TableData");//ID of Table
l_tab.setVisible(WDVisibility.VISIBLE);
l_tab.bindDataSource(wdContext.nodeTable_Data().getNodeInfo());
for(int a = 1; a <=l_no_cols; a++)
//Creating the column
IWDTableColumn l_tab_col = (IWDTableColumn)view.createElement(IWDTableColumn.class,"COL"+a);
//Creating Caption for Column Header
IWDCaption l_tab_cap = (IWDCaption)view.createElement(IWDCaption.class,"Caption"+a);
l_tab_cap.setText("Col"+i);
l_tab_col.setHeader(l_tab_cap);
//Creating Table Cell Editor for column
IWDInputField l_tab_cell = (IWDInputField)view.createElement(IWDInputField.class,"CellEditor"+a);
//creating context node attribute for the column dynamically
wdContext.nodeTable_Data().getNodeInfo().addAttribute("Col"+i,"com.sap.dictionary.String");
l_tab_cell.bindValue(wdContext.nodeTable_Data().getNodeInfo().getAttribute("Col"+i));
l_tab_col.setTableCellEditor(l_tab_cell);
l_tab.addColumn(l_tab_col);
l_tbl_cont.addChild(l_tab);
Regards,
Alka -
Dynamic Columns in PLSQL Table
All,
Is it possible to build the columns of a PLSQL table dynamically at run time? I got a requirement wherein the number of columns are known only during the program execution.
Thanks,Offhand, I cannot see how it can be done - or even if hacked somehow, of how it can be of any use.
One need to use the right tool for the job - and PL/SQL "tables" is always the wrong tool as Oracle tables (fixed or temp) is better.
Now if you need to use associative array (and not a so-called PL/SQL "table"), then that is something very different than a so-called table.
To explain - an associative array is nothing like an Oracle table. Thus calling such an array a "table" in PL/SQL leads the developer to make gross design mistakes as the developer attempts to treat that array as he/she would an Oracle table. Even use the SQL engine on a PL/SQL data structure in the PGA.
The best place for data is in Oracle. That is why we buy and use Oracle. As soon as you want to do that in PL/SQL instead, using an array, you need to ensure that you reasons are valid. (e.g. bulk collect, etc) -
Dynamic Column Header On Table Control
Dear Friend
How I can set Dynamic Column Header Text On Table Control
Regards
SupperkornJust set it to a global variable name, and then set the value of that global variable as needed, e.g. in your TOP include define "g_my_header(20) type c" and then use g_my_header in the "Table column header" definition in the Dynpro... and in your PBO code put a value in g_my_header.
Jonathan
Maybe you are looking for
-
How to fill the master data in ecc
Hi, 0product_attr having zero records i ecc,how to fill the master data in ecc can you pls provide me the setps? Regrads, devi.
-
Hopefully the answer isn't obvious, as I failed at finding it via forum search and multiple bing/google attempts. I am a Premiere Pro novice, but working on changing that. My camcorder records AVCHD clips at roughly 2GB (11 minutes) each. I recently
-
How do i change the computer user name
I registered the computer as under my name originally. I want to change it to my daughters name. How can I do this?
-
Delete P-P CS6 after CC installation?
New to the Premiere-Pro and video side of things ... Lightroom's last few iterations have installed themselves and 'de-installed' my previous programs, nicely saving computer space (though I know some don't like that behavior). I just up-dated to CC
-
Unable to add titleIon for Panel
I tried to set an image for the property 'titleIcon' of Panel. It is giving error at compilation time..showing message "unable to resolve <.gif file path> for transcoding........ can anyone give solution fot this.............