Package com.sun.star.report

Examples of com.sun.star.report.XGroup


            try
            {
                final XGroups xForeignGroups = getDesignTemplate().getGroups();
                int nGroups = xForeignGroups.getCount();
                Object aForeignGroup = xForeignGroups.getByIndex(_nGroup);
                XGroup xForeignGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aForeignGroup);
                XSection xForeignGroupSection = xForeignGroup.getHeader();

                if (xForeignGroupSection != null)
                {
                    final XGroups xGroups = getReportDefinition().getGroups();
                    Object aGroup = xGroups.getByIndex(_nGroup);
                    XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
                    XSection xGroupSection = xGroup.getHeader();
                   
                    // copy Properties
                    copyProperties(xForeignGroupSection, xGroupSection);
                }
            }
View Full Code Here


        final int nLabelWidth = getMaxLabelWidth(); // 3000;
        final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
        final int nFieldWidth = nUsablePageWidth - nLabelWidth;

        // after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it.
        XGroup aLastGroup = null;
       
        for (int i=0;i<m_aGroupNames.length;i++)
        {
           final XGroup xGroup = xGroups.createGroup();
           aLastGroup = xGroup;

           // TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname"
           xGroup.setExpression(m_aGroupNames[i]);
           xGroup.setHeaderOn(true);
           // we don't want any group footer (default off)
           // xGroup.setFooterOn(true);

           try
           {
               // we need to append by hand
               // TODO: documentation is unclear here, that we have to insert by hand
               int nCount = xGroups.getCount();
               xGroups.insertByIndex(nCount, xGroup);

               final XSection xGroupSection = xGroup.getHeader();
               copyGroupProperties(nCount);
              
               Rectangle aRect = new Rectangle();
               aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
               SectionObject aSO = getDesignTemplate().getGroupLabel(i);
View Full Code Here

            SectionObject aSO = null;
            if (nGroups == 0)
            {
                // Spezial case, there is no Group.
                final XGroups xGroups = getReportDefinition().getGroups();
                final XGroup xGroup = xGroups.createGroup();
                xGroup.setHeaderOn(true);
              
                xGroups.insertByIndex(xGroups.getCount(), xGroup);
                xSection = xGroup.getHeader();
                copyGroupProperties(0);
                aSO = getDesignTemplate().getDetailLabel();
                aSO.setFontToBold();
            }
            else
            {
                final XGroups xGroups = getReportDefinition().getGroups();
                // we insert the titles in the last group
                final Object aGroup = xGroups.getByIndex(nGroups - 1);
                final XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
                xSection = xGroup.getHeader();

                // We don't need to copy the GroupProperties, because this is done in the insertGroup() member function
                // copyGroupProperties(0);
                aSO = getDesignTemplate().getGroupLabel(nGroups - 1);
            }
View Full Code Here

        for (int nGroup=0; nGroup<nGroupCount; nGroup++)
        {
            try
            {
                Object aGroup = xGroups.getByIndex(nGroup);
                XGroup xGroup = (XGroup)UnoRuntime.queryInterface(XGroup.class, aGroup);
                XSection xGroupSection = xGroup.getHeader();

                final int nCount = xGroupSection.getCount();
                for (int i=0;i<nCount;i++)
                {
                    try
View Full Code Here

            SectionObject aSO = null;
            if (nGroups == 0)
            {
                // Spezial case, there is no Group.
                final XGroups xGroups = getReportDefinition().getGroups();
                final XGroup xGroup = xGroups.createGroup();
                xGroup.setHeaderOn(true);

                xGroups.insertByIndex(xGroups.getCount(), xGroup);
                xSection = xGroup.getHeader();
                copyGroupProperties(0);
                aSO = getDesignTemplate().getDetailLabel();
                aSO.setFontToBold();
            }
            else
            {
                final XGroups xGroups = getReportDefinition().getGroups();
                // we insert the titles in the last group
                final Object aGroup = xGroups.getByIndex(nGroups - 1);
                final XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup);
                xSection = xGroup.getHeader();

                // We don't need to copy the GroupProperties, because this is done in the insertGroup() member function
                // copyGroupProperties(0);
                aSO = getDesignTemplate().getGroupLabel(nGroups - 1);
            }
View Full Code Here

            try
            {
                final XGroups xForeignGroups = getDesignTemplate().getGroups();
                int nGroups = xForeignGroups.getCount();
                Object aForeignGroup = xForeignGroups.getByIndex(_nGroup);
                XGroup xForeignGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aForeignGroup);
                XSection xForeignGroupSection = xForeignGroup.getHeader();

                if (xForeignGroupSection != null)
                {
                    final XGroups xGroups = getReportDefinition().getGroups();
                    Object aGroup = xGroups.getByIndex(_nGroup);
                    XGroup xGroup = (XGroup) UnoRuntime.queryInterface(XGroup.class, aGroup);
                    XSection xGroupSection = xGroup.getHeader();

                    // copy Properties
                    copyProperties(xForeignGroupSection, xGroupSection);
                }
            }
View Full Code Here

        final int nLabelWidth = getMaxLabelWidth(); // 3000;
        final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
        final int nFieldWidth = nUsablePageWidth - nLabelWidth;

        // after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it.
        XGroup aLastGroup = null;

        for (int i = 0; i < m_aGroupNames.length; i++)
        {
            final XGroup xGroup = xGroups.createGroup();
            aLastGroup = xGroup;

            // TODO: debug what the m_aGroupNames are, "field:[...]" or the "fieldname"
            xGroup.setExpression(m_aGroupNames[i]);
            xGroup.setHeaderOn(true);
            // we don't want any group footer (default off)
            // xGroup.setFooterOn(true);

            try
            {
                // we need to append by hand
                // TODO: documentation is unclear here, that we have to insert by hand
                int nCount = xGroups.getCount();
                xGroups.insertByIndex(nCount, xGroup);

                final XSection xGroupSection = xGroup.getHeader();
                copyGroupProperties(nCount);

                Rectangle aRect = new Rectangle();
                aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
                SectionObject aSO = getDesignTemplate().getGroupLabel(i);
View Full Code Here

            try
            {
                final XGroups xForeignGroups = getDesignTemplate().getGroups();
                if (_nGroup < xForeignGroups.getCount())
                {
                    XGroup xForeignGroup = UnoRuntime.queryInterface(XGroup.class, xForeignGroups.getByIndex(_nGroup));
                    XSection xForeignGroupSection = xForeignGroup.getHeader();

                    if (xForeignGroupSection != null)
                    {
                        final XGroups xGroups = getReportDefinition().getGroups();
                        Object aGroup = xGroups.getByIndex(_nGroup);
                        XGroup xGroup = UnoRuntime.queryInterface(XGroup.class, aGroup);
                        XSection xGroupSection = xGroup.getHeader();

                        // copy Properties
                        copyProperties(xForeignGroupSection, xGroupSection);
                    }
                }
View Full Code Here

            final int nLeftPageIndent = getLeftPageIndent();
            final int nLabelWidth = getMaxLabelWidth(); // 3000;
            final int nUsablePageWidth = getPageWidth() - getLeftPageIndent() - getRightPageIndent() - getLeftGroupIndent(getCountOfGroups());
            final int nFieldWidth = nUsablePageWidth - nLabelWidth;

            XGroup aLastGroup = null;
            // after done with all groups, we need access to the last group, for set property 'KeepTogether' so we remember it.

            for (int i = 0; i < m_aGroupNames.length; i++)
            {
                lastGroupPosition = i;
                final XGroup xGroup = xGroups.createGroup();
                aLastGroup = xGroup;

                xGroup.setExpression(m_aGroupNames[i]);
                xGroup.setHeaderOn(true);

                try
                {
                    int nCount = xGroups.getCount();
                    xGroups.insertByIndex(nCount, xGroup);
                    final XSection xGroupSection = xGroup.getHeader();
                    copyGroupProperties(nCount);

                    Rectangle aRect = new Rectangle();
                    aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
                    SectionObject aSO = getDesignTemplate().getGroupLabel(i);
                    aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO);
                    final String sGroupName = convertToFieldName(m_aGroupNames[i]);
                    aSO = getDesignTemplate().getGroupTextField(i);
                    aRect = insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO);
                    int height = aRect.Height;

                    // draw a line under the label/formattedfield
                    aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
                    aRect.Y = aRect.Height;
                    final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X;
                    final int nLineHeight = LayoutConstants.LineHeight;
                    insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight);
                    xGroupSection.setHeight(height + nLineHeight);
                }
                catch (com.sun.star.uno.Exception ex)
                {
                    Logger.getLogger(ReportBuilderLayouter.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

            // hold the inner group together
            if (aLastGroup != null)
            {
                doNotBreakInTable(aLastGroup);
            }
        }
        if (m_aSortNames != null)
        {
            for (String[] sortFieldName : m_aSortNames)
            {
                try
                {
                    final XGroup xGroup = xGroups.createGroup();
                    xGroup.setExpression(sortFieldName[0]);
                    xGroup.setSortAscending(PropertyNames.ASC.equals(sortFieldName[1]));
                    xGroup.setHeaderOn(false);
                    int nCount = xGroups.getCount();
                    xGroups.insertByIndex(nCount, xGroup);
                }
                catch (java.lang.Exception ex)
                {
View Full Code Here

        }
        try
        {
            SectionObject aSO = null;
            final XGroups xGroups = getReportDefinition().getGroups();
            final XGroup xGroup;
            if (lastGroupPostion == -1)
            {
                // Spezial case, there is no Group.
                xGroup = xGroups.createGroup();
                xGroup.setHeaderOn(true);

                xGroups.insertByIndex(xGroups.getCount(), xGroup);
                copyGroupProperties(0);
                aSO = getDesignTemplate().getDetailLabel();
                aSO.setFontToBold();
            }
            else
            {
                // we insert the titles in the last group
                xGroup = UnoRuntime.queryInterface(XGroup.class, xGroups.getByIndex(lastGroupPostion));

                // We don't need to copy the GroupProperties, because this is done in the insertGroup() member function
                // copyGroupProperties(0);
                aSO = getDesignTemplate().getGroupLabel(lastGroupPostion);
            }

            XSection xSection = xGroup.getHeader();
            Rectangle aRect = new Rectangle();
            aRect.X = getLeftPageIndent() + getLeftGroupIndent(getCountOfGroups());
            if (lastGroupPostion == -1)
            {
                xSection.setHeight(0)// group height + a little empty line)
View Full Code Here

TOP

Related Classes of com.sun.star.report.XGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.