Package com.haulmont.yarg.structure

Examples of com.haulmont.yarg.structure.BandData


        }
        return firstRow;
    }

    protected Row findNextRowForChildBand(BandData band, Range templateRange, List<Row> resultSheetRows) {
        BandData parentBand = band.getParentBand();
        Range resultParentRange = bandsToResultRanges.get(parentBand);
        Range templateParentRange = bandsToTemplateRanges.get(parentBand);

        if (resultParentRange != null && templateParentRange != null) {
            if (templateParentRange.getFirstRow() == templateRange.getFirstRow()) {
View Full Code Here


                    }

                    throw wrapWithReportingException("Bad alias : " + text.getValue());
                }

                BandData band = findBandByPath(rootBand, bandAndParameter.bandPath);

                if (band == null) {
                    throw wrapWithReportingException(String.format("No band for alias [%s] found", alias));
                }

                String fullParameterName = band.getName() + "." + bandAndParameter.parameterName;
                Object paramValue = band.getParameterValue(bandAndParameter.parameterName);

                Map<String, ReportFieldFormat> valueFormats = rootBand.getReportFieldFormats();
                if (paramValue != null && valueFormats != null && valueFormats.containsKey(fullParameterName)) {
                    String format = valueFormats.get(fullParameterName).getFormat();
                    for (ContentInliner contentInliner : DocxFormatter.this.contentInliners) {
View Full Code Here

        this.defaultFormatProvider = defaultFormatProvider;
    }

    public ReportFormatter createFormatter(FormatterFactoryInput factoryInput) {
        String templateExtension = factoryInput.templateExtension;
        BandData rootBand = factoryInput.rootBand;
        ReportTemplate reportTemplate = factoryInput.reportTemplate;
        OutputStream outputStream = factoryInput.outputStream;

        FormatterCreator formatterCreator = formattersMap.get(templateExtension);
        if (formatterCreator == null) {
View Full Code Here

        for (String tableName : tablesNames) {
            TableManager tableManager = new TableManager(xComponent, tableName);
            BandFinder bandFinder = new BandFinder(tableManager).find();

            BandData band = bandFinder.getBand();
            String bandName = bandFinder.getBandName();
            int numberOfRowWithAliases = tableManager.findRowWithAliases();

            if (band != null && numberOfRowWithAliases > -1) {
                XTextTable xTextTable = tableManager.getXTextTable();

                // try to select one cell without it workaround
                int columnCount = xTextTable.getColumns().getCount();
                if (columnCount < 2) {
                    xTextTable.getColumns().insertByIndex(columnCount, 1);
                }

                fillTable(band.getName(), band.getParentBand(), tableManager, xDispatchHelper, numberOfRowWithAliases);

                // end of workaround ->
                if (columnCount < 2) {
                    xTextTable.getColumns().removeByIndex(columnCount, 1);
                }
View Full Code Here

                XTextRange textRange = as(XTextRange.class, indexAccess.getByIndex(i));
                String alias = unwrapParameterName(textRange.getString());

                BandPathAndParameterName bandAndParameter = separateBandNameAndParameterName(alias);

                BandData band = findBandByPath(rootBand, bandAndParameter.bandPath);

                if (band != null) {
                    insertValue(textRange.getText(), textRange, band, bandAndParameter.parameterName);
                } else {
                    throw wrapWithReportingException(String.format("No band for alias [%s] found", alias));
View Full Code Here

    protected BandData findBandByPath(BandData rootBand, String path) {
        if (rootBand.getName().equals(path)) return rootBand;

        String[] pathParts = path.split("\\.");
        BandData currentBand = rootBand;
        for (String pathPart : pathParts) {
            if (currentBand == null) return null;
            currentBand = currentBand.findBandRecursively(pathPart);
        }

        return currentBand;
    }
View Full Code Here

    }

    protected BandPathAndParameterName separateBandNameAndParameterName(String alias) {
        List<String> bandPathList = new ArrayList<String>();
        String[] pathParts = alias.split("\\.");
        BandData currentBand = rootBand;
        for (String pathPart : pathParts) {
            currentBand = currentBand.findBandRecursively(pathPart);
            if (currentBand != null) {
                bandPathList.add(pathPart);
            } else {
                break;
            }
View Full Code Here

    @Override
    public void apply() {
        for (DataObject dataObject : data) {
            HSSFCell templateCell = dataObject.templateCell;
            HSSFCell resultCell = dataObject.resultCell;
            BandData bandData = dataObject.bandData;

            HSSFWorkbook resultWorkbook = resultCell.getSheet().getWorkbook();
            HSSFWorkbook templateWorkbook = templateCell.getSheet().getWorkbook();

            String templateCellValue = templateCell.getStringCellValue();

            Matcher matcher = pattern.matcher(templateCellValue);
            if (matcher.find()) {
                String paramName = matcher.group(1);
                String styleName = (String) bandData.getParameterValue(paramName);
                if (styleName == null) return;

                HSSFCellStyle cellStyle = styleCache.getStyleByName(styleName);
                if (cellStyle == null) return;
View Full Code Here

TOP

Related Classes of com.haulmont.yarg.structure.BandData

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.