Report Item

kosta
edited February 11, 2022 in Analytics #1
Hello BIRT community,

How can I pass value to my custom report item (as String or Integer) from some data source (DB, File).

Should the value be read over item property or directly into the custom report item or is there any other solution about this?

Many thanks.
Kosta
Warning No formatter is installed for the format ipb

Comments

  • JasonW
    edited December 31, 1969 #2
    Kosta,

    If your report item is nested in a grid or table you should be getting passed the rows in the onRowSets method of your implementation of the IReportItemGeneration and IReportItemPresentation interfaces.

    Jason
  • kosta
    edited December 31, 1969 #3
    Hallo Jason,

    I want to connect the report item with the datasource.
    From the example that I am using I can pass the data with the IReportItemPresentation interface.
    But those data are static and added manually in the designer view.

    Instead of that I want to connect some datasource to the item.
    I don't know if I can do that with the designer or I need to implement it programmatically.

    The example what I am using can be found on:
    http://www.eclipse.org/articles/article.php?file=Article-BIRT-ExtensionTutorial1/index.html

    The data should be readed somehow by the modelHandle in the "class RotatedTextItem extends ReportItem"
    That means the modelHandle already has the data from some datasource.

    Maybe I miss simple understanding about binding items to external datasources.


    Thank you.
    Kosta
    Warning No formatter is installed for the format ipb
  • kosta
    edited December 31, 1969 #4
    Hello BIRT community,

    my question is, how can I see the Binding Tab in the property view of my custom item.
    That's something that I am missing in the view.

    My custom item is based on the "Rotate Text" Example.
    The custom item of the first example (BIRT Extension Mechanism, Part 1: Custom Report Items) don't have properties at all. The Tab is empty.
    The custom item of second example (BIRT Extension Mechanism : Part 2) only have the properties- and the custom-tab but not the "Binding"-tab.

    What can I do, so the "Binding"-tab is shown or how can I bind data sources to the custom report item?

    Thanks.
    Warning No formatter is installed for the format ipb
  • zqian
    edited December 31, 1969 #5
    <blockquote class='ipsBlockquote' data-author="'kosta'" data-cid="67693" data-time="1282662507" data-date="24 August 2010 - 08:08 AM"><p>
    Hello BIRT community,<br />
    <br />
    my question is, how can I see the Binding Tab in the property view of my custom item.<br />
    That's something that I am missing in the view. <br />
    <br />
    My custom item is based on the "Rotate Text" Example.<br />
    The custom item of the first example (BIRT Extension Mechanism, Part 1: Custom Report Items) don't have properties at all. The Tab is empty.<br />
    The custom item of second example (BIRT Extension Mechanism : Part 2) only have the properties- and the custom-tab but not the "Binding"-tab.<br />
    <br />
    What can I do, so the "Binding"-tab is shown or how can I bind data sources to the custom report item?<br />
    <br />
    Thanks.<br /></p></blockquote>
    <br />
    kosta,<br />
    <br />
    Please refer to the new page generator implementation I've attached. This is a much cleaner version than the original one, but requires BIRT 2.5 or above. Actually this should be in Part 3 of the tutorial series, but not ready yet.:)
    Warning No formatter is installed for the format ipb
  • kosta
    edited December 31, 1969 #6
    Hello Mr. Zhiqiang Qian,

    now I can see the "Binding"-Tab! :lol::D

    I notice that the RotatedTextPageGenerator extend BasePageGenerator instead of the AbstractPageGenerator.

    Thank you very much.
    I will test now the new functionality.

    Thank you all.
    Cheers.
    Warning No formatter is installed for the format ipb
  • <blockquote class="ipsBlockquote" data-author="zqian" data-cid="67718" data-time="1282702979"><div><p>kosta,<br />
    <br />
    Please refer to the new page generator implementation I've attached. This is a much cleaner version than the original one, but requires BIRT 2.5 or above. Actually this should be in Part 3 of the tutorial series, but not ready yet.<img src='http://www.birt-exchange.org/org/forum/public/style_emoticons/default/smile.gif' alt='Posted Image' class='bbc_img' /></p></div></blockquote><p>Possibly the forum software got changed, but I'm stuck in the exact same spot and there does not seem to be an attachment on this post. If the version of the page generator is still available can you repost?   Thanks!</p>
  • <p>Hello Nicholasr,</p>
    <p> </p>
    <p>as far as I can remenber ist was about one class which Zhiqiang Qian sent to me. I have then excanged the content. I think it was the extension of the BasePageGenerator.</p>
    <pre class="_prettyXprint _lang-js _linenums:0">
    /*******************************************************************************
    * Copyright (c) 2007 Actuate Corporation.
    * All rights reserved. This program and the accompanying materials
    * are made available under the terms of the Eclipse Public License v1.0
    * which accompanies this distribution, and is available at
    * http://www.eclipse.org/legal/epl-v10.html
    *
    * Contributors:
    * Actuate Corporation - initial API and implementation
    *******************************************************************************/

    package org.eclipse.birt.sample.reportitem.profilediagrambody.views;

    import java.util.List;

    import org.eclipse.birt.report.designer.ui.views.attributes.AttributesUtil;
    import org.eclipse.birt.report.designer.ui.views.attributes.BasePageGenerator;
    import org.eclipse.birt.report.designer.ui.views.attributes.TabPage;

    /**
    * exchange YourClassPageGenerator with some class name
    */
    public class YourClassPageGenerator extends BasePageGenerator {

    private static final String CUSTOM_PAGE_TITLE = "Custom"; //$NON-NLS-1$

    @Override
    protected TabPage buildTabContent(String tabKey) {
    if (CUSTOM_PAGE_TITLE.equals(tabKey)) {
    return new YourClassCustomPage().getPage();
    }

    return super.buildTabContent(tabKey);
    }

    @Override
    public void createTabItems(List input) {
    setCategoryProvider(AttributesUtil.createCategoryProvider(new String[] { null, AttributesUtil.BORDER,
    AttributesUtil.MARGIN, AttributesUtil.SECTION, AttributesUtil.VISIBILITY, AttributesUtil.TOC,
    AttributesUtil.BOOKMARK, AttributesUtil.USERPROPERTIES, AttributesUtil.NAMEDEXPRESSIONS,
    AttributesUtil.ADVANCEPROPERTY }, new String[] { "General" //$NON-NLS-1$
    }, new String[] { "General" //$NON-NLS-1$
    }, new Class[] { YourClassGeneralPage.class }));

    super.createTabItems(input);
    }

    @Override
    protected void createTabItems() {
    createTabItem(BINDINGTITLE, ATTRIBUTESTITLE);
    createTabItem(CUSTOM_PAGE_TITLE, BINDINGTITLE);
    }
    }
    </pre>
    <p>I hope I could helped you.</p>
    <p> </p>
    <p>Cheers.</p>
    Warning No formatter is installed for the format ipb