Adding dynamic columns to region

I have four tables named projects,Sharedservices,Characteristics,Quantitystructures. The Sharedservices and Characteristisc tables are linked together using Sharedservice Id field. The Quantitystructures table is linked with Projects and Characteristics tables using Project Id and Characteristic Id fields respectively. I have a form that contains three select list items one for selecting the Sharedservice. When the Sharedservice is selected the Characteristic item gets populated automatically with the selected Sharedservice Characteristcs. The third item is the timestamp displaying the months from the Month table.
The region displays Project Name and the amount of utilization for the selected Sharedservice and the corresponding Characterisctic for a particular month.
Now what I want to do is that when a Sharedservice is selected dynamic columns should be added to the region depending on the number of Characteristics the Sharedservices has and they should be linked to the amount field.
The reason to do this is that I want the end users to just select the Sharedservice and then enter the amount of utilization for the respective Characteristics instead of first selecting them one by one from the Characteristics item and then entering the utilization amount by the projects.(The amount field is present in the Quantitystructures table)
I would really appreciate any help on this issue.
Edited by: user11298661 on Jul 8, 2009 10:57 PM

Hi,
I'm not 100% clear on what is on the page. "Column" usually refers to a column in a report or tabular form. Is this what you mean? Or do you want to show individual pages items?
Is the data for the characteristics being stored as individual records on the table for each characteristic? Or, is there a single record for all characteristics for each Sharedservice and you want to show/hide some of these?
Andy

