Creating Dynamic Applet-Columns

Hi
I need to get data from a web-service in the form of stock-quotes and their prices.Once a user(e.g. having 5 stock-quotes)logs-in, the servlets calls the web-service and gets the values. Now these values need to be published to a Java-applet.
I have already achieved it technically using a GridBagLayout, but the format of the layout, in which the names and values of these scrips are published to the applet, doesn't stay same and once the applet gets refreshed, the layout gets disturbed.
Like for example, if the layout consisted of 5 rows and 2 columns when the applet was initialized, it comes as 10 columns and only a single row once it gets refreshed.
I am pasting the contents of the code with this post. Plz have a look:
* This code belongs to Covansys India Pvt Ltd., Bangalore, INDIA
* @author : EAI Team, Covansys India Pvt Ltd.
* Copyright Ravish Narula <[email protected]>
* Date:06/21/2005
import java.awt.*;
import java.applet.*;
import java.util.Date;
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.event.*;
import java.net.*;
import java.util.*;
import java.io.*;
public class StockTickerApplet30 extends Applet {
Thread t = null;
int delay = 5000;
int tCount = 0;
URLConnection servletConnection;
Hashtable stockHashtable = null;
Hashtable oldStockValues = new Hashtable();
protected void makeLabel(String name, GridBagLayout gridbag, GridBagConstraints c) {
Label label = new Label(name);
gridbag.setConstraints(label, c);
add(label);
protected void makeTextField(String value, GridBagLayout gridbag, GridBagConstraints c, char color) {
Label textField = new Label(value);
if (color == 'g')
textField.setBackground(Color.green);
else if (color == 'r')
textField.setBackground(Color.red);
else
textField.setBackground(Color.gray);
gridbag.setConstraints(textField, c);
add(textField);
public void init() {
public void paint(Graphics g) {
try {
String location = "http://localhost:7001/etrade/StockQuoteServlet";
URL testServlet = new URL(location);
servletConnection = testServlet.openConnection();
// Don't used a cached version of URL connection.
servletConnection.setUseCaches(false);
servletConnection.setDefaultUseCaches(false);
servletConnection.setDoOutput(true); // to allow us to write to the URL
//super.init();
//g.drawString("111111 Applet: before out.close() 111111",10,10 );
//Write the message to the servlet
PrintStream out = new PrintStream(servletConnection.getOutputStream());
out.close();
// Read the input from the servlet.
// The servlet will return a serialized vector containing the details.
//inputStreamFromServlet = servletConnection.getInputStream();
//setSize(getPreferredSize());
//System.out.println(" Applet: before GetInputStream()" );
ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
//System.out.println(" Applet: before readObject()" );
stockHashtable = (Hashtable) inputFromServlet.readObject();
System.out.println("The Hashtable received from Servlet is ::" + stockHashtable);
} catch (java.net.MalformedURLException me) {
//System.out.println("The Exeeption message is ::"+me);
} catch (java.io.IOException ioe) {
//System.out.println("The Exeeption message is ::"+ioe);
} catch (Exception e) {
//System.out.println("The Exeeption message is ::"+e);
// Generate UI and populate Data
GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
Panel p = new Panel();
setFont(new Font("Helvetica", Font.PLAIN, 14));
// setLayout(new GridBagLayout());
setBackground(Color.gray);
c.fill = GridBagConstraints.BOTH;
//c.fill = GridBagConstraints.VERTICAL;
// c.gridwidth=2;
// c.gridheight=stockHashtable.size();
int y = 0;
Enumeration e = stockHashtable.keys();
while (e.hasMoreElements()) {
String sName = (String) e.nextElement();
Double sValue = (Double) stockHashtable.get(sName);
//For next iteration comparision
oldStockValues.put(sName, sValue);
char color = 'w';
Double sOldValue = (Double) oldStockValues.get(sName);
int iComparision = sValue.compareTo(sOldValue);
if (iComparision > 0)
color = 'g';
else if (iComparision < 0)
color = 'r';
else
color = 'w';
c.weightx = 0.5;
c.gridx = 0;
c.gridy = y;
//c.weightx = 1.0;
//c.gridwidth = GridBagConstraints.RELATIVE;
makeLabel(sName, gridbag, c);
c.weightx = 0.5;
//c.weighty=100;
c.gridx = 1;
c.gridy = y;
c.gridwidth = GridBagConstraints.REMAINDER;
makeTextField(sValue.toString(), gridbag, c, color);
y++;
//tCount++;
//g.drawString("@@@@@@@@@@ Count of tCount is: @@@@@@@@@ "+ y ,10,10);
//setSize(getPreferredSize());
y = 0;
setLayout(gridbag);
y = 0;
//setLayout(new GridBagLayout());
validate();
//show();
try {
Thread t = Thread.currentThread();
t.sleep(5000);
y = 0;
repaint();
y = 0;
} catch (InterruptedException ie) {
*************************************************

sounds like this to me
DECLARE @ColumnList varchar(5000)
IF OBJECT_ID('PivotValues') IS NOT NULL
DROP TABLE PivotValues
SET @ColumnList = STUFF((SELECT DISTINCT ',[' + MemberValue + ']'
FROM Reporting.dbo.[MSPLT_ACNT Budget Type UserView]
FOR XML PATH('')),1,1,'')
DECLARE @Sql = 'SELECT LookupMemberUID,' + @ColumnList
+ 'INTO PivotValues FROM Reporting.dbo.[MSPLT_ACNT Budget Type UserView] t
PIVOT (MAX(MemberDescription) FOR MemberValue IN (' + @ColumnList + '))p'
EXEC(@SQL)
SELECT *
FROM (YourExistingQUery)q
INNER JOIN PivotValues p
ON p.LookupMemberUID = q.RelatedCol
You need to replace RelatedCol with actual column that has UID values (its not clear from your explanation above whether its TaskUID or ProjectUID or another column)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • JSP: Create Dynamic 2 Column Table looping through iter.hasNext()

    Hi,
    I have created an ArrayList which I populate with 2 strings per element - if such a thing exists. for example my array would have
    {ccc, email}
    {bbb,ip}
    {aaa,dsl}
    {ddd,tv}
    I then sort this list using Collections.sort in which case I end up with the following:
    aaa, dsl
    bbb, ip
    ccc, email
    ddd, tv
    However, I want display the contents in 1 table with 2 columns with a check box in front of each
    i.e.
    checkbox - aaa, dsl checkbox ccc, email
    checkbox- bbb, ip checkbox ddd, tv
    I would be happy if the table was like the above, however, even if if bbb,ip printed in the right column I would be ok.
    This list example only contains 4 rows now but it could be 5 rows, 6 rows, 7 etc. It can grow/strink so that would be dynamic as well.
    I think I need to build a for loop or while loop and to somehow spit out the contents of the first element then increment and check against total lsit and do the second td statement etc. But I am not totally sure. Anyhow, I hope I haven't confused anyone who reads this. Appreciate any help or direction. Thanks

    the reason each list element contains 2 pieces of data is so that I can keep the login and type together for sorting purposes and can probably display the login -aaa along with the correct type Email etc.
    here is a snip of the code if it will help.
    List listTmp = new ArrayList();
    ArrayList allLogins = new ArrayList();
    for(int i=0;i<service_output.length;i++)
    String[] tmpStr = new String[2];
    n = service_output.indexOf('(');
    if (n > 0)
    serviceType = service_output[i].substring(0, n);
    restOfString = service_output[i].substring(n+1);
    int atsign_index = 0;
    atsign_index = restOfString.indexOf('@');
    if ((atsign_index) > 0)
    loginPrefix = restOfString.substring(0, atsign_index);
    tmpStr[0] = loginPrefix;
    tmpStr[1] = serviceType;
    LoginServType login1 = new LoginServType (tmpStr[0], tmpStr[1]);
    allLogins.add(login1);
    serviceCount++;
    else
    continue;
    else
    continue;
    roundServices= new BigDecimal(serviceCount/maxcols).setScale(2, BigDecimal.ROUND_UP);
    Collections.sort(allLogins);
    //Iterator iter = allLogins.iterator();
    for (Iterator iter = allLogins.iterator(); iter.hasNext();)
    LoginServType loginiter = (LoginServType)iter.next();
    String tempService = myformat.translateService(loginiter.getServType());
    %>
    <table summary="" class="dataDisplay borderCollapse autoLayout width100pc">
    <colgroup>
    <col class="alignLeft width30pc" />
    <col class="alignRight width30pc" />
    </colgroup>
    <thead>
    <tr>
    <th class="alignLeft sublabel_display"></th>
    </tr>
    </thead>
    <tbody>
    <tr class="">
    <input type="checkbox" name="username" value="<%=loginiter.getLogin()%>"><%=loginiter.getLogin()%> -
    <%=tempService%>
    <%iter.next(); %>
    <input type="checkbox" name="username" value="<%=loginiter.getLogin()%>"><%=loginiter.getLogin()%> -
    <%=tempService%>
    </tr>
    </tbody>
    </div>
    <%
    }//end of for loop
    %>
    </table>
    </div>
    </div>

  • Help Creating Dynamic Stacked Column Chart with Multiple Criteria

    Hi all. Im new here and hoping you can help.  I have a dashboard Im trying to rebuild from scratch (our computer had a meltdown and we lost all our files). I did not build the dashboard initially so Im trying to recreate it from the flash file we were able to recover. I have come across a chart that I just cannot figure out how to do.  I can figure out how to write an array in the Excel sheet that pulls the data into a table the way I need it to be but found out after I wrote that that Xcelcius doesn't support arrays so all my data disappears when I go into preview mode (which is especially frustrating since I can see the chart working fine in design mode).  Anyway this is what the data table looks like
    Month         Year            Company      Positive #          Negative #         Neutral #          Positive %       Negative %      Neutral %
    October      2011            CompanyA      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyB      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyC      1234                1234                 1234                 10                    10                    10
    October      2011            CompanyD      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyA      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyB      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyC      1234                1234                 1234                 10                    10                    10
    November  2011            CompanyD      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyA      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyB      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyC      1234                1234                 1234                 10                    10                    10
    December  2011            CompanyD      1234                1234                 1234                 10                    10                    10
    The original chart was built so that you would choose the month from a combo box and then the company names would show up along the X axis with their % amounts shown in the stacked column.  I know how to make a combo box work and I know how to make a stacked column chart work with static data.  I cannot for the life of me figure out how to get it to work so that when you choose the month from the combo box it filters the data.  I've tried filtered rows but I'm just missing some information that makes it work and I can't figure out what that information is.  It has to be able to get the month/year combo from the combo box and then go to the table, filter it by month and year and then create a multi-row table of data with just the company and the percent values.  Any help would be greatly appreciated!

    Which connection you are using?
    IF quite difficult if you are working under static data.

  • In FR, how to create dynamical reference column

    In FR, can we do something like below:
    I have scenarios in the column header; while in column 1, scenario is selected from the current point of view, for example when I select Budget, I would like in column 2 to be the Actual; If I select Forecast in column 1, and I would like Budget in column 2, etc.
    Any suggestion/advise is welcome.
    Thanks

    Thanks for the reply.
    However, I was not able to find the conditional suppression based on the other column's member name (can only suppress based on its own column member name, data cell, or data cell values, etc).
    Also my requirements is a bit complicated. I also have year as my column header. I have year 2007 to 2009, and scenarios: actual, budget, F1, F2, F3.
    If I choose 2009 for example, Budget, I would like the 2nd column to be 2008 F3; If I choose 2008 F1, I would like the 2nd column to be 2008 Budget; if I choose 2008 F2, I would like the 2nd column to be 2008 F1, and so on.
    Any suggestions/advices ?

  • Create dynamic table using pojo data control

    What are the options we can in order to create dynamic table columns based on pojo data control?
    We have a class A and there are some attributes say A.x, A.y, A.z
    Within class A, we have a collection of class B and has attribute say B.k
    Within class A, we have a collection of class C and has attribute say C.j
    Every instance of class A has same number of instances of class B
    Every instance of class A has same number of instances of class C
    We would like to display a table like this
    A.x, A.y, A.z, [B.k, B.k, ...], [C.j, C.j, ...]
    How should we do that?
    Thanks

    What are the options we can in order to create dynamic table columns based on pojo data control?
    We have a class A and there are some attributes say A.x, A.y, A.z
    Within class A, we have a collection of class B and has attribute say B.k
    Within class A, we have a collection of class C and has attribute say C.j
    Every instance of class A has same number of instances of class B
    Every instance of class A has same number of instances of class C
    We would like to display a table like this
    A.x, A.y, A.z, [B.k, B.k, ...], [C.j, C.j, ...]
    How should we do that?
    Thanks

  • How to create Dynamic internal table with columns also created dynamically.

    Hi All,
    Any info on how to create a dynamic internal table along with columns(fields) also to be created dynamically.
    My requirement is ..On the selection screen I enter the number of fields to be in the internal table which gets created dynamically.
    I had gone thru some posts on dynamic table creation,but could'nt find any on the dynamic field creation.
    Any suggestions pls?
    Thanks
    Nara

    I don't understand ...
    something like that ?
    *   Form P_MODIFY_HEADER.                                              *
    form p_modify_header.
      data : is_fieldcatalog type lvc_s_fcat ,
             v_count(2)      type n ,
             v_date          type d ,
             v_buff(30).
    * Update the fieldcatalog.
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname+0(3) eq 'ABS' or
              is_fieldcatalog-fieldname+0(3) eq 'VAL' .
        move : is_fieldcatalog-fieldname+3(2) to v_count ,
               p_perb2+5(2)                   to v_date+4(2) ,
               p_perb2+0(4)                   to v_date+0(4) ,
               '01'                           to v_date+6(2) .
        v_count = v_count - 1.
        call function 'RE_ADD_MONTH_TO_DATE'
            exporting
              months        = v_count
              olddate       = v_date
            importing
              newdate       = v_date.
        if is_fieldcatalog-fieldname+0(3) eq 'ABS'.
          concatenate 'Quantité 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        else.
          concatenate 'Montant 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        endif.
        move : v_buff to is_fieldcatalog-scrtext_s ,
               v_buff to is_fieldcatalog-scrtext_m ,
               v_buff to is_fieldcatalog-scrtext_l ,
               v_buff to is_fieldcatalog-reptext .
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    endform.                     " P_MODIFY_HEADER

  • Need to create a dynamic caption(column name) in a dynamic table

    Hi All,
    I have created dynamic table .But the dynamic column is not showing.I have created two column name that is name and empId .I have tried with following code
    IWDCaption nameCap=(IWDCaption)view.createElement(IWDCaption.class,"nameCap");
    nameCap.setText("Name");
    tabColumn1.setHeader((IWDCaption)nameCap);
    IWDCaption addCap=(IWDCaption)view.createElement(IWDCaption.class,"addCap");
    addCap.setText("Address");
    tabColumn2.setHeader((IWDCaption)addCap);
    I m getting internal server error...But When i  m comented the above code i can able to see tha dynamic table withput column name..Can anyone help me
    Suman

    Hi
    IWDTableColumn tabColumn1 = (IWDTableColumn)view.createElement(IWDTableColumn.class,"N_Co");
              IWDTableColumn tabColumn2 = (IWDTableColumn)view.createElement(IWDTableColumn.class,"A_Co");
              IWDInputField nameText = (IWDInputField)view.createElement(IWDInputField.class,"N_Text");
              nameText.bindValue(attrib1);
              tabColumn1.setTableCellEditor((IWDTableCellEditor)nameText);
              IWDInputField addText = (IWDInputField)view.createElement(IWDInputField.class,"A_Text");
              addText.bindValue(attrib2);
              tabColumn2.setTableCellEditor((IWDTableCellEditor)addText);
    <b>I need to see the column name.....</b>
    for that i have written the following code...
    while writting the following code i m getting internal server error
    IWDCaption nameCap = (IWDCaption)view.createElement(IWDCaption.class,"nameCap");
    nameCap.setText("contribution_area");
    tabColumn1.setHeader((IWDCaption)nameCap);
    IWDCaption addCap=(IWDCaption)view.createElement(IWDCaption.class,"addCap");
    addCap.setText("SUM");
    tabColumn2.setHeader((IWDCaption)addCap);

  • Create dynamic column from xml file

    Hi All,
           <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  layout="absolute" backgroundColor="white" width="500" height="300" creationComplete="onload()" >
    <mx:Style>
        DataGrid {
            alternatingItemColors: #a1a1a1,#8bb8e6;       
            borderColor:#050505; borderStyle:outset;        
            color:#ffffff;       
            editable:false;         
               fontSize:11; fontWeight:bold; fontFamily:Tahoma;          
               horizontalGridLines:false;
               headerStyleName:myHeaderStyles;
                    headerSeparatorSkin:ClassReference("mx.skins.ProgrammaticSkin");    
        rollOverColor:#5CC2F7;    
        selectionColor:#E8C76D; sortableColumns:true;   
        textAlign:center; textRollOverColor:#FD0606; textSelectedColor:#1301FF;   
        variableRowHeight:true;
        verticalAlign:middle; verticalGridLines:false; verticalGridLineColor:#050505;   
    wordWrap: false; 
    .myHeaderStyles
                color: #ffffff;
                fontWeight: bold; fontFamily:Arial; fontSize:13;
    </mx:Style>
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
       import mx.charts.renderers.CircleItemRenderer;
       import mx.charts.series.ColumnSeries;
       [Bindable]
        public var myData:ArrayCollection;
    private var now:Date=new Date();
    private var str:String;
    private var st:String;
    public function onload():void
    str=String(now.getDate())+' '+String(now.getMonth())+' '+String(now.getFullYear())+' '+String(now.getHours())+' '+String(now.getMinutes()+' '+String(now.getSeconds()));
    trace(str);
    st=srv.url="Data/NumberChart.xml?rand="+str;
    trace(st);
    srv.send();
    public function onresult():void
    myData=ArrayCollection(srv.lastResult.Document.Record)
    trace(myData);
    ]]>
    </mx:Script>
    <!-- xml path (data passing) -->
      <mx:HTTPService id="srv"         result="onresult()"  /> 
      <mx:WipeRight id="myWR" duration="2000"/>
        <mx:WipeLeft id="myWL" duration="2000"/>   
        <mx:HBox label="Home Team" width="100%" height="100%" backgroundColor="white">
    <mx:DataGrid id="HomeTeam" dataProvider="{myData}" creationCompleteEffect ="{myWR}"   width="500" height="300"  headerBackgroundSkin="@Embed(source='assets/Tileimage4movieplayer_img.png')">
    <mx:columns>
    <mx:DataGridColumn id="Hcol1" headerText="Player" draggable="false" dataField="DisField" width="170" showDataTips="true" wordWrap="true"  />
    <mx:DataGridColumn id="Hcol2" headerText="Average" draggable="false" dataField="Value" width="170" showDataTips="true" wordWrap="true"  />
    <mx:DataGridColumn id="Hcol3" headerText="Matchs" draggable="false" dataField="Prefix" width="170" showDataTips="true" wordWrap="true"  />
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>
    and my xml code is...
    <?xml version='1.0' encoding='utf-8' ?>
    <Document Title='50 Runs Milestone'>
    <Record>
    <DisField>K Sangakkara</DisField>
    <Value>200.00</Value>
    <runs>50</runs>
    <Prefix>KXIP Vs DC</Prefix>
    </Record>
    <Record>
    <DisField>R Sharma</DisField>
    <Value>185.19</Value>
    <Prefix>KXIP Vs DC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>W Jaffer</DisField>
    <Value>151.52</Value>
    <Prefix>BRC Vs CSK</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>G Gambhir</DisField>
    <Value>135.14</Value>
    <Prefix>CSK Vs DD</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>M Boucher</DisField>
    <Value>125.00</Value>
    <Prefix>KKR Vs BRC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>A Gilchrist</DisField>
    <Value>119.05</Value>
    <Prefix>KXIP Vs DC</Prefix>
    <runs>50</runs>
    </Record>
    <Record>
    <DisField>S Asnodkar</DisField>
    <Value>113.64</Value>
    <Prefix>RR Vs BRC</Prefix>
    <runs>50</runs>
    </Record>
    </Document>
    it's working but i want to crete dynamic datagrid column how to do it any idea?

    I actually found this topic interesting, so I made the data and code generic and created a Flex Cookbook entry, adding the ability to remove columns as well:
    <?xml version='1.0' encoding='utf-8' ?>
    <Document>
      <Record>
        <name>Bob Smith</name>
        <age>48</age>
        <sales>$53,000.00</sales>
        <territory>Southeast</territory>
      </Record>
      <Record>
        <name>Susan Sharma</name>
        <age>37</age>
        <sales>$37,000.00</sales>
        <territory>Southwest</territory>
      </Record>
      <Record>
        <name>George Freebird</name>
        <age>52</age>
        <sales>$49,000.00</sales>
        <territory>Midwest</territory>
      </Record>
    </Document>
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
      creationComplete="srv.send();" >
      <mx:Script>
        <![CDATA[
          import mx.controls.Alert;
          import mx.collections.ArrayCollection;
          [Bindable] public var myData:ArrayCollection;
          public function onresult():void{
            myData=ArrayCollection(srv.lastResult.Document.Record)
          private function modifyColumns(evt:MouseEvent):void{
            var ac:ArrayCollection = new ArrayCollection(SalesData.columns);
            var actionTaken:Boolean = false;
            if(evt.currentTarget.label=="Remove Column"){
              for each(var col1:DataGridColumn in ac){
                if(col1.headerText == headerTxt.text){
                  ac.removeItemAt(ac.getItemIndex(col1));
                  headerTxt.text = "";
                  SalesData.columns = ac.toArray();
                  actionTaken = true;
              if(actionTaken){
                mx.controls.Alert.show("Column " + headerTxt.text + " was removed.");
              }else{
                mx.controls.Alert.show("Column " + headerTxt.text + " not found.");
            }else if(evt.currentTarget.label=="Add Column"){
              for each(var col:DataGridColumn in ac){
                if(col.headerText == headerTxt.text){
                  mx.controls.Alert.show("Column " + headerTxt.text + " already exists.");
                  return;
              var dgc:DataGridColumn = new DataGridColumn();
              dgc.headerText = headerTxt.text;
              dgc.dataField = datafieldTxt.text;
              dgc.width = 100;
              ac.addItemAt(dgc, int(columnIndexTxt.text));
              SalesData.columns = ac.toArray();
              headerTxt.text = "";
              datafieldTxt.text = "";
              columnIndexTxt.text = "";
              mx.controls.Alert.show("Column " + headerTxt.text + " was added.");
        ]]>
      </mx:Script>
      <mx:HTTPService id="srv" url="data.xml" result="onresult()"/> 
      <mx:DataGrid id="SalesData" dataProvider="{myData}" width="500" height="300">
        <mx:columns>
          <mx:DataGridColumn headerText="Name" dataField="name" width="170"/>
          <mx:DataGridColumn headerText="Sales" dataField="sales" width="170"/>
          <mx:DataGridColumn headerText="Territory" dataField="territory" width="170"/>
        </mx:columns>
      </mx:DataGrid>
      <mx:Form label="Add or Remove a Column">
        <mx:FormItem label="Enter column header text:">
          <mx:TextInput id="headerTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Enter column datafield (if adding):">
          <mx:TextInput id="datafieldTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Enter zero based new column index (if adding):">
          <mx:TextInput id="columnIndexTxt"/>
        </mx:FormItem>
        <mx:FormItem label="Click to add or remove column">
          <mx:HBox>
            <mx:Button label="Add Column" click="modifyColumns(event);"
              disabledColor="0xf1aa99"
              enabled="{headerTxt.text!=''&amp;&amp;datafieldTxt.text!=''&amp;&amp;columnIndexTxt.text! =''}"/>
            <mx:Button label="Remove Column" click="modifyColumns(event);"
              disabledColor="0xf1aa99" enabled="{headerTxt.text!=''}"/>
          </mx:HBox>
        </mx:FormItem>
      </mx:Form>
    </mx:Application>

  • Creating dynamic link in column

    Hi All,
    I am using Jdev 11.1.1.2.0 . I am getting few urls that is comma seperated. I need to seperated different URL from the value and create no of link or golink equal to no of the value.Please suggest me how to do this.
    I need to create dynamically link and put diffent url value in destination property of Link
    How can i create dynamically link .

    I created a sample app for this. Please see if it is helpful.
    http://adf-use-cases.googlecode.com/files/LinkApp.rar
    I am displaying all the employees(first name) in a department as link. For now, the link is pointing to google. You can change according to your requirement.
    The code is written in DepartmentVORowImpl.java
    +public String getEmployeeName() {+
    RowSet rowSet = getEmployees();
    RowSetIterator ritr = rowSet.createRowSetIterator("new");
    StringBuilder formattedLink = new StringBuilder("");
    String requestURL = "http://www.google.com";
    String hrefPrefix = "<a href='";
    String targetProp = "' target='_blank' class='xfd' >";
    String hrefSuffix = "</a>";
    String employeeName = null;
    +while (ritr.hasNext()) {+
    Row row = ritr.next();
    formattedLink.append(hrefPrefix).append(requestURL).append(targetProp).append(row.getAttribute("FirstName")).append(hrefSuffix).append(" | ");
    ritr.next();
    +}+
    ritr.closeRowSetIterator();
    rowSet.closeRowSet();
    if (formattedLink != null && formattedLink.length() > 0)
    employeeName =
    formattedLink.substring(0, formattedLink.lastIndexOf(" | "));
    return employeeName;
    +}+

  • Function short dump - A dynamically specified column name is unknown.

    Hello,
    I've created BRF fuction according to the  Note 1466868 - Dunning by collection strategy with BRFplus. I get short dump during simulation of function with following exception:
    "A dynamically specified column name is unknown. "
    Runtime Errors         SAPSQL_INVALID_FIELDNAME
    Exception              CX_SY_DYNAMIC_OSQL_SEMANTICS
    No.   Ty.          Program                             Include                             Line
          Name
       19 METHOD       CL_FDT_ELEMENT================CP    CL_FDT_ELEMENT================CM012   129
          CL_FDT_ELEMENT=>GET_VALUES_DDIC
       18 METHOD       CL_FDT_ELEMENT================CP    CL_FDT_ELEMENT================CM011   124
          CL_FDT_ELEMENT=>GET_VALUES
       17 METHOD       CL_FDT_WD_RENDER_VALUE_INPUT==CP    CL_FDT_WD_RENDER_VALUE_INPUT==CM00G   139
          CL_FDT_WD_RENDER_VALUE_INPUT=>VALIDATE_VALUES
    In my opinion there is uncorrect query.
    Current version:
    .  SELECT FIKRS AS VALUE NAME AS TEXT FROM FMBS_BS_T
        INTO CORRESPONDING FIELDS OF TABLE lt_value
        WHERE LANGU EQ 'E'.
    instead of:
    .  SELECT FM_AREA AS VALUE NAME AS TEXT FROM FMBS_BS_T
        INTO CORRESPONDING FIELDS OF TABLE lt_value
        WHERE LANGU EQ 'E'.
    My sap version:
    EHP4 FOR SAP ERP 6.0 / NW7.01
      SAP_BASIS     701     0003     SAPKB70103
    Do you know any note or solution  to resolve this problem.
    Best regards,
    Jacek Witczak

    Hi, I came back to working on "Dunning by collection strategy with BRFplus". According to your sugestions, I raised the level of components:
    SAP_BASIS Level 09
    SAP_ABA level 09
    PI_BASIS level 09
    SAP_BW level 09
    But still I have the same short dump.
    Shoudl we raise any other components? Maybe you know note, which resolve this problem?

  • XML Publisher - Dynamic Data Columns Issue

    Hi,
    I am creating a amortization report where I need to show the amortization schedule for unearned revenue. Customers have signed different years of contract and I need to show the amount as per their remaining contract months. So if there are 2 month remaining in the contract then I should show the data for 2 months only and if there are 10 months then I should display 10 months. If we run the report for both customers then it should display two lines in report. For first customer the data should be only for 2 months and for second row(customer) there should be data for next 10 months. These months should be columns in the report(like excel columns, not rows). I need to display all months in columns instead of rows.
    I have acheived that using Dynamic Data Columns as mentioned in the user guide. Everything is working fine except following issues -
    1. How to create page level total?_
    I have created page total in my template using <?add-page-total:TOTUREV;'UREV'?> and displaying using <?show-page-total:TOTUREV?> but when I run the report in excel format these page total do not display. These columns are static columns not dynamic.
    If I run the report in pdf format then the static column total is displayed correctly.
    2. When I run the report in excel format then report run fine and it shows all the columns properly but if I run the report in pdf format then the dynamic column are not displayed in their own columns, all the columns are overwriting each other in a single columns itself, its not expanding.
    3. How do I get the total for the dynamic columns?_
    I need to display the page level total for the dynamic columns also, how do I do that?
    4. When I run the report in excel format the 2 decimal places of the numbers are gone(it works fine in pdf output), like 12.50 becomes 12.5 and 14.00 becomes 14. I need to maintain those 2 decimal places. I have tried using <fo:bidi-override direction="ltr" unicode-bidi="bidi-override"><?format-number:CVALUE;'999999D99'?></fo:bidi-override> but this does not solve my problem completely. It shows the values correctly in excel but then I am not able to do any calculation on those columns, looks like it converts them to text values.
    Any help is really appreicated. Please let me know if you need the xml template and data file.
    Regards
    Hitesh

    Hi Hitesh,
    Can you please upload your RTF and XML template file? I will try to spend sometime on this issue.
    Cheers
    Sachin

  • SUB Totals within a Dynamic Data Column

    Has anyone ever calculated SUB Totals in a Layout with a Dynamic Data Column?
        The TOTAL for all data is expressed on the Data Column tab of the Layout as C(1):C(1) - 0FISCPER / Posting Period is the Dynamic Characteristic.  When the system actually displays the 12 columns of data for the Year, the formula for TOTAL is also adjusted - no problem here.  But the user also wants SUB Totals, by Quarter, within the Year.
        Any insight or suggections are appreciated !
    Thanks,
    Lyle

    Hello,
    use variables Q1, ..., Q4 for the quarters and create
    data colums as follows
    1 Q1 dynamic = X
    2 Total C(1)
    3 Q2 dynamic = X
    4 Total C(3)
    5 Q3 dynamic = X
    6 Total C(5)
    7 Q4 dynamic = X
    8 Total C(7)
    9 Year Total C(2)C(4)C(6)+C(8)
    Regards,
    Gregor

  • Create Dynamic table name in the select statement.

    I use oracle reports 6i to make myrep.rdf , this report created using certain select query Q1, I created a formula column in this report,
    in the formula column  I write pl/sql block statements to select the data from certain table depends on the output of a column in Q1,
    I want to make the pl/sql block dynamically enough to change the user which I select the data from depends on the connected user
    Ex: if I connected with user = 'KAM14'
    the pl/sql block will be
    select x into v_value from kam13.bil_file where .....;
    and if  I connected with user = 'KAM13'
    the pl/sql block will be
    select x into v_value from kam12.bil_file where .....;
    and so on
    how can I do this in the pl/sql block ...
    Thanks in Advance.

    I am not sure I understood properly, but I think you should create bil_file table under a different user and create synonyms  under KAM1x users.
    Regards

  • Grouping of chracateristics by using dynamic data columns

    Hi all,
    I want to create a BPS Layout (BW3.5) with the material in the lead column and a KeyFigures, the year and the salesgroup in the data column. The salesgroup is the dynamic characteristic.
    Example:
    I want to have:
    SG1 2007/   SG1 2008/   SG2 2007/   SG2 2008...
    What the system is doing is:
    SG1 2007/   SG2 2007/   SG1 2008/   SG2 2008
    My question is: how can I change the grouping of the columns from year to salesorg?
    Can anybody help me?
    Best regards,
    Rainer

    Hi Rainer,
    Thanks for your appreciation.
    I thought there is not material in your lead column, okay if your case like that i suggest you like this.
    I suggest to .
    To choose Layout Category:
    1. Key Figures in Data Column
    Define data column dynamically for : Sales Group
    And make the fiscal year, and material as lead column.
    In the data column tab, define the key-figures there and mark Dynamic checkbox.
    Or if you want to group based on the fiscal year, you can make the fiscal year as you dynamic data column.
    Hopefully it can help you a lot.
    Best regards,
    Niel.
    thanks for the points you choose to assign.

  • Dynamic DataGrid columns

    How can I get this example to wok with <mx:HTTPService>
    insead of the inline <mx:XML> ?
    Dynamic DataGrid columns
    Example of how to dynamically create DataGridColumns
    A completely dynamic DataGrid example.
    This example uses the xml from the Flexstore example. It
    examines the first product node and uses that to create the
    definitions for the columns. There is some example logic to change
    the columns properties.
    It then instantiates the GataGrid and its columns array,
    assigns the properties, and then the dataProvider, and then adds
    the dataGrid to the application container.
    The example is fully self-contained, since a portion of the
    catalog.xml file is included in the mxml.
    <?xml version="1.0" encoding="utf-8"?>
    <!-- This example uses the dataProvider to build the
    dataGrid columns dynamically -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="vertical"
    creationComplete="initApp()">
    <mx:Script><![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.controls.DataGrid;
    import mx.collections.XMLListCollection;
    import mx.controls.Alert;
    [Bindable]
    private var _xlcCatalog:XMLListCollection; //the
    dataProvider for the DG
    //run by creationComplete
    public function initApp():void
    _xlcCatalog = new XMLListCollection(xmlCatalog.product);
    //wrap the XML product nodes in an XMLListCollection
    buildDG(); //creates the dataGrid
    }//initApp
    private function buildDG():void
    var aColumnDef:Array = getColumnDefArray(); //returns a
    noraml array of objects that specify DtaGridColumn properties
    var oColumnDef:Object;
    var dg:DataGrid = new DataGrid; //instantiate a new DataGrid
    var dgc:DataGridColumn;
    var aColumnsNew:Array = dg.columns
    var iTotalDGWidth:int = 0;
    for (var i:int=0;i<aColumnDef.length;i++) { //loop over
    the column definition array
    oColumnDef = aColumnDef
    dgc = new DataGridColumn(); //instantiate a new
    DataGridColumn
    dgc.dataField = oColumnDef.dataField; //start setting the
    properties from the column def array
    dgc.width = oColumnDef.width;
    iTotalDGWidth += dgc.width; //add up the column widths
    dgc.editable = oColumnDef.editable;
    dgc.sortable = oColumnDef.sortable
    dgc.visible = oColumnDef.visible;
    dgc.wordWrap = oColumnDef.wordWrap;
    aColumnsNew.push(dgc) //push the new dataGridColumn onto the
    array
    dg.columns = aColumnsNew; //assign the array back to the
    dtaGrid
    dg.editable = true;
    dg.width = iTotalDGWidth;
    dg.dataProvider = _xlcCatalog; //set the dataProvider
    this.addChild(dg); //add the dataGrid to the application
    }//buildDG
    //uses the first product node to define the columns
    private function getColumnDefArray():Array
    //Alert.show("colcount:" + xmlCatalog.toXMLString());
    var aColumns:Array = new Array();
    var node0:XML = xmlCatalog.product[0]; //get the first
    "product" node
    var xlColumns:XMLList = node0.children(); //get its child
    nodes (columns) as an XMLList
    var xmlColumn:XML
    var oColumnDef:Object;
    for (var i:int=0;i<xlColumns.length();i++) { //loop over
    the xmlList
    xmlColumn = xlColumns;
    oColumnDef = new Object();
    oColumnDef.dataField = xmlColumn.localName(); //make the
    dataField be the node name
    switch (oColumnDef.dataField) { //conditional column
    property logic
    case "name":
    oColumnDef.width = 80;
    oColumnDef.sortable = false;
    oColumnDef.visible = true;
    oColumnDef.editable = false;
    oColumnDef.wordWrap = false;
    break;
    case "description":
    oColumnDef.width = 200;
    oColumnDef.sortable = false;
    oColumnDef.visible = true;
    oColumnDef.editable = false;
    oColumnDef.wordWrap = true;
    break;
    case "price":
    oColumnDef.width = 40;
    oColumnDef.sortable = true;
    oColumnDef.visible = true;
    oColumnDef.editable = true;
    oColumnDef.wordWrap = false;
    break;
    case "image":
    oColumnDef.width = 100;
    oColumnDef.sortable = false;
    oColumnDef.visible = false;
    oColumnDef.editable = false;
    oColumnDef.wordWrap = false;
    break;
    default:
    oColumnDef.width = 50;
    oColumnDef.sortable = true;
    oColumnDef.visible = true;
    oColumnDef.editable = false;
    oColumnDef.wordWrap = false;
    break;
    aColumns.push(oColumnDef);
    return aColumns; //return the array
    }//getColumnDefArray
    ]]></mx:Script>
    <mx:XML id="xmlCatalog">
    <catalog>
    <product productId="1">
    <name>Nokia 6010</name>
    <description>Easy to use without sacrificing style,
    the Nokia 6010 phone offers functional voice communication
    supported by text messaging, multimedia messaging, mobile internet,
    games and more</description>
    <price>99.99</price>
    <image>assets/pic/Nokia_6010.gif</image>
    <series>6000</series>
    <triband>false</triband>
    <camera>false</camera>
    <video>false</video>
    <highlight1>MMS</highlight1>
    <highlight2>Large color display</highlight2>
    </product>
    <product productId="2">
    <name>Nokia 3100 Blue</name>
    <description>Light up the night with a
    glow-in-the-dark cover - when it's charged with light you can
    easily find your phone in the dark. When you get a call, the Nokia
    3100 phone flashes in tune with your ringing tone. And when you
    snap on a Nokia Xpress-on™ gaming cover*, you'll get
    luminescent light effects in time to the gaming
    action.</description>
    <price>139</price>
    <image>assets/pic/Nokia_3100_blue.gif</image>
    <series>3000</series>
    <triband>true</triband>
    <camera>false</camera>
    <video>false</video>
    <highlight1>Glow-in-the-dark</highlight1>
    <highlight2>Flashing lights</highlight2>
    </product>
    <product productId="3">
    <name>Nokia 3100 Pink</name>
    <description>Light up the night with a
    glow-in-the-dark cover - when it's charged with light you can
    easily find your phone in the dark. When you get a call, the Nokia
    3100 phone flashes in tune with your ringing tone. And when you
    snap on a Nokia Xpress-on™ gaming cover*, you'll get
    luminescent light effects in time to the gaming
    action.</description>
    <price>139</price>
    <image>assets/pic/Nokia_3100_pink.gif</image>
    <series>3000</series>
    <triband>true</triband>
    <camera>false</camera>
    <video>false</video>
    <highlight1>Glow-in-the-dark</highlight1>
    <highlight2>Flashing lights</highlight2>
    </product>
    <product productId="4">
    <name>Nokia 3120</name>
    <description>Designed for both business and pleasure,
    the elegant Nokia 3120 phone offers a pleasing mix of features.
    Enclosed within its chic, compact body, you will discover the
    benefits of tri-band compatibility, a color screen, MMS, XHTML
    browsing, cheerful screensavers, and much more.</description>
    <price>159.99</price>
    <image>assets/pic/Nokia_3120.gif</image>
    <series>3000</series>
    <triband>true</triband>
    <camera>false</camera>
    <video>false</video>
    <highlight1>Multimedia messaging</highlight1>
    <highlight2>Animated screensavers</highlight2>
    </product>
    <product productId="5">
    <name>Nokia 3220</name>
    <description>The Nokia 3220 phone is a fresh new cut
    on some familiar ideas - animate your MMS messages with cute
    characters, see the music with lights that flash in time with your
    ringing tone, download wallpapers and screensavers with matching
    color schemes for the interface.</description>
    <price>159.99</price>
    <image>assets/pic/Nokia_3220.gif</image>
    <series>3000</series>
    <triband>false</triband>
    <camera>true</camera>
    <video>false</video>
    <highlight1>MIDI tones</highlight1>
    <highlight2>Cut-out covers</highlight2>
    </product>
    </catalog>
    </mx:XML>
    </mx:Application>

    It should work the same way.
    What problem are you having?
    Tracy

Maybe you are looking for

  • Why does my Apple TV on 5.2.1 not send audio through the optical cable to my ONKYO receiver?

    So I have my ATV hooked up to my tv through the HDMI cable because when I try do it it through my AV Receiver tx-ar608 from ONKYO then there is no picture nor any audio. The receiver works fine with anything else (e.g. bluray player, wii, playstation

  • Quelle licence acheter ? (Adobe Creative Suite 5.5 Production Premium)

    bonjour, Actuellement travailleur independant (domicile) mais souhaitant l'année prochaine prendre de nouveaux locaux, ajouter (peut-être) des machines de travail (PC) je bosse sur mac et surtout embaucher une personne (et donc avoir a plus ou moins

  • Import parametes and insert into database table suggestions

    experts need suggestions created a table with 3 fields. zstable. field dataelement type length kunnr  kunnr      char  10       key field name   dname      char   30      key field aedat aedat        dats  8 aenam  aenam       char  12 now i am creat

  • Printhead problem, L7580

    My mother has the L7580 all-in-one.  She uses it basically as a photocopy machine. Yesterday afternoon she got the printhead error message for the C/M head.  I've had this before with my L7590, and I was able to clean the printhead without difficulty

  • Best practice for partnership distributions

    I am looking for some assistance on best practice. We currently have no process for Partnership Distributions within HFM. Our partnerships we have an equity pickup rule in HFM, and our source accounts are setup to be at a cost basis. The issue become