Dynamic Positioning of Objects in a Grid (rows and columns) AS3 Tutorial

The topic of a dynamic positioning of objects in a right grid (rows and columns) comes up often so I decided to post an AS3 solution here:
http://flashascript.wordpress.com/2010/12/25/arranging-objects-into-2d-dynamic-grid-with-a ctionscript-3/

Hard to tell from your description but this might help:
http://dtptools.com/product.asp?id=atid
Bob

Similar Messages

  • Dynamic Positioning of Objects in a Grid (rows and columns) with AS3 Tutorial

    The topic of a dynamic positioning of objects in a right grid (rows and columns) comes up often so I decided to post an AS3 solution here:
    http://flashascript.wordpress.com/2010/12/25/arranging-objects-into-2d-dynamic-grid-with-a ctionscript-3/

    Hard to tell from your description but this might help:
    http://dtptools.com/product.asp?id=atid
    Bob

  • How to Position image in h:dataTable in Row and Column ?

    I have a code that loops from array and populate images, here is the code below
    <h:dataTable border="0" id="dataTable" columnClasses="onleft adjustImage, ontop albumDescription adjustImage" rows="0" value="#{album.allImageInAlbum}" var="name" style="height: 64px">
    <h:column>
    <h:graphicImage value="getimage?file=#{name.imageId}&email=#{name.usEmail}&albumId=#{name.id}"
    style="border: 6px"/>
    </h:column>               
    </h:dataTable>
    this code easily show me my images in one straight column, I actually want to do like 3 x 2 or 4 x 3.
    Is there anyone who can show me in a short code example?
    Thank you in advance.

    Thank you again BalusC. I used Tomahawk as you suggested and it works great
    for the future users who has the same question:
    1) put tomahawk.xxx.jar in to your WEB-INF/lib folder
    2) configure you web.xml
    3) put in your jsp <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t" %>
    this was my code:
                   <t:dataList id="dataTable" value="#{album.allImageInAlbum}" var="name">
                   <t:column>
                   <h:graphicImage value="getimage?file=#{name.imageId}&email=#{name.usEmail}&albumId=#{name.id}"
    style="border: 6px"/>
                   </t:column>
                   </t:dataList>
    Thank you again BalusC. :)
    Edited by: harddisk on Aug 15, 2008 9:16 PM

  • Dynamic Table - Add rows and columns in same table

    Hi there,
    I wonder if someone could help please? I'm trying to create and table where a user can add both rows and columns (preferably with separate buttons) but am having trouble trying to figure out how to do this. Is it possible? If so how? I'm not familar with script but have found examples of seprate tables where you can add a row and then another table where you can add columns and essentailly want to merge the two but cannot make it work.
    Any help much appreciated!
    Thanks,
    Ken

    It is great example....you can learn the concepts there and apply....however you may have to think twice before you implement column adding dynamically....because the technique here is make copy of what we already have and reproduce it as a new item and this technique works great for rows as they all have every thing in common. But when it comes to columns it may have unique visible identity as column head and displaying repeatedly the same column head may not look good. Of-Course you can do few extra lines of code and change the column appearance based on users input each time. Situations where users need to add additional column is very unlikely (sure your requirement might be an exception).
    Key in allowing adding/removing instances is managing design mode settings under Object>>Binding>>....and select the checkbox "Repeat <subform/row/...> for Each Data Item" and then set Min, Max and Initial count values.
    Also you need to club your effots by using simple scipt with button clicks....
    for the example refered in URL you posted following is what I did to make the first table allow Adding/Removing Rows....
    1. Opened the form in LC designer.
    2. Add two buttons AddRow & RemoveRow right next to RemoveColumn
    3. For AddRow I used following JS code....
          Table1._Row1.addInstance(1);//that means any time this button is clicked a new instance of Row1 is added use _Row2 or Row3 based on your needs
          var fVersion = new Number(xfa.host.version); // this will be a floating point number like "7.05"
          if (fVersion < 8.0) // do this for Acrobat versions earlier than 8.0
           // make sure that the new instance is properly rendered
           xfa.layout.relayout();
    4.  For RemoveRow I used following JS code....
         Table1._Row1.removeInstance(1);//Syntax is...<objectReference>.removeInstance(<index of the repeating object that needs to be removed>); //in this case since we used 1 alwasys second object from top gets deleted.
          var fVersion = new Number(xfa.host.version); // this will be a floating point number like "7.05"
          if (fVersion < 8.0) // do this for Acrobat versions earlier than 8.0
           // make sure that the new instance is properly rendered
           xfa.layout.relayout();
    5. Now time to update settings at Object>>Binding tab and set "Repeat......" and also set Min, Max and Initial count as explained above.
         Those settings needs to be updated for Row1 (or your choice of row) of the table
    6. Set the Height to Expand of the Subform, where the table is housed....  this is done under Layout pallet
    7. Save the PDF as dynamic template and verify the results...
    If you still run into issues I can send you copy that works on my machine, but you need send me an email at n_varma(AT)lycos.com
    Good luck,

  • Referring to Cursor Row and Column in Dynamic SQL

    I have a procedure that dynamically reads a schema name and table name from an input table. The code then needs to loop through all rows and columns of each table and output the data. I'm 95% done with what I want to accomplish, but there is one small bug. The line dbms_output.put(*col.column_name* || '',''); ' ||
    should refer to something like rec.col.column_name so that it gets the column of the current record. Right now it just displays the column name for each record instead of the actual value. Can anyone help me tweak the code to get the actual value?
    CREATE OR REPLACE PACKAGE BODY some_proc IS
    -- Function and procedure implementations
    PROCEDURE create_files IS
    CURSOR c_tbls IS
    SELECT * FROM tbl_list;
    l_sql VARCHAR2(4000);
    BEGIN
    --Loop through all tables
    FOR tbl IN c_tbls LOOP
    l_sql := 'DECLARE ' || ' CURSOR c_tbl_recs IS ' || ' SELECT * ' ||
    ' FROM ' || tbl.schema_name || '.' || tbl.table_name || '; ' ||
    ' t_tbl_rowtype c_tbl_recs%ROWTYPE; ' || 'BEGIN ' ||
    ' FOR rec IN c_tbl_recs LOOP ' ||
    ' FOR col IN (SELECT column_name ' ||
    ' FROM dba_tab_cols ' ||
    ' WHERE owner = ''' || tbl.schema_name || '''' ||
    ' AND table_name = ''' || tbl.table_name || '''' ||
    ' ORDER BY column_id) LOOP ' ||
    *' dbms_output.put(col.column_name || '',''); ' ||* ' END LOOP; dbms_output.put_line(''''); END LOOP; ' ||
    'END; ';
    --dbms_output.put_line(l_sql);
    EXECUTE IMMEDIATE l_sql;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(SQLERRM);
    END;
    END;

    Is it this what you are looking for?
    (it took some minutes)
    create or replace
    package some_proc is
    procedure create_files;
    end;
    CREATE OR REPLACE
    PACKAGE BODY some_proc
    IS
      -- Function and procedure implementations
    PROCEDURE create_files
    IS
      CURSOR c_tbls
      IS
        SELECT * FROM tbl_list;
      CURSOR c_cols (p_table_owner VARCHAR2, p_table_name VARCHAR2)
      IS
        SELECT column_name
        FROM all_tab_columns
        WHERE owner   =p_table_owner
        AND table_name=p_table_name
        ORDER BY all_tab_columns.column_id;
      l_sql     VARCHAR2(32000);
      separator VARCHAR2(1):=';';
    BEGIN
      --Loop through all tables
      FOR tbl IN c_tbls
      LOOP
        dbms_output.put_line('TABLE: '||tbl.schema_name||'.'||tbl.table_name);
        l_sql := 'DECLARE ' ;
        l_sql := l_sql|| '  CURSOR c_tbl_recs IS ' ;
        l_sql := l_sql||'    SELECT * FROM ' || tbl.schema_name || '.' || tbl.table_name || '; ' ;
        l_sql := l_sql||'    linenr number:=1; ';
        l_sql := l_sql||'BEGIN ' ;
        l_sql := l_sql|| ' FOR rec IN c_tbl_recs LOOP ';
        FOR c IN c_cols(tbl.schema_name,tbl.table_name)
        LOOP
          l_sql:=l_sql ||' if linenr=1 then  dbms_output.put('''||c.column_name||''||separator||'''); end if; ' ;
        END LOOP;
        l_sql :=l_sql||'  dbms_output.put_line(''''); linenr:=linenr+1; ';
        FOR c IN c_cols(tbl.schema_name,tbl.table_name)
        LOOP
          l_sql:=l_sql ||' dbms_output.put(rec.'||c.column_name||'||'''||separator||'''); ' ;
        END LOOP;
        l_sql:=l_sql||'  end loop; ';
        l_sql:=l_sql||'  dbms_output.put_line(''''); ';
        l_sql:=l_sql||'  dbms_output.put_line(''''); ';
        l_sql:=l_sql||'end;';
        EXECUTE IMMEDIATE l_sql;
      END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line(SQLERRM);
    END;
    END;
    /

  • Rows and column limit on Data Grids

    Hello,
    anyone know if there's a limit for the number of rows and columns per page in the Data Grids?
    Thanks in advance

    There is not a limit. There is a default of 1024 rows, but you can change this.
    -- Chris

  • Web Form :Number of rows and columns

    Hi All,
    I have a web form with many rows and columns . Is it possible for a user to view only a limited rows in the form ?  Not using Adhoc/Analyze option . since there are formula rows which wont appear in Analyze grid.
    The user want to see only 5 to 10 random rows in the form  ? How to do this ?
    Please help.

    I remember an option in 11.1 which allows users to dynamically add rows and I cannot find that in 11.1.2.2
    I think the user will have to always update the user variable to what he want to see.
    Regards
    Celvin
    http://www.orahyplabs.com
    http://docs.oracle.com/cd/E17236_01/epm.1112/planning_admin_11122300/frameset.htm?launch.html

  • Rows and Columns Help

    Previously in AI9 when I wanted to modify a matrix I had created using Rows and Columns, I would select the cells of the matrix and then click on Rows and Columns.  Now I have CS4 and the documentation says I should be able to do the same thing using Area Type Options.  However, when I select the cells of a matrix that I created in AI9, Area Type Options is ghosted out.  How do I modify this matrix?

    I would copy and paste in front before I try this.
    Then select the text that is place the text cursor in a the text frame you want to split or select it with a selection tool.
    then see if the Type>Area Text Options are available. They should be.
    If not that means they are object paths not Area Text.
    Click the Frame with the Area Text tool to make it a Area Text Frame now the options should be available.
    The way to tell if these are object paths is to select one and go to the Object >Path>Split into Grid and if that is available then it is an object path.
    The text engine and this feature has changed in AI CS1 and that is probably the cause for the translation to get a bit messed up.

  • Is it possible to switch the rows and columns?

    Is it possible to switch the rows and columns of a table? The reason I ask is that it would be easier for me to input the data with the number at the top of a column and the fields going down. But it would be easier to read the data with the number on the left and the fields going to the right. Is it possible to switch a table in this way?

    mahongue wrote:
    Is it possible to switch the rows and columns of a table? The reason I ask is
    that it would be easier for me to input the data with the number at the top
    of a column and the fields going down. But it would be easier to read the
    data with the number on the left and the fields going to the right. Is it
    possible to switch a table in this way?
    It sounds to me as though you wish to transpose a table so that the original is changed from rows to columns and from columns to rows, as in the following:
    Table 1
        A   B   C
    ========
    1   o   p   q
    2   r   s   t
    3   u   v   w
    Table 2
        A   B   C
    ========
    1   o   r   u
    2   p   s   v
    3   q   t   w
    You are right - it would be nice to have a menu item to magically transpose a selected block of cells. But there isn't one. So...
    One way to solve this is to use the index() and transpose() functions to accomplish row and column cell transposition. If you are going to use a 1:1 cell correspondence and change the header columns and rows also, you can use this:
       =INDEX(TRANSPOSE(Table # :: <range>),ROW(),COLUMN())
    where Table # and <range> is substituted as in the following fashion:
       =INDEX(TRANSPOSE(Table 1 :: $A$1:$C$3),ROW(),COLUMN())
    Create a second table. Copy the modified formula above with the appropriate substitutions, select the range you wish to have your transposition inserted into (must match the transposed cell dimensions of the original range), paste the forumula and voila! the cells will be transposed.
    Cautions:
    o The target table must match the swapped cell length and width dimension. For example, if the original data range is 6 columns wide by 4 rows deep, then the corresponding table or range to hold the transposition must be 4 columns wide by 6 rows deep.
    o If your transposed data block is to be offset from the origin of the new table, then you will need to include a subtractive offset into your cell formula, since in the transpose() function the data in the master data range is referenced from its position with the master range, not its cell position in the table. Such an offset is necessary because this example formula uses the target row and column numbers to arrive at indexed positions.
    For example, if the new data range is to be offset one column to the right and one row below from the target table's origin then you must subtract (-1) from the cell and from the column references in the formula:
      Example:
      =INDEX(TRANSPOSE(Table 3 :: $B$2:$D$4),ROW()-1,COLUMN()-1)
    If someone has a better solution I'd be glad to hear of it.

  • Keeping row and column headers while scrolling inside a Web Dynpro table

    Hi,
    I have to display a 2x2 matrix with storage location names on the x-axis (i.e. as Column Headers) and material names on the y-axis (i.e. row headers). The table data represents the quantities of a particular material in a particular storage location.
    I am using dynamic UI generation to create this table. It can contain as many as 150 columns and almost as many rows. I dont want a page level scrollbar, and hence, have placed my table inside a scroll container UI element with a fixed height and width.
    I need a way to let the users use the scrollbars inside the scroll container, but still let them see the row  and column headers. Is there a way that I can do this in Dynpro for Java?
    Thanks,
    Navneet Nair.

    Hi Kenn,
    You are probably better off posting this request in this forum User Interface Development in ABAP as you are more likely to get a response.
    Cheers,
    Neil.

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • Suppressing  the total row and column in OLAP datagrid

    I have created an OLAPDatagrid and everything looks fine
    except that I don't want to show the '(All)' row and column in the
    grid. Is there a way to suppress them?
    Thanks,
    Fred

    Instead of using members() in the query use children() for
    the attribute/hierarchy.

  • JTable fixed Row and Column in the same window

    Hi
    Could anyone tip me how to make fixed row and column in the same table(s).
    I know how to make column fixed and row, tried to combine them but it didnt look pretty.
    Can anyone give me a tip?
    Thanks! :)

    Got it to work!
    heres the kod.. nothing beautiful, didnt clean it up.
    * NewClass.java
    * Created on den 29 november 2007, 12:51
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package tablevectortest;
    * @author Sockan
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.event.*;
    public class FixedRowCol extends JFrame {
      Object[][] data;
      Object[] column;
      JTable fixedTable,table,fixedColTable,fixedTopmodelTable;
      private int FIXED_NUM = 16;
      public FixedRowCol() {
        super( "Fixed Row Example" );
        data =  new Object[][]{
            {      "","A","A","A","",""},
            {      "a","b","","","",""},
            {      "a","","c","","",""},
            {      "","","","d","",""},
            {      "","","","","e",""},
            {      "","","","","","f"},
            {      "","b","","","",""},
            {      "","","c","","",""},
            {      "","","","d","",""},
            {      "","","","","e",""},
            {      "","b","","","",""},
            {      "","","c","","",""},
            {      "","","","d","",""},
            {      "","","","","e",""},
            {      "","","","","","f"},
            {      "I","","W","G","A",""}};
        column = new Object[]{"A","B","C","D","E","F"};
        AbstractTableModel fixedColModel = new AbstractTableModel() {
          public int getColumnCount() {
            return 1;
          public int getRowCount() {
            return data.length;
          public String getColumnName(int col) {
            return (String) column[col];
          public Object getValueAt(int row, int col) {
            return data[row][col];
          public boolean CellEditable(int row, int col) {
            return true;
        AbstractTableModel    model = new AbstractTableModel() {
          public int getColumnCount() { return column.length-2; }
          public int getRowCount() { return data.length - FIXED_NUM; }
          public String getColumnName(int col) {
           return (String)column[col+1];
          public Object getValueAt(int row, int col) {
            return data[row][col+1];
          public void setValueAt(Object obj, int row, int col) {
            data[row][col+1] = obj;
          public boolean CellEditable(int row, int col) {
            return true;
        AbstractTableModel fixedTopModel = new AbstractTableModel() {
          public int getColumnCount() { return 1; }
          public int getRowCount() { return data.length - FIXED_NUM; }
          public String getColumnName(int col) {
           return (String)column[col];
          public Object getValueAt(int row, int col) {
            return data[row][col];
          public void setValueAt(Object obj, int row, int col) {
            data[row][col] = obj;
          public boolean CellEditable(int row, int col) {
            return true;
        AbstractTableModel fixedModel = new AbstractTableModel() {     
          public int getColumnCount() { return column.length-2; }
          public int getRowCount() { return FIXED_NUM; }
          public Object getValueAt(int row, int col) {
            return data[row + (data.length - FIXED_NUM)][col+1];
        table = new JTable( model );
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        fixedTable = new JTable( fixedModel );
        fixedTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        fixedTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        fixedColTable= new JTable(fixedColModel);
        fixedColTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        fixedColTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        fixedTopmodelTable = new JTable(fixedTopModel);
        fixedTopmodelTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        fixedTopmodelTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);   
        JScrollPane scroll      = new JScrollPane( table );
         scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
         scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        JScrollPane fixedScroll = new JScrollPane( fixedTable ) {
          public void setColumnHeaderView(Component view) {}
        fixedScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        fixedScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
        JScrollBar bar = scroll.getVerticalScrollBar();
        JScrollBar dummyBar = new JScrollBar() {
          public void paint(Graphics g) {}
        dummyBar.setPreferredSize(bar.getPreferredSize());
        scroll.setVerticalScrollBar(dummyBar);
        final JScrollBar bar1 = scroll.getHorizontalScrollBar();
        JScrollBar bar2 = fixedScroll.getHorizontalScrollBar();
        bar2.addAdjustmentListener(new AdjustmentListener() {
          public void adjustmentValueChanged(AdjustmentEvent e) {
            bar1.setValue(e.getValue());
        JViewport viewport = new JViewport();
        viewport.setView(fixedColTable);
        viewport.setPreferredSize(fixedColTable.getPreferredSize());
        fixedScroll.setRowHeaderView(viewport);
        fixedScroll.setCorner(JScrollPane.UPPER_LEFT_CORNER, fixedColTable
            .getTableHeader());   
        JViewport viewport2 = new JViewport();
        viewport2.setView(fixedTopmodelTable);
        viewport2.setPreferredSize(fixedTopmodelTable.getPreferredSize());
        scroll.setRowHeaderView(viewport2);
        scroll.setCorner(JScrollPane.UPPER_LEFT_CORNER, fixedTopmodelTable
            .getTableHeader()); 
        scroll.setPreferredSize(new Dimension(600, 19));
        fixedScroll.setPreferredSize(new Dimension(600, 100)); 
        getContentPane().add(     scroll, BorderLayout.NORTH);
        getContentPane().add(fixedScroll, BorderLayout.CENTER);   
      public static void main(String[] args) {
        FixedRowCol frame = new FixedRowCol();
        frame.addWindowListener( new WindowAdapter() {
          public void windowClosing( WindowEvent e ) {
            System.exit(0);
        frame.pack();
        frame.setVisible(true);
    }

  • Table name input. and output i need  all rows and columns  using procedures

    hi,
    question: table name input. and output i need all rows and columns by using procedures.
    thanks,
    To All

    An example of using DBMS_SQL package to execute dynamic SQL (in this case to generate CSV data in a file)...
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • Report with multiple dimensions in Row and Column with EvEXP

    Hi
    We are currently running BPC 7.0 SP3 and try to create the report(or schedule) with more 2 x 2 dimensions in the row and column.
    e.g.
    row dimension : Outer row is Entity, Inner row is Account
    column dimension : Outer column is Time, Inner row is Category
    We created the report with  2 x 2 dimensions like above e.g. with EvEXP and EvNXP, NOT EvDRE
    based on default dynamic template:Template13.xlt(Nested Row, 2 x 1 dimensions defined by EvEXP and EvNXP formula).
    However, when expanding the dimension with double click these dimensions or change CV of the report with  2 x 2 dimensions defined by EvEXP and EvNXP formula,
    error occurs on EvEXP and EvNXP formula and can't retrieve the result correctly.
    [Question]
    Can't we create the report with more 2 x 2 dimensions in the row and column using EvEXP and EvNXP function ?
    We understand that we can make the report with more 2 x 2 dimensions in the row and column if using EvDRE.
    Thank You in advance
    Kenya

    Thank you for your advice.
    I understand that we should use EvDRE when creating the report with multiple dimension in the row/column because EvEXP have some erros, poor performance, etc.
    Then, we have two questions.
    1)
    >plus they had some errors in the designs.
    what kind of errors they have as an example?
    2)
    >If you must build the EVEXP and EVNXP, I would suggest building the template from scratch
    We built the simple template with just 2 x 2 dimension from scratch.
    But this report doesn't work well when double-click the dimension or changing CV...
    Would you please check the following template?
    <https://sapmats-de.sap-ag.de/download/download.cgi?id=RCZE1ME4YSORY3DCDO4NNMANZLBL1L5ZBUOB2F71YVNVS8XDJW>
    It would be greatly appreciated if you could give me your advice for the template.
    Thank you again
    And my best regards,
    Kenya

Maybe you are looking for

  • What is new in S227

    Does anyone have an ideea what is new in the newly release of S227 for P780?

  • Stored procedure which returns date error

    if have a function getGmtDate in the package pa which uses a date as parameter and returns a date conn.Connect() strSQL = "pa.getGmtDate" P_RETURN As New OracleParameter(":pRETURN", OracleDbType.Date, ParameterDirection.ReturnValue) Dim P_DATE As New

  • Find and delete duplicate fotos in iphotos 9.5

    How do I find and delete duplicate fotos in iphotos 9.5

  • Is there any rowclick event in h:dataTable?

    Hi All, I'm in a critical situation where i need to get the rowdata at my backing bean on click of a row. And i need to display some details of the clicked row in the same page itself. I could find a work around to get the rowdata using radio button

  • FRM-99999: Failed to connect to the Server / UNIX

    Upon invoking http://hostname.domainname:1080/web_html/olftest.htm I am getting the following error: FRM-99999: Failed to connect to the Server: hostname.domainname:9000 We are using the following: ========================= Server: Unix : Sun Solaris