Similar Messages

  • Adding Dynamic column to datagrid at the begining of datagrid

    Hello friends,
    There is one datagrid which is static. and i m adding one dynamic column. it is get added to the end of the static datagrid
    but I want to add dynamic column at the begning of the datagrid can anybody help me on this.
    Thanking you,
    Regards,
    gajanan

    Thanks to everybody.
    finally i got the things to work using following code.
    private  function SwapGridColumns (DG:DataGrid, Col1:Number, Col2:Number):void
                    var i:Number; // Counter
                    var DP:ArrayCollection =ArrayCollection( DG.dataProvider);     //DataProvider
                    var Widths:Array = new Array ();     // the widths of the columns
                    var Columns:Array = new Array ();    // the column names
                    var Visibility:Array = new Array (); // visibility of columns
                    var HRenderer:Array = new Array ();   // Header Renderer of columns
                    var IRenderer:Array = new Array();
                    var datastore:Array = new Array ();
                    var Editable:Array = new Array();
                    var DFields:Array=new Array();
                    var Sortable:Array = new Array();
                    for (i = 0; i<DG.columns.length; i++)
                        if (i == Col1)
                            Columns.push(DG.columns[Col2].headerText);
                            Widths.push(DG.columns[Col2].width);
                            Visibility.push(DG.columns[Col2].visible);
                            HRenderer.push(DG.columns[Col2].headerRenderer);
                            IRenderer.push(DG.columns[Col2].itemRenderer);
                            Editable.push(DG.columns[Col2].editable);
                            Sortable.push(DG.columns[Col2].sortable);
                            DFields.push(DG.columns[Col2].dataField);
                        else if (i == Col2)
                            Columns.push(DG.columns[Col1].headerText);
                            Widths.push(DG.columns[Col1].width);
                            Visibility.push(DG.columns[Col1].visible);
                            HRenderer.push(DG.columns[Col1].headerRenderer);
                            IRenderer.push(DG.columns[Col1].itemRenderer);
                            Editable.push(DG.columns[Col1].editable);
                            Sortable.push(DG.columns[Col1].sortable);
                            DFields.push(DG.columns[Col1].dataField);
                        else
                            Columns.push(DG.columns[i].headerText);
                            Widths.push(DG.columns[i].width);
                            HRenderer.push(DG.columns[i].headerRenderer);
                            IRenderer.push(DG.columns[i].itemRenderer);
                            Editable.push(DG.columns[i].editable);
                            Sortable.push(DG.columns[i].sortable);
                            DFields.push(DG.columns[i].dataField);
                    // Reset the widths
                    var col:Array
                    for (i = 0; i < Columns.length; i++)
                        var DGC:DataGridColumn = new DataGridColumn(Columns[i]);
                        DGC.width = Widths[i];
                        DGC.visible = Visibility[i];
                        DGC.headerRenderer = HRenderer[i];
                        DGC.itemRenderer = IRenderer[i];
                        DGC.dataField=DFields[i];
                        DGC.sortable=Sortable[i];
                        DGC.editable=Editable[i];
                        datastore.push(DGC);
                    DG.columns=datastore;
                    // Load DP
                    DG.dataProvider = DP;
    Regards,
    gajanan

  • Adding dynamic columns in Table Control

    Hi All,
    Can we add dynamic columns in a table control? The requirement is something like this. When the user clicks a button it should add a column to the table. Also is it possible for the same column to refer to different fields of the Internal Table of the Database table. Example. The first row in the table control must refer to MARA-MATNR and the second row must refer to MAKT-MAKTX.
    Regards,
    Sudhindra

    Hello Sudhindra,
    If you know all the columns that the table control will ever contain, then I suppose it is possible to add and delete the columns dynamically.
    What cannot be dynamic, is the determination of which coulmn would be displayed in the table control.
    To elaborate, In SE51, you have to define the table control with all the possible columns. In the program, during the PBO, you can choose to hide some of these columns. When the user performs certain action (PAI), you can determine which opf the hidden columns would be displayed in the table control after the next PBO.
    Coming to your second requirement, I don't think it is directly possible in case of table conrols. You will have to do some manipulation to achieve it. But even if you can I think you should not. Because, It is not elegant from a good-UI design perspective. ANd during the course of the necessary manipulations, we might have to forgo some of the features like Automatic Field Validation, Automatic Input Help etc. You can use ALV for the same.
    Please be judicious in deciding which approach to consider and if you run into some more problems, please do get back with some more details like how many columns you have, how many different row-types do you want, what are the features for the fields that you wish to provide (eg. F4 help) an so on...
    Regards,
    Anand Mandalika.

  • Adding dynamically columns to array field

    hello..
    I am trying to create a window class with an ArrayField. The number of
    DataField s in the ArrayField s are known at run time.
    I created an nonWindow class (say Row )with an attribute FirstCol of type
    Textdata.
    I created a window class and using the window editor i created a datafield
    with
    name FirstCol which matches with the row class attribute.
    I made datafield into an arrayfield with properties, name = arfield and
    type = array of Row
    I created a datafield and named to TemplateField (used as a template for
    adding
    columns )
    On click of a button,I am able to add any number of DataField at run time
    to the ArrayField by any of the following two ways successfully.
    1) <TemplateField>.Parent = <arfield>;
    2)<arfield>.AddColumn(2,<TemplateField>);
    But i am failing both in adding data pragmatically to the added column and
    retrive data from the newly added field even after the field by the folling
    way
    <arfield>.children[2].Name='Column2';
    U can assume that all fields that are going to be added at run time are used
    to store string data.
    Please inform me if any one knows about this.
    Waiting for responance..
    Ramesh kumar reddy
    [email protected]
    PSI Data Syatems Ltd,
    Bangalore,
    INDIA.

    hello..
    I am trying to create a window class with an ArrayField. The number of
    DataField s in the ArrayField s are known at run time.
    I created an nonWindow class (say Row )with an attribute FirstCol of type
    Textdata.
    I created a window class and using the window editor i created a datafield
    with
    name FirstCol which matches with the row class attribute.
    I made datafield into an arrayfield with properties, name = arfield and
    type = array of Row
    I created a datafield and named to TemplateField (used as a template for
    adding
    columns )
    On click of a button,I am able to add any number of DataField at run time
    to the ArrayField by any of the following two ways successfully.
    1) <TemplateField>.Parent = <arfield>;
    2)<arfield>.AddColumn(2,<TemplateField>);
    But i am failing both in adding data pragmatically to the added column and
    retrive data from the newly added field even after the field by the folling
    way
    <arfield>.children[2].Name='Column2';
    U can assume that all fields that are going to be added at run time are used
    to store string data.
    Please inform me if any one knows about this.
    Waiting for responance..
    Ramesh kumar reddy
    [email protected]
    PSI Data Syatems Ltd,
    Bangalore,
    INDIA.

  • Help me adding dynamic column in JSP

    Hi!
    Can any body please tell me how to add a column DYNAMICALY in JSP?
    I am using a drilldown and I want to add the next column after every + is clicked in drilldown.
    *If you have something to e-mail then please e-mail me at my below given e-mail address.
    Regards
    Ashish Bagora
    <[email protected]>

    I guess you're referring to a column table.
    You can simply submit to server and regenerate the page or you can add the column using Javascript DOM manipulation function.

  • Dynamic columns in SBWP

    Hi.
    can any one explain stepby step process of adding dynamic columns in SBWP.
    thanks & regards,
    arul.

    hi
    Inside SBWP u2013 inboxu2014Right click on u201Ctitle u201D Tab   of INBOX  It will list down all the  possibilities  to handle columns or add columns.
    (below Inbox is writen , RIGHT CLICK ON any column name .) you will get options like Show , this will help you to add more columns
    thanks
    kakoli
    Edited by: kakoli debroy on Jul 28, 2009 1:58 PM

  • How to hide columns that are getting added dynamically to UI Element 'Table

    In SRM 7.0 while displaying a RFx, click on "responses and awards" button.
    In the response comparision tab once the user selects response number and clicks on "compare all responses".
    Item details table is displayed with fields item number,internal number,item description,........,Price etc.
    Requirement is  to hide the price column from the table.
    The UI element type is 'Table'.
    But the catch is there is no column price visible at layout design level.
    This field is getting added dynamically at run time.
    When i right click and see the 'more field help' at the front end i get the field id as 'GRP_1_COL_3_TXTV'.
    lo_table ?= view->get_element( id = 'ITEMS_TABLE' ).
    lo_column = lo_table->get_column( id = 'GRP_1_COL_3_TXTV').
    ASSERT lo_column IS NOT INITIAL.
    lo_column->set_visible( EXPORTING value = '01' ).
    I had written the above code in the pre-exit of WDDOMODIFYVIEW.
    But i am getting dump as assertion failed.it says no column by name 'GRP_1_COL_3_TXTV'.
    Please help me inhow to hide fields or buttons getting generated dynmically.
    Regards,
    Venkat Raghavan.

    Hi Anitha,
    What i understood from your question is,you want to control the table from your inputs.I have a one question for you what do you want to show defaultly i.e when you run the application what you want to show,either no table or table with some values.
    Any how i am giving solution in this way.
    If both inputs are given proper table output is displayed
    Write your below logic in the WDDOMODIFYVIEW )
    Here i am assuming that you already have a table element in the view.
    Get the values entered in the input fields and compare those 2 values ,if the condition is satisfied then bind the values which you want to show in the table to the context node.
    but if only 1 input is given a column is empty in the output table so i want to hide this column dynamically at runtime based on my inputs
    You are telling that you know the empty column.If so get the view element reference and use the REMOVE_COLUMN to remove the column.
    data:lr_table type ref to cl_wd_table,
           lr_column type ref to L_WD_TABLE_COLUMN.
    lr_table ?= view->get_element( 'TABLE1' ).
    CALL METHOD LR_TABLE->REMOVE_COLUMN
        EXPORTING
          ID          = 'TABLE1_color'
         INDEX      =
        RECEIVING
          THE_COLUMN = lr_column.
    i want to hide some empty rows also at runtime based on inputs.
    Removing the rows is very simple.if you know the key fields data of internal table from your input fields then do in this way.
    delete itab from wa where key1= "12" and key2="abd".
    Now bind the internal table to context node.
    LO_ND_hcm->BIND_TABLE(
          NEW_ITEMS            = it_final
          SET_INITIAL_ELEMENTS = ABAP_TRUE ).

  • Adding the columns dynamically in crystal report

    Hi,
      I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
    Thanks
    Sankar

    Hello Sankar,
    please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
    This sampels retrieves the table column name from the database and adds it to the report.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Add_Field_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
            CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    AddField.rpt");
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                //Get the first section in the details section
                   boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                   //Create the field object that we will add to the report and set all of its properties
                   boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                   boFieldObject.DataSourceName = "{Customer.City}";
                   boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                   boFieldObject.Left = 4 * 1440; //1440 twips per inch
                   boFieldObject.Width = 3 * 1440;
                   boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                   boFieldObject.FontColor.Font.Name = "Arial";
                   boFieldObject.FontColor.Font.Size = 10;
                   boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                   //Add the object to the report
                   boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Get the first section in the details section
                boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                //Create the field object that we will add to the report and set all of its properties
                boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                boFieldObject.DataSourceName = "{Customer.City}";
                boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                boFieldObject.Left = 4 * 1440; //1440 twips per inch
                boFieldObject.Width = 3 * 1440;
                boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                boFieldObject.FontColor.Font.Name = "Arial";
                boFieldObject.FontColor.Font.Size = 10;
                boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                //Add the object to the report
                boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;

  • How to display dynamic column added by vo.addDynamicAttribute in jspx?

    Hi,
    I met problem when programmatically add cloumn and display it on screen. Here are my steps:
    0. define a ViewObject using xml. Define a transient column Addtion2. later will add a dynamic column Addtion3, but not defined here.
    1. Implement Application Module, adding a method init() and expose it to client.
    2. In init() method, get target VO and use vo.addDynamicAttribute("Addition3"). Then iterate it use row.setAttribute("Addition3", Math.random()). Add init() to page binding and invoke it.( it's invoked )
    3. In jspx, use dynamic table. But Addition3 never shows up.
    This is my last question: Re: How to display dynamic column added by vo.addDynamicAttribute in jspx? People say I should use dynamic table.
    please have a look at my code:
    Application Module: when it runs, it will print 6 coulmns. vo.getAttributeCount() is <font color="red">6</font>.
    <pre>
    public void init() {
    ViewObject vo = this.getCountryView1();
    if (vo.getAttributeIndexOf("Addition3") == -1) {
    vo.addDynamicAttribute("Addition3");
    vo.executeQuery();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    RowSetIterator it = vo.createRowSetIterator("i1");
    while (it.hasNext()) {
    Row r = it.next();
    r.setAttribute("Addition2", Math.random());
    r.setAttribute("Addition3", Math.random());
    it.closeRowSetIterator();
    for (AttributeDef deft : vo.getAttributeDefs()) {
    System.out.println(deft.getColumnName() + ": " + deft.getName());
    System.out.println(vo.getAttributeCount()); //vo.getAttributeCount() is 6
    </pre>
    jspx: when it runs, only 5 columns are shown. Column Addition2's values are set as expected. but Column Addition3 never shows up. And #{bindings.CountryView1.attributeCount} shows <font color="red">5</font>.
    <pre>
    <af:table rows="#{bindings.CountryView1.rangeSize}"
    fetchSize="#{bindings.CountryView1.rangeSize}"
    emptyText="#{bindings.CountryView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.CountryView1.collectionModel}"
    selectedRowKeys="#{bindings.CountryView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.CountryView1.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:column headerText="#{def.name}"
    sortable="true" sortProperty="#{def.name}" id="c1">
    <af:outputText value="#{row[def.name]}" id="ot1"/>
    </af:column>
    </af:forEach>
    </af:table>
    <af:forEach items="#{bindings.CountryView1.attributeDefs}" var="def">
    <af:outputText value="#{def.name}" id="ot2"/>
    </af:forEach>
    <af:outputText value="#{bindings.CountryView1.attributeCount}" id="ot3"/>
    </pre>
    it's quite weird for me. The vo.getAttributeCount() is 6, but #{bindings.CountryView1.attributeCount} shows 5. And column Addtion3 never shows up.
    what's the matter? How can I show the dynamic added column Addtion3?
    Edited by: simon li on 2012-9-10 下午7:31
    Edited by: simon li on 2012-9-10 下午8:00

    Hi,
    Can you check the tree binding (CountryView1 - in the pagedef) and see it has the 5 attributes hardcoded in it. If yes, try removing everything and then run the page to see if it works fine.
    -Arun

  • Adding dynamic split column width to my report

    I'm trying to add a dynamic split-column-width to my report in BI Publisher. I do not have a need for a column header. I tried to add this line to my existing line of code for the cell.
    *<?split-column-width:COLUMN_DATA?>*
    C *<?split-column-width:COLUMN_DATA?>* <?for-each-group@cell:current-group();COLUMN_ORDER?> COLUMN_DATAEC
    I do not under stand the user's guide. What should be placed where to accomplish the dynamic column width and keep my current cell group?
    thank you for your time.

    In the Discoverer Plus (web version but not vieweer), go to Sheet -> Format. For each column click on Format Data and make sure Word Wrap in unchecked. Then click on Format Heading and check on Word Wrap. This will word wrap the column heading but stretch the column to maximum length of the data in the column.
    I think be default word wrap in unchecked unless otherwise specified when the workbook was created.

  • DataGrid with dynamic columns & renderers

    I'm developing using Flash Builder 4 & Flex SDK 4.1.
    I need to manage very dynamic DataGrid components and keep their definitions, which are all part of a complex item renderer of an Offers list.
    The objects structure is simplified as follows -
    Data: Model --> Offers ArrayCollection --> Offer VO --> DataGrid data ArrayCollection & DataGrid columns Array
    View: List --> Offer Item Renderer --> DataGrid
    1. Since the DataGrid's columns property accepts only an Array (not ArrayCollection), it seems like Data Binding for defining the columns is very problematic.
    I tried to bind it to the source property of an ArrayCollection that would keep my columns definitions, but it didn't really work (mainly header display bugs).
    What is the recommended way to keep the dynamic columns definition of a DataGrid?
    2. Each column can have a set of dynamic properties, so I created a "mutant" - Column VO that extends DataGridColumn and got a dynamic properties ArrayCollection on it.
    The columns got a custom header renderer that includes an icon when there are properties.
    The header renderers got 4 main states (NotSelectedWithProperties, SelectedWithProperties, NotSelectedWithoutProperties & SelectedWithoutProperties).
    However, the header renderer area seems a bit buggy when maintaning dynamic columns.
    Any thoughts on the subject?
    3. Anyway, I ended up recreating the DataGrid's columns Array very often (copying the columns definition on the offer's item renderer's dataChange event handler).
    Note that the dynamic properties can be edited when the column is selected and I copy their values from the view back to the model when entering the state NotSelectedWithProperties.
    This feels way too complicated and I really try to keep it simple, inspite of the required complexity.
    Does anyone have better ideas?
    4. In some cases the column's item renderer should also be modified into another DataGrid (grid-in-grid).
    I used the MXDataGridItemRenderer with a DataGrid and included an ArrayCollection for the "newValue" returned by the editor.
    (I use RendererIsEditor=true and on updateComplete populate that variable with the DataGrid's dataProvider contents)
    When needed, I loop though the data objects of the parent DataGrid and populate the related field with an ArrayCollection of key-value objects that are displayed on the internal DataGrid.
    After adding this feature I encounter very strange bugs -
    a. After editing the grid-in-grid values and changing the column's state (selecting & deselecting), I get the following exception:
    ArgumentError. Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/setChildIndex()
    at mx.core::UIComponent/setChildIndex().......6993....
    All I could find about this is that it might be related to some context error or something, but I'm really stuck on this one.
    b. Sometimes another column might copy value from one row to another, running over the previous value.
    I'm not sure exactly what sequence of actions causes this behavior, but it's related to that itemRenderer for sure.
    c. Switching places with a column that uses the grid item renderer (headerShift) causes a stak overflow of StyleManager that tried to get style from the DataGridItemRenderer. This one I just found out, but couldn't reproduce a second time... strange!
    I'm pretty sure this caused another problem that I don't remember at the moment.
    The bottom line is that there got to be a better way to implement this feature within this already-complicated environment.
    Maybe I'm doing something very wrong here...
    Please advice and thanks for reading all this.

    Update on item 4a -
    This was a major issue (the main reason for opening this thread really) and I managed to resolve it!
    As part of my application, I override the default DataGrid behavior for column selection (headerRelease event).
    Instead of sorting, I change the column's header looks and define it as Selected (for showing its dynamic properties and enable its deletion).
    At first I did this by setting styles, but the look didn't refresh unless I created a new instance of the header renderer.
    Later I changed thi behavior to work with states, but I left the new header renderer instance creation commands and those lines created all the mess!
    Conclusion -
    If you define a custom header renderer for your datagrid column and then a custom item renderer, don't create a new instance of your header renderer!
    It would still be nice to get some response for the other issues I raised.
    Thanks and have a nice week.

  • Importing From Flat File with Dynamic Columns

    HI
    I am using ssis 2008,i have folder in which I have Four(4) “.txt” files each file will have 2 columns(ID, NAME). I loaded 4
    files in one destination, but today I receive one more “.txt” file here we have 3 columns (ID, NAME, JOB) how can I get a message new column will receive in source. And how can I create in extra column in my destination table dynamically …please help me

    Hi Sasidhar,
    You need a Script Task to read the names and number of columns in the first row of the flat file each time and store it in a variable, then create a staging table dynamically based on this variable and modify the destination table definition if one ore more
    new columns need to be added, and then use the staging table to load the destination table. I am afraid there is no available working script for your scenario, and you need some .NET coding experience to achieve your goal. Here is an example you can refer
    to:
    http://www.citagus.com/citagus/blog/importing-from-flat-file-with-dynamic-columns/ 
    Regards,
    Mike Yin
    TechNet Community Support

  • Dynamic Columns Generation in Bex

    Hi Gurus,
    I have a requirement to create a BEX report where user will enter a starting month/fiscal period and number of months/periods on a variable screen and the Bex will generate columns dynamically. If the user does not enter anything on the variable screen, then it will generate columns for all months the current year. For example if an user enters month; 01 and number of months 6, then it should generate Aug06, Sep06, Oct06, Nov06, Dec06, Jan07 these columns and populate values(0amount) in them.
    If the user runs report on say 2/22/2007 and enters nothing on the variable screen, then it should generate Jan07, Feb07 just 2 columns for 2 months and populate values in them.
    I checked the forum and there are couple of them addressing this topic but it is not clear to me. Somebody tells to create variable in row, somebody in columns and right customer exit.
    Can some experts readdress this topic and provide a step by step guide, how to achieve this kind of report?
    Any help is really appreciated.
    Thanks.
    Sheo

    It seems like writing User Exit is the only solution.
    in User Exit, at I_STEP = 2, you check for the input user value. If, u have month entered as 01/2007 and number of months as 6, you need to calculate the lower and higher limit of fiscal/calander month you want to restrict
    So, at I_STEP = 2, you find the value of your month variable as 01/2007 and no of month variable as 6, set the low and high value of month as per your req using some sort of calculation, which will be added into columns.
    if st I_STEP = 2, entered value is NULL or " ". Set the low and high value of month starting from jan of current year (which u can set using SY-DATUM) to current month of current year.

  • Dynamic columns with Excel Source?

    I have Excel file number 1 with columns A ja B.
    I have database table with columns A,B,C,D,E,F,G,H etc. (there are 100 columns)
    I know how to import normally data with Excel Source and OLE DB Destination with Excel file 1.
    Now I have new need.
    I should be able to import dynamically Excel files with any combination of columns.
    It should be automatic import with For Each Container.
    When new files like below is imported, I should not be make any changes to SSIS.
    Excel 2) Columns A, G, X (so column A data must be added to column A in database etc)
    Excel 3) Columns B, C, G, Y (so column B data must be added to column B in database etc)
    Excel 4) Columns D, X
    IS THIS POSSIBLE WITH SSIS? HOW?
    CUSTOM CODE IS NEEDED? ANY POINTERS TO SOLUTION?
    Kenny_I

    How you are going to deal with the rows here?
    For example, 
    Excel 2) Columns A, G, X (so column A data must be added to column A in database etc)
    when Excel 3 files are processing are you going to update the record that you added in Excel
    2.
    Excel 3) Columns B, C, G, Y (so column B data must be added to column B in database etc)
    Excel 4) Columns D, X
    when Excel 4 files are processing what is your scenario for column X which you just added in
    Excel 2. Are you going to update it or add new rows here.
    As Arthur has suggested generating your package in code seems the way to go for but before that you need
    to think about all the scenarios.
    Vikash Kumar Singh || www.singhvikash.in

  • AdvancedDataGrid headerrenderer children added dynamically do not display

    The AdvancedDataGrid in Flex 3.x does not correctly render children of a custom headerrenderer when the children are added dynamically. This works correctly with the DataGrid.
    An AdvancedDataGrid has a custom headerrenderer with one field to display the column header text.
    A show button below the grid adds a text input field in the header below the column text in the header.
    When the show button is selected, the AdvancedDataGrid header sizes correctly to leave space for the field but does not display the field.
    If I drag the column, the text input field displays as I am dragging. See the 3 images below.
    I have included the 3 source files. What is the correct way to dynamically add children to an AdvancedDataGrid header?
    Thanks.
    1. AdvancedDataGrid with only the column header text:
    2. After Show is selected, the header is sized for the text field below:
    3. Only dragging the column header temporarily shows the text field:
    1. TestGrid.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="onInit(event)" width="100%" height="100%">
    <mx:Script>
    <![CDATA[
         protected function onInit(event:Event):void {
              var cols:Array = grid.columns;
              var colWidth:int = grid.width;
              var col:AdvancedHeaderColumn = new AdvancedHeaderColumn();
              col.wordWrap = true;
              col.show = false;
              var headerRenderer:ClassFactory = new ClassFactory(AdvancedHeaderLabel);
              // Add any custom properties
              headerRenderer.properties = {text: "Column1 header that wraps", dataGridColumn: col};
              col.headerRenderer = headerRenderer;
              col.headerWordWrap = true;
              cols.push(col);
              grid.columns = cols;
              grid.measuredWidth = colWidth;
         protected function showText(event:Event):void {
              var cols:Array = grid.columns;
              for each (var col:AdvancedHeaderColumn in grid.columns) {
                   col.show = show.selected;
              grid.columns = cols;
    ]]>
    </mx:Script>
         <mx:AdvancedDataGrid id="grid" height="100%" width="100%" variableRowHeight="true" editable="true" lockedColumnCount="1"/>
         <mx:Button label="Show" id="show" click="showText(event)" selected="false" toggle="true"/>
    </mx:Application>
    2. AdvancedHeaderLabel.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" verticalScrollPolicy="off">
    <mx:Script>
    <![CDATA[
         import mx.controls.TextInput;
         import mx.core.UITextField;
         // properties
         public var text:String;
         public var dataGridColumn:AdvancedHeaderColumn;
         // Column header
         public var textField:UITextField;
         // Optional text input field
         public var textInput:TextInput;
         override protected function createChildren():void {
              super.createChildren();
              // Always add the header text
              textField = new UITextField();
              textField.text = text;
              textField.multiline = true;
              textField.wordWrap = true;
              textField.percentWidth = 100;
              addChildAt(textField, 0);
         override protected function commitProperties():void {
              super.commitProperties();
              // Add the text input field?
              if (dataGridColumn && dataGridColumn.show && !textInput) {
                   textInput = new TextInput();
                   box.addChild(textInput);
         override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
              super.updateDisplayList(unscaledWidth, unscaledHeight);
              // Position and size the textInput field
              if (dataGridColumn.show && textInput) {
                   textInput.y = textField.getExplicitOrMeasuredHeight();
                   textInput.setActualSize(unscaledWidth, textInput.getExplicitOrMeasuredHeight());
         override protected function measure():void {
              super.measure();
              measuredWidth = textField.getExplicitOrMeasuredWidth();
              measuredHeight = textField.getExplicitOrMeasuredHeight();
              // Make room for the text input field
              if (textInput) {
                   measuredHeight += textInput.getExplicitOrMeasuredHeight();
    ]]>
    </mx:Script>
         <mx:VBox height="100%" width="100%" id="box" verticalAlign="bottom"/>
    </mx:VBox>
    3. AdvancedHeaderColumn.as
    package {
         import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
         public class AdvancedHeaderColumn extends AdvancedDataGridColumn {
              public var show:Boolean = false;
              public function AdvancedHeaderColumn(columnName:String=null) {
                   super(columnName);

    Thanks Hackintosh.
    It prints as it views, as a corrupt jpeg. I also dug into console and it confirmed there was an error about a corrupt jpg. The most interesting thing is if I open the bad pdf in Photoshop the whole image is there with no signs of corruption. This leads me to believe it's something with how OSx and/or Safari are rendering the jpgs. Another curious sidenote, Safari on Windows works fine but if you save the pdf, move it to a mac and open it, you get the corrupted jpg again.
    I think I'm going to try and stop swimming upstream now. At the end of the day I don't care if the images are pngs, tiffs, or eps. I'm going to try feeding a few different formats and see if that doesn't fix the problem.

Maybe you are looking for