How to add  dynamic column  in jfreereport

hi,
i am working on a project aboit accounting package.
i had created a report in jfreereport .. buti am facing the problem of dynamic column addition in that..
i have to create the number of column as per user given range that will from 2 to 365
i had generated column for that
that should be like
1 - 5 , 6 -10 , 11 - 15 , etc...
how can i represent that alll column in print preview i can't represent that report in horizontal fashion . is there any way to display it ..
this report has no bound in horizontal or verticle means i have any number of rows or columns..
pls help.
kamlesh

hi,
that means u have fixed columns right? ie 5 columns in a report
if it write, than u can find out how u can rename the columns with exiting
one.
that means while runing report u have to pass all the 5 columns to report
instead of the exiting columns (ie rename the columns that u want add
columns)
u have to search in code for renaming in the code ie jfreereport package.
i think u understood.
daya

Similar Messages

  • HOW to add Dynamic Columns in ADF Faces CORE Table

    In ADF im going to display the dynamic column in Coretable,
    Header are displaying very fine. but im unable to display rows sucessfuly,how to resolve.
    Second thing is that JSF page isn't getting the value from dataList, whats wrong in JSF code.
    // JSF PAGE CODE
         <af:table binding="#{backing_test1.table1}" id="table1"
    value="{backing_test1.dataList}" var="myRec"/>
         public void setTable1(CoreTable table1) {
         this.table1 = table1;
         public CoreTable getTable1() {
    //create this table
    table1 = new CoreTable();
    CoreColumn dynamicCol;
    CoreOutputText outText;
    Application app=FacesContext.getCurrentInstance().getApplication();
    DCIteratorBinding iter = (DCIteratorBinding)bindings.get("listAllMonthsIter");
    RowSetIterator rsIter = iter.getRowSetIterator();
    rsIter.reset();
    Row row;
    while (rsIter.hasNext()) {
    row = rsIter.next();
    String header = (String)row.getAttribute("element");
    // element contain the value JAN, FEB...
    dynamicCol = new CoreColumn();
    dynamicCol.setHeaderText(header);
    String currRec = table1.getVar();
    outText = new CoreOutputText();
    ValueBinding vb = app.createValueBinding("#{myRec.value}");
    outText.setValueBinding("value",vb);
    outText.setRendererType("Text");
    dynamicCol.getChildren().add(outText);
    table1.getChildren().add(dynamicCol);
    public void setDataList(List dataList) {
    this.dataList = dataList;
    public List getDataList() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("listAllMonths");
    if (operationBinding == null)
    return null;
    List dataList = (Vector)operationBinding.execute();
    return dataList;
    }

    Well issue is that
    I have a list of values that can be chnaged any time during application execution sya its list of Fav Fruits..
    and in an other page i need a data table having these fruits as coulmns and their details as rows...
    how to achieve this..
    we can not guess the number of columns before time.. so can make the estimate and hide them.

  • How to add dynamic columns & rows

    I want to display the data in the columns (seperated by partition) of the fieldNames I select.
    Suppose my Query is like
    Select Fax,Phone from Customers
    Now I want to display the data of Fax& Phone in two different columns & its heading as also Fax & Phone
    My code for the same is like this
    This is my Northwind.jsp
    <%@ taglib uri = "http://java.sun.com/jsf/core" prefix = "f"%>
    <%@ taglib uri = "http://java.sun.com/jsf/html" prefix = "h"%>
    <f:view>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <HTML>
            <HEAD>
                <TITLE>Northwind</TITLE>
                <LINK REL = "STYLESHEET" HREF = "./css/styles.css" TYPE = "text/css">
            </HEAD>
            <BODY>
                <CENTER>
                    <TABLE BORDER = 5>
                        <TR>
                            <TH CLASS = "TITLE">
                               Northwind Database
                            </TH>
                        </TR>
                    </TABLE>
                    <P>
                    <h:panelGrid id="MainGrid" />
                    <h:dataTable binding="#{fieldList.dataTable}"
                        value= "#{fieldList.data11}"
                        var= "#{row}" border="1"
                        id="RootTable" />
                </CENTER>
            </BODY>
        </HTML>
    </f:view>My java code for the same is as follows
    public UIData getDataTable()
        javax.faces.component.UIViewRoot root = FacesContext.getCurrentInstance().getViewRoot();
        UIComponent panelGrid1= root.findComponent("MainGrid");
        UIComponent  datatable = panelGrid1.findComponent("RootTable");
        UIData dataTable= new UIData();
        UIColumn col;
        UIOutput out = null;
        Application app = FacesContext.getCurrentInstance().getApplication();
        int ctr=getCounter();
        int colCount = 1;
        for(int j = 0; j < colCount; ++j)
            out = new UIOutput();
            col = new UIColumn();
            HtmlOutputText headerComponent = new HtmlOutputText();
            headerComponent.setId("Header1"+ctr);
            col.setHeader(headerComponent);
            headerComponent.setValue(fieldName);
            ValueBinding vb = app.createValueBinding("#{data11}");
            out.setValueBinding("value", vb);
            out.setRendererType("javax.faces.Text");
            col.getChildren().add(out);
            dataTable.getChildren().add(col);
            ctr++;
        panelGrid1.getChildren().add(dataTable);
        return dataTable;
    public Result getData11()
        System.out.println("In getData11");
        try
                Context context = new InitialContext();
                Map sessionMap=FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
                FieldList flist=(FieldList)sessionMap.get("fieldList");
                DataSource dataSource =
                (DataSource)context.lookup("java:comp/env/jdbc/Northwind");
                Connection connection = dataSource.getConnection();
                Statement statement = connection.createStatement();
                String query = getQuery();
                System.out.println("In getData11 ::query::::::::"+query);
                ResultSet resultSet = statement.executeQuery(query);
                ResultSetMetaData rsmd = resultSet.getMetaData();
                int numberOfColumns = rsmd.getColumnCount();
              //  System.out.println("resultSet.getMetaData() numberOfColumns="+numberOfColumns );
               for(int ii=1;ii<=numberOfColumns;ii++)
                   System.out.println("rsmd.getColumnName(ii)::::::::"+rsmd.getColumnName(ii));
                System.out.println("numberOfColumns::::::::"+numberOfColumns);
                boolean b = rsmd.isSearchable(1);
                Result result=ResultSupport.toResult(resultSet);
                return(result);
                } catch(Exception e)
                System.out.println("Connection error "+e);
                return(null);
    }Here I am not getting the data but I am getting the header name with no data in it.
    Can Anybody tell what is wrong in the code or how it should be done.

    Hi,
    You can add columns dynamically ,
    In your bean code
    private UIColumn mycolumn = new UIColumn();
    public UIColumn getMyColumn() {
    return mycolumn ;
    public void setMyColumn(UIColumn uic) {
    this.mycolumn = uic;
    and in your jsf page
    <h:column binding="#{YourBean.mycolumn }" id="column1">
    <h:outputText value="My Value"/>
    <f:facet name="header">
    <h:outputText value="My Header"/>
    </f:facet>
    </h:column>

  • FBL5N : how to add a column of the Account's name?

    Hi,
    the list displayed by Tcode : FBL5N contain only the number of account, please how to add a column of Account's name ?
    Please advise
    Regards.

    When you are in the FBL5N display results screen, use the menu option Settings --> Special Fields. 
    There are also the following notes which would explain you how to add special or new fields to the line items :
    - 310886     Line items: Dynamic selections ignored
    - 215798     FBL*N: Special fields are not displayed
    - 373268     Line item: new display field
    The special field has to exist in table T021S.

  • 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

  • How to add a column in table control

    Hi ,
       Can any one tell me how to add a column in table control? My requirement is to add two columns ( custom fields ) into table control ( It is a standard program). I have added the column in the table and also in the table control. But when I am running the standard program, The newly added column is not there. But I have added in the perticular screen. Change is not reflected.
       Can anyone help me on this please.
    Thanks in advance.
    Regards,
    Lakshmi.

    Hi,
    Ensure the following :
    1. After adjusting the database, you`ll have to use the database utility and activate the table.
    2. If you have changed the standard screen, in tcode se80 -- right click on the program and click activate all. This activates all objects related to that program.
    Now execute the program.
    Reward if helpful.
    Regards

  • How to add different columns in a single dashboard prompt?

    Hi
    I am new to this forum. I got a new requirement, my client is asking me to show multiple columns with multiple tables in a single dashboard prompt
    for Ex: Column name Table name
    1. Customer 1. Customer Details
    2. Market 2. Region
    3. Order 3. Order Status
    4. Product 4. Product Type
    He wants to show all these column names in a single prompt when user click on the particular column name it should appear on report. Is it Possible? if possible tell me how?

    See this thread...
    Re: How to add new columns by using Multiselect

  • How to add two columns in OBIEE report?

    Hi to All,
    Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
    Thanks in Advance,
    Thenmozhi

    Assume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
    For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
    Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
    Let me know if you are looking for something else.
    Thanks

  • HOW TO: Add /manipulate columns for a GridControl

    HOW TO: Add /manipulate columns for a GridControl when the columns (attributes) are from different entity objects.
    This HOWTO describes the basic steps of using attributes from different entity objects for a GridControl.
    One way you can create a GridControl which contain attributes from different entity objects is to create a view object and base it on the entity objects which contain
    the desired attributes.
    Here are the basic steps:
    1.Create a new view object (or use an existing view object) by selecting File>New from the menu, clicking the Business Components tab and double-clicking
    on the View Object icon.
    2.In the View Object wizard change the name to something meaningful.
    3.Select the entity objects you will base your view object on.
    4.Nivigate to the attribute screen and select the attributes you would like to include in your view object from each entity object. At this point you can also create
    a new attribute by clicking the "New" button. The new attribute can be a concatenation of other attributes, derived from a calculation etc.
    5.In the query panel of the View Object wizard, click "Expert mode" and enter a query statement. You write complex queries such as decoding a set of attribute
    values.
    6.Add your newly to your newly created view object to the application module by double-clicking on the application module in the navigation pane and selecting
    your view object from the list.
    7.Create a new row set.
    8.Bind row set to a query by editing their queryinfo property and selecting your view object and its attributes from the queryInfo pane.
    9.Create a GridControl and bind it to the row set by editing the dataItemName property of the GridControl. Since the GridControl is bound at the row set level
    all of the related attributes are automatically added.
    null

    Michael,
    Are you intending this as a commercial solution or a work around?
    To take an existing equivalent, one would build a view in the database tailored for each grid in an Oracle Forms application. Or a separate query layered over tables for each form/grid in a Delphi or Access application? Even if it is ninety nine percent the same over half a dozen forms/grids?
    And now you've added a whole slew of "slightly different" rowSetInfos to maintain.
    So if you wanted to add a column that needs to appear everywhere... you've just increased the workload multi-fold?
    That would be a management nightmare, wouldn't it? Not to mention yet more performance cost and a slower system?
    Hmmmm..... I'm not sure I like where this is headed... someone needs to do some convincing...
    null

  • Office 365 - sharepoint: In Advanced search Page, How to add custom column under property restrictions

     In Advanced search Page, How to add custom column under property restrictions?

    Hi,
    The Navigation control can be added into your HTML page in the Snippet Gallery:
    The two links below about how to create HTML master page and adding snippets needed into it for your reference:
    http://borderingdotnet.blogspot.jp/2012/12/how-to-create-html-masterpage-for.html
    http://msdn.microsoft.com/en-us/library/office/jj822370(v=office.15).aspx
    Feel free to reply if there still any question.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to add multiple columns?

    Using designer API, how to add multiple columns to the repository tables? I want to add number of columns at a time instead of adding column by column.
    Thanks in advance.

    Can you use sqlplus?
    ALTER TABLE table_name ADD (column_name data_type), (Column_name datatype),...
    Check the SQL Reference 11-9.
    Hope this helps.
    Bill Swanson

  • How to add one column in existing search help.

    Hi Folks,
    My quesion is
    How to add one column in existing search help and also Now search help on that field is not an explicit search help. It should be implement using check table.
    Shivam

    Hi,
    If you want to add a field in Elementary search help, get the search help name for the and go to change mode and add the field in it.
    If you want to add a field in collective search help, go to included search helps tab and a new search help name and add the fields to it.
    I think this should help you to certain extent.
    Regards,
    Kranthi
    Edited by: Kranthi on Jan 14, 2010 11:15 AM

  • How to add one column to the standard t.code : CAT2.

    Hi,
    How to add one column to the standard t.code : CAT2.
    thanks

    Hi Chinna
    see the  enhancements by using SMOD <b>CATS0007</b> , or <b>CATS0012</b> and create a project using CMOD and you can implement your requirement.
    Hope This Info Helps YOU.
    <i>Reward Points If It Helps YOU.</i>
    Regards,
    Raghav

  • How to add new columns in predefined matrix  in system form

    Hi all,
    I am new to SAP B1. I am going to add New column to Good Receipt PO matrix. I faced the one error " Matrix Line Exists " While adding new column to good receipt PO matrix".
    =========================================================
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
                 oMat = oForm.Items.Item("38").Specific
                   oCols = oMat.Columns
                    oCol = oCols.Item("U_MyCol")
            If pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_LOAD And pVal.BeforeAction = True And pVal.FormType = "143" Then
                Try
                    oForm = SBO_Application.Forms.Item(pVal.FormUID)
                    oMat = oForm.Items.Item("38").Specific
                    oCols = oMat.Columns
                    'oCol = oCols.Item("U_MyCol1")
       oCol = oCols.Add("U_MyCol1", SAPbouiCOM.BoFormItemTypes.it_EDIT)
                    oCol.TitleObject.Caption = "Qty Accepted"
                    oCol.Width = 40
                    oCol.Editable = True
                    oCol = oCols.Item("U_MyCol1")
                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try
            End If
    oDBDataSource = oForm.DataSources.DBDataSources.Add("PDN1")
            ''oEdit.DataBind.SetBound(True, "PDN1", "U_QtyAccepted")
    ============================================================
    And i also added for Datasource to Databind. what there is no result ??i wanted Clear information regarding this to add new columns in matrix in  middle of Matrix items. I wanted Clear coding& information for this to add new Columns in Matrix ?help me regarding this asap??
    Regards
    ANAND

    Anand,
    If you use the "search" feature of this forum and type "add column", you will find many posts that may help you such as this one ...
    How to add a column on sales order matrix?
    HTH,
    Eddy

  • How to add Two Columns in SQL

    How to add Two Columns in SQL
    For Example
    Jan Feb
    215 NULL
    How to add these two values in SQL

    Anything + NULL is NULL.
    Check this:
    SQL> SELECT 1 + NULL from dual;
        1+NULL
    SQL> You have to do this:
    SQL> with t as (SELECT 235 JAN, NULL FEB FROM dual)
      2  SELECT NVL(JAN,0) + NVL(FEB,0) FROM t;
    NVL(JAN,0)+NVL(FEB,0)
                      235
    SQL>

Maybe you are looking for

  • How to avoid record rejection due to conversion failed for dirty data

    There is a source delimited flat file created with codepage CP936, simplified Chinese. Data Services XI on HP Unix has to extract this file to a UTF-8 db2 table. However, because the flat file contains a lot of dirty or corrupted characters for Chine

  • Error when using SSIS

    I wonder if you can help? I get an error when adding any SAP task to the Control Flow We are a duel server implementation - this is on the SQL server... "Failed to create the task. Can not create the task with the name "Osoft.Services.Application.Dat

  • What happens 2 old trace files in Oracle 11g?Is there any automatic handlin

    Hi,I dont see old trace files in my trace directory in oracle 11g 11.1.0.7 database thats in /diag/rdbms/DB_NAME/trace directory.I dont have any auto delete procedure for trace files. Just wanted to know if theres any autodelete/autoarchive procedure

  • Progress bars objects not serializable message iat application runtime

    I am getting errors for the beans that have to do with progress bars. It says these objects are not serializable. When I try to implement serializable I still get that error. What do I need to do? I have 3 progress bars in view scope. SEVERE: ADFc: S

  • Can't write my user and password when accessing OV...

    Hi all, can somebody help me to resolve my issue when i access OVI, i am requested to  enter user and password, but when i write my user and password, it looks like i am writing in white caracters , i can't see what i am writing. thx for all and rega