[JS CS3] Merging table columns

Hi all,
What's the fastest way to merge columns in a table?
I'm using the following loop to merge the 4th and 5th columns in my table:
for( var f = myTable.rows.length-1; f >= 0; f-- ){
myTable.columns[3].cells[f].merge (myTable.columns[4].cells[f])
It works, but I'm working on a large table (120 pages worth) and have many instance where I need to merge columns. Using the loop above, the script takes hours to run. Is there a faster way to merge columns while keeping the rows intact?
Thanks,
Michael

I've just done some time testing with CS4 and found the following:
table = app.documents[0].stories[0].tables[0];
start = new Date();
for (var n = 0; 100 > n; n++) {
  cells = table.cells;
  for (var j = 0; cells.length > j; j++) {
    cells[j].contents = "James";
end = new Date();
alert(end - start);
takes just about the same time to run as:
table = app.documents[0].stories[0].tables[0];
start = new Date();
rowCount = table.rows.length;
columnCount = table.columns.length;
for (var n = 0; 100 > n; n++) {
  for (var c = 0; columnCount > c; c++) {
    for (var r = 0; rowCount > r; r++) {
      table.cells.item(c + ":" + r).contents = "Harry";
end = new Date();
alert(end - start);
While this version takes about half as long again:
table = app.documents[0].stories[0].tables[0];
start = new Date();
rowCount = table.rows.length;
columnCount = table.columns.length;
for (var n = 0; 100 > n; n++) {
  for (var c = 0; columnCount > c; c++) {
    for (var r = 0; rowCount > r; r++) {
      table.rows[r].cells[c].contents = "Harry";
end = new Date();
alert(end - start);
None of which is particularly surprising. But when I compared the following two scripts, I was astonished by the result:
table = app.documents[0].stories[0].tables[0];
start = new Date();
rowCount = table.rows.length;
columnCount = table.columns.length;
for (var n = 0; 100 > n; n++) {
  table.cells.everyItem().contents = "Harry";
end = new Date();
alert(end - start);
table = app.documents[0].stories[0].tables[0];
start = new Date();
rowCount = table.rows.length;
columnCount = table.columns.length;
for (var n = 0; 100 > n; n++) {
  table.cells.itemByRange(0, -1).contents = "George";
end = new Date();
alert(end - start);
The latter, using itemByRange was about a third faster than using everyItem(). 1800 milliseconds to 2700 on a 4 x 10 table.
Dave

Similar Messages

  • How to Merge ADF Table Column Header in ADF Table ?

    Hi All,
    We need to have ADF Table Column header to be "Merged",
    e.g :
    There are two columns Header : | Qty (Case) | Qty (Pack) |,
    can we customize it to display like this :
    | ----- Qty -------|
    | Case | Pack |
    where there are two rows in column header, the first one is "Merged".
    How can we do that ?
    Thank you very much,
    xtanto

    Hi Kelly,
    Thank you for your reply,
    Using Column Faced, Header I can format the header of one column Only.
    My requirement is to Merge header of two colums :
    | ----- Qty -------|
    | Case | Pack |
    'Case' &'Pack' is two different column, so I need to add one row on the header of the two colums, then 'merge' them, and add the word '----Qty----'.
    Is it possible ?
    Thank you,
    xtanto

  • Merge two column value in single column

    Team,
    I have a requirement where in I need to merge 2 column values in a single column.
    ex. I have Percent_complete column in my table. and my table has only one record.
    I need to query such that I need to store the values of percent_complete and (100- percent_complete) values in a single column.
    ex
    Percent complete has 30 value.
    I need to select 30 and 70(100-30) both in a single column.
    Thanks,

    SQL> select  *
      2    from  tbl
      3  /
    PERCENT_COMPLETE
                  30
    SQL> select  abs(grouping(1) * 100 - max(percent_complete)) percent_complete
      2    from  tbl
      3    group by rollup(1)
      4  /
    PERCENT_COMPLETE
                  30
                  70
    SQL> select  nvl(percent_complete,100 - max(percent_complete)) percent_complete
      2    from  tbl
      3    group by rollup(percent_complete)
      4  /
    PERCENT_COMPLETE
                  30
                  70
    SQL>
    SY.

  • How to map table columns to xml attributes?

    With a table like this : Column1, Column2,...
    I try to obtain it :
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1" key="column1">
    <NAME>SMITH</NAME>
    </ROW>
    <ROW num="2" key="column1">
    <NAME>ALLEN</NAME>
    </ROW>
    </ROWSET>
    And i find this but it isn't enough :
    SELECT empno "@EMPNO", ename, job, hiredate
    FROM emp
    ORDER BY empno
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1" EMPNO="7369">
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <HIREDATE>12/17/1980 0:0:0</HIREDATE>
    </ROW>
    <ROW num="2" EMPNO="7499">
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <HIREDATE>2/20/1981 0:0:0</HIREDATE>
    </ROW>
    </ROWSET>
    how to known the column name?

    I do not know what columns you are talking about, but in HTML you can merge two columns with the attribute COLSPAN="2".
    DickDral

  • How to merge two columns in WAD(column chart)

    Dear Experts,
    Please provide your valuable suggestion to get a merge two columns in one column WAD column chart.
    Example: we are having 3 fields (Budgeted value, Actual budgeted value & non budgeted value).
    In the chart to be shown, budgeted value in one column, remaining two to be merged in one column
    In below sample image Actual(Volume) column is having twe fields (Budgeted SKU value & Non budgeted SKU),
    please provide solution to get same in SAP BI/BW WAD.
    Thanks & Regards,
    Sudarsan Reddy.

    Hi..,
      With in the internal table structure you can declare one more field like NAME(30).
    And concate nate first name and last name into that NAME field of internal table and modify the internal table
    Now display this field..
    Thanks,
    Naveen.I

  • Table Columns Won't Stay Aligned

    I'm brand new to forums and discussions, so if there's any advice or  info on what to ask, mention, and where to post I'd be very grateful.   I'm trying to build a website with Dreamweaver CS5 using a 3 column  table.  I adjusted the center column to make the overflow scrollable  (for the sake of appearance, I wanted to make sure that my nav bar in  the left column wasn't continually being disfigured by the pages  resizing based on how much content the two columns have).  After I  adjusted the overflow property, the right column keeps floating way off  to the right every time I activate live view mode and when I open it in a  browser.  I've tried the properties menu for the fixed, static,  relative, etc. positioning, and even tried manually coding the  coordinates I want the column to be locked at.  All three columns are set to fixed size and positions, but I can't make the right column stay put  or even keep it inside of the actual table.  It actually floats in an  area almost at the edge of the page border, well past where the table should end (the table does not appear to resize but I'm not positive).   I've checked the obvious things like cell padding and spacing, so far  nothing explains what's going on.  Any advice?

    psifreak wrote:
    I'm brand new to forums and discussions, so if there's any advice or  info on what to ask, mention, and where to post I'd be very grateful.   I'm trying to build a website with Dreamweaver CS5 using a 3 column  table.  I adjusted the center column to make the overflow scrollable  (for the sake of appearance, I wanted to make sure that my nav bar in  the left column wasn't continually being disfigured by the pages  resizing based on how much content the two columns have).  After I  adjusted the overflow property, the right column keeps floating way off  to the right every time I activate live view mode and when I open it in a  browser.  I've tried the properties menu for the fixed, static,  relative, etc. positioning, and even tried manually coding the  coordinates I want the column to be locked at.  All three columns are set to fixed size and positions, but I can't make the right column stay put  or even keep it inside of the actual table.  It actually floats in an  area almost at the edge of the page border, well past where the table should end (the table does not appear to resize but I'm not positive).   I've checked the obvious things like cell padding and spacing, so far  nothing explains what's going on.  Any advice?
    Your navigation menu bar should NOT be disfigured by the amount of content you insert in your center and left column of the table. The reason it IS being disfigured is that you have set up the table incorrectly. I'll take a guess that you have split your naviagtion cell into the number of rows that your menu bar requires? Bad move as this WILL distort when content is fed into the other columns.
    If you really must use tables to lay out your content then DO NOT split and merge table cells. This is the fastest way to the funny farm.
    For someone of your ability what you should be doing is inserting another table in the left cell of your first table then split that into the number of rows required for you navigation menu. This method ensures that the cells are NOT linked to the first table and act independently.
    Of course for the little more advanced one would NOT even insert another table but just use <p></p> (paragraph) or <a></a> (anchor - link) tags directly in the main tables left column. Again these are independent and will NOT be affected by varing amounts of content in either of the two other table cells.
    And for the much more experienced you'd hopefully be using a <div> for construction and <li></li> (list) for the menu

  • Unable to capture the adf table column sort icons using open script tool

    Hi All,
    I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
    1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
    2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.

    Hi keerthi,
    1. I have pasted the code for the first issue
    web
                             .button(
                                       122,
                                       "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
                             .click();
                        adf
                        .table(
                                  "/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
                        .columnSort("Ascending", "Name" );
         }

  • Query to read XML from CLOB table column

    Hi
    I want an SQL to get the following information extract from a CLOB table column.
    MasterReport/sg:RptDef/sg:RptCell@RealDesc MasterReport/sg:RptDef/sg:RptCell@RealNum
    credits                              100
    debits                              100
    Sample XML data from table column is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <MasterReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sg="http://www.oracle.com/fsg/2002-03-20/" xsi:schemaLocation="http://www.oracle.com/2002-03-20/fsg.xsd">
    <sg:LDGName>Vision Portugal</sg:LDGName>
    <sg:SOBName>Vision Portugal</sg:SOBName>
    <sg:DataAccessSetName>Vision Portugal</sg:DataAccessSetName>
    <sg:InternalReportName>Model 30 Report</sg:InternalReportName>
    <sg:CustomParam10 />
    <sg:RowContext RowId="r100001">
    <sg:RowName />
    <sg:RowLineItem>Litigation Credits- Total amount from previous period</sg:RowLineItem>
    <sg:RowDispUnit>1</sg:RowDispUnit>
    <sg:RowDispFormat />
    <sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
    <sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
    <sg:RowCurrencyType>T</sg:RowCurrencyType>
    <sg:RowChangeSign>0</sg:RowChangeSign>
    <sg:RowSeq>1.0000000000000</sg:RowSeq>
    </sg:RowContext>
    <sg:RowContext RowId="r100002">
    <sg:RowName />
    <sg:RowLineItem>Litigation credits- Taxed amounts from column2 for Previous period</sg:RowLineItem>
    <sg:RowDispUnit>1</sg:RowDispUnit>
    <sg:RowDispFormat />
    <sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
    <sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
    <sg:RowCurrencyType>T</sg:RowCurrencyType>
    <sg:RowChangeSign>0</sg:RowChangeSign>
    <sg:RowSeq>2.0000000000000</sg:RowSeq>
    </sg:RowContext>
    <sg:ColContext ColId="c1000">
    <sg:ColAmountType />
    <sg:ColPeriod />
    <sg:ColPerOffset />
    <sg:ColChangeSign />
    <sg:ColPosition />
    <sg:ColSeq />
    <sg:ColWidth>100</sg:ColWidth>
    </sg:ColContext>
    <sg:ColContext ColId="c1001">
    <sg:ColName>Total</sg:ColName>
    <sg:ColDescr />
    <sg:ColDispUnit>1</sg:ColDispUnit>
    <sg:ColUnitOfMeasure>EUR</sg:ColUnitOfMeasure>
    <sg:ColLedgerCurrency>ANY</sg:ColLedgerCurrency>
    <sg:ColCurrencyType>T</sg:ColCurrencyType>
    <sg:ColDispFormat>999999999.99</sg:ColDispFormat>
    <sg:ColAmountType>YTD-Actual</sg:ColAmountType>
    <sg:ColPerOffset>0</sg:ColPerOffset>
    <sg:ColAmntId>14</sg:ColAmntId>
    <sg:ColParamId>-1</sg:ColParamId>
    <sg:ColType>A</sg:ColType>
    <sg:ColStyle>B</sg:ColStyle>
    <sg:ColPeriod>10-08</sg:ColPeriod>
    <sg:ColPeriodYear>2008</sg:ColPeriodYear>
    <sg:ColPeriodNum>11</sg:ColPeriodNum>
    <sg:ColPeriodStart>2008-10-01T00:00:00</sg:ColPeriodStart>
    <sg:ColPeriodEnd>2008-10-31T00:00:00</sg:ColPeriodEnd>
    <sg:ColChangeSign>0</sg:ColChangeSign>
    <sg:ColHeadLine1>Totals</sg:ColHeadLine1>
    <sg:ColHeadLine2 />
    <sg:ColHeadLine3 />
    <sg:ColHeadLine4 />
    <sg:ColHeadLine5 />
    <sg:ColHeadLine6 />
    <sg:ColHeadLine7 />
    <sg:ColHeadLine8 />
    <sg:ColHeadLine9 />
    <sg:ColPosition>99</sg:ColPosition>
    <sg:ColSeq>1.0000000000000</sg:ColSeq>
    <sg:ColWidth>14</sg:ColWidth>
    </sg:ColContext>
    <sg:RptDef RptId="p1001" RptDetName="Ledger=Vision PT (Vision Portugal)" RptPESegm="" RptPEVal="" RptTabLabel="Output 1 (Vision PT)">
    <sg:RptLine RptCnt="p1001" RowCnt="r100001" LineRowSeq="1.0000000000000" LinCnt="l100001">
    <sg:RptCell ColCnt="c1000" RealDesc="debits">debits</sg:RptCell>
    <sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
    </sg:RptLine>
    <sg:RptLine RptCnt="p1001" RowCnt="r100002" LineRowSeq="2.0000000000000" LinCnt="l100002">
    <sg:RptCell ColCnt="c1000" RealDesc="creditsd">credits</sg:RptCell>
    <sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
    </sg:RptLine>
    </sg:RptDef>
    <sg:TabCount>1</sg:TabCount>
    </MasterReport>
    Please help me.
    Regards
    Giri
    Edited by: user576087 on Mar 18, 2012 11:54 PM

    I'm not sure if you want the values from the attribute or the element, but this should give you a good start :
    SQL> alter session set nls_numeric_characters = ".,";
    Session altered
    SQL>
    SQL> select x.*
      2  from my_table t
      3     , xmltable(
      4         xmlnamespaces('http://www.oracle.com/fsg/2002-03-20/' as "sg")
      5       , '/MasterReport/sg:RptDef/sg:RptLine'
      6         passing xmltype(t.xmldoc)
      7         columns type    varchar2(30) path 'sg:RptCell[1]'
      8               , amount  number       path 'sg:RptCell[2]'
      9       ) x
    10  ;
    TYPE                               AMOUNT
    debits                                100
    credits                               100

  • 'sort' icon in the header of table column

    Hi everybody,
    I am using table UI element in WD ABAP. Table columns can be sorted and the method fro event 'onSort' is defined.
    On each table column header a tool tip with icons  &#9650;&#9660;  appears when the cursor is moved over the right side of the column header.
    Is it possible to make this icon appear on the right of each column header permanently? 
    Thank you for your help,
    Helen

    Hi Jörg,
    We are using IE6 or IE7. And nothing appears. ONSort action exists and defined.
    May be I will create internal message for ABAP WD.
    Kind regards,
    Helen

  • Which option to use to search text in multiple table columns

    Hi, I have a case where I have 4 db tables. On the UI there is an option to search a keyword from some columns of these 4 tables.
    Table1 = summary, description are the columns user can search on
    Table2 = project_name is the column user can search on
    Table3 = need_by_date is the column user can search on
    Table4 = owner is the column user can search on
    On the UI, user can enter a keyword and check the columns they want to search on. Out of the above, they can check one column, or more, or all.
    My question is what is the best option to use oracle text search in this case.
    Option 1 = I create a procedure to select these columns and then create an index on this procedure. In this case, is there a way to specify
    which columns to search on?
    Option 2= Create 4 separate indexes on these table/columns and then query the columns which user has selected to search on.
    Any other better idea?

    Hi,
    multicolumn only works on columns in the same table.
    If you can also query just on one field, then an index per field will be preferable. If you query always on all the fields then the one index approach is good. For this last the options are:
    1. Use User_datastore, create a procedure and a dummy column
    2. Create a materialized view for the query and build an index on this materialized view
    3. Store the fields as an xml in the main table and index the xml column.
    The maintanance of options 1 and 3 are bigger, because you need triggers to be aware of an update. Option 2 and 3 will need more storage.
    Herald ten Dam
    http://htendam.wordpress.com

  • Urgent Help Required for Check Box in Table Column

    Hi all,
    Could any body help me to solve my problem?
    First of all I have created a table whose one column is check box. The column of the tables are Name,Phone,ID,Address and a checkBox columns.In one view
    the table will be found with data. I want to click on some of the rows(suppose there are 5 rows, but based on some condition I have selected the check box of 3 rows).
    Next there will be a button(Supose SEND Button).
    After selecting the check box I want to press that button and then a new window will come which will show two tables. one for  selected rows(with the same columns name except check box) and another for Unchecked rows with the same column name(Name,Phone,ID,Address).
    Could any body help me by sending the details and code?
    Thanks and Regards.
    Sudip

    Hi Sudip,
    1) create custom controller and appropriate context structure there (dataNode(Name,Phone,ID,Address,Check))
    2) create view StartView. Map data node from custom controller to node in view. Create table and bind context node attributes to appropriate table columns.
    3) create view ResultView. Map data node from custom controller to node in view. Create 2 nodes (CheckedData, UncheckedData) with supply methods. Create filtering implementation in supply methods (add checked and unchecked node elements to appropriate nodes).
    4) create new window with resultView as default view
    4) in startView in button action handler put something like
         IWDWindowInfo _windowInfo = wdComponentAPI.getComponentInfo().findInWindows("Popup");
         IWDWindowManager manager = wdComponentAPI.getWindowManager();
         IWDWindow _window = manager.createWindow(_windowInfo, true);
         _window.open();        
    So, just tried localy and it works.
    Best regards, Maksim Rashchynski.

  • Table Column - Different UI elements in a column

    Hi,
    I have the following requirement. I need to create a table shown below.
                COLUMN1              COLUMN2
    ROW1      cell11                    cell21
    ROW2      cell12                    cell22
    I need cell11 and cell22 to be textviews and cell12 and cell21 to be inputfields. In other words, I need different cells in a table column to be of different types.
    How do I do this.
    Thank

    Hi,
    An easier way to switch between input field and text view  is to just bind the readOnly property. Why actually switch between InputField and TextView.
    Create an attribute 'EDITABLE' type Boolean in the node that is bound to the table.
    1.Create all the cell editors as input field.
    2.Bind the readOnly poperty with the attribuite 'EDITABLE'
    3.Now pass abap_true to make it a text view and abap_false to make in input enabled.
    However it is possible to switch between different UI elements using  Cell Variant .
    Check these links:
    [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/85/48a841c1dae034e10000000a1550b0/frameset.htm]
    [http://help.sap.com/saphelp_nw70ehp1/helpdata/en/56/5e9041d3c72e7be10000000a1550b0/frameset.htm]
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0e7461d-5e6c-2b10-dda9-9e99df4d136d]
    Regards,
    Radhika.
    Edited by: Radhika Vadher on May 6, 2009 7:49 AM

  • New table/column in publication breaks replication

    Hi, 
    SQL 2008R2 
    I added a control table to a database that is being replicated to a different server.  The tabled called [__Updated] has one column called [DateUpdated] of type datetime2.  I manually created the table in the subscriber, added the new table/column
    to the list of articles and ran the replication. 
    It falls over with the error shown below, any ideas? 
    2015-02-24 16:23:34.32 [95%] Generating schema scripts for article 'AAA'
    2015-02-24 16:23:34.32 [95%] Generating schema scripts for article '__Updated'
    2015-02-24 16:23:34.33 [95%] The replication agent had encountered an exception.
    2015-02-24 16:23:34.33 Source: Unknown
    2015-02-24 16:23:34.33 Exception Type: Microsoft.SqlServer.Management.Smo.FailedOperationException
    2015-02-24 16:23:34.33 Exception Message: Script failed for Table 'dbo.__Updated'.
    2015-02-24 16:23:34.33 Message Code: Not Applicable
    2015-02-24 16:23:34.33
    Exact version is: 
    SELECT @@VERSION
    Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64)
    Jun 28 2012 08:36:30
    Copyright (c) Microsoft Corporation
    Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)

    Replication is considered to be a mature technology which means there are little changes. Oracle publishing is gone and updateable subcriptions are gone. Other than that it is the same.
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

  • Problem with LinkToURL in a table column

    Hi,
    let's say we have a LinkToURL element with a text and an image. Then a click on the text OR a click on the image navigates to the given URL.
    This behaviour changes if you put the LinkToURL element in a table column. In that case the link is executed only if you click on the text, nothing happens if you click on the image (I assume this is a bug, of have I missed a detail?). If you have a LinkToURL element without a text and with an image only, this becomes a problem.
    One column of my table contains a single image, and a click on that image shall open a link. Is there another way to do this except using a LinkToURL element?
    Thanks,
    Karsten

    Hi Valery,
    yes, this hint is exactly what I needed. I just changed the LinkToURL to a LinkToAction, and this can be activated by clicking the text OR the image.
    The necessary coding in the action handler would then look like this:
    WDWindow wnd = wdComponentAPI.getWindowManager()
         .createExternalWindow("http://www.sap.com",
         "SAP Global", false);
    wnd.open();
    Thank you very much,
    Karsten

  • Open a Dynamic URL from a Table column link

    Hi,
    Jdev Version (11.1.1.6.0)
    I have requirement to open a dynamic URL from table column. Any time I click on link, it should generate dynamic URL based on column attribute and open in popup or browser. Can someone pls suggest how to achieve this.
    Thanks
    Ank

    1)If you have any parameters that needs to be passed to build that dynamicURL, just set a propertyListener on the column attribute and get the value.
    2)Then on the af:commandLink action, build your dynamicURL with the required parameters.
    3) If you URL is all together a different application which doesn't share your transaction, you can open it as below
    In the below code, urlWithParams will be your dynamicURL.
    ExtendedRenderKitService erks =
    Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    StringBuilder sbURL = new StringBuilder();
    sbURL.append("window.open(\"" + urlWithParams + "\");");
    erks.addScript(facesContext, sbURL.toString());
    You can also try the above response by user 948181.
    Hope it helps.

Maybe you are looking for