当前位置: 首页>>代码示例>>Java>>正文


Java AttributeNames类代码示例

本文整理汇总了Java中org.pentaho.reporting.engine.classic.core.AttributeNames的典型用法代码示例。如果您正苦于以下问题:Java AttributeNames类的具体用法?Java AttributeNames怎么用?Java AttributeNames使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AttributeNames类属于org.pentaho.reporting.engine.classic.core包,在下文中一共展示了AttributeNames类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performPreProcessing

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
/**
 * Adds an informative table of all parameters and their values to the report. If a report has no parameters
 * we dont need to add that table.
 *
 * This method demonstrates how to inject data via a sub-report into an existing report. It uses the
 * report-wizard for the bulk of the design-work.
 *
 * @param report
 * @param flowController
 * @return
 * @throws ReportProcessingException
 */
public MasterReport performPreProcessing(final MasterReport report,
                                         final DefaultFlowController flowController) throws ReportProcessingException
{
  if (report.getParameterDefinition().getParameterCount() == 0)
  {
    return report;
  }

  SubReport subReport = new SubReport();
  subReport.getDetailsHeader().getStyle().setStyleProperty(TextStyleKeys.BOLD, Boolean.TRUE);
  subReport.setDataFactory(new TableDataFactory("parameter-data", computeParameterData(report, flowController)));
  subReport.setQuery("parameter-data");
  subReport.addPreProcessor(new WizardProcessor());
  subReport.setAttribute(AttributeNames.Wizard.NAMESPACE, "wizard-spec", createReportSpec());
  subReport.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ENABLE, Boolean.TRUE);
  subReport.addExpression(createFormula("formatted-name", "=IF(ISBLANK([label]); [name]; [value])"));
  subReport.addExpression(createFormula("formatted-value", "=CSVTEXT([value])"));

  report.getReportHeader().addSubReport(subReport);
  return report;
}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:34,代码来源:GenerateParameterInformationPreProcessor.java

示例2: testApply

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
@Test
public void testApply() throws Exception
{
  ReportPreProcessor preProcessor = create();

  MasterReport report = new MasterReport();
  report.getPageFooter().addElement(TableTestUtil.createDataItem("Dummy Item"));
  report.addPreProcessor(preProcessor);


  MasterReport materialize = materialize(report.derive(true), preProcessor);
  Assert.assertEquals(BandStyleKeys.LAYOUT_BLOCK, materialize.getPageFooter().getLayout());
  Assert.assertEquals(2, materialize.getPageFooter().getElementCount());

  Band oldContent = (Band) materialize.getPageFooter().getElement(0);
  Assert.assertEquals(1, oldContent.getElementCount());
  Assert.assertEquals(report.getPageFooter().getElement(0).getObjectID(), oldContent.getElement(0).getObjectID());

  Band newContent = (Band) materialize.getPageFooter().getElement(1);
  Assert.assertEquals(1, newContent.getElementCount());
  Assert.assertEquals("Text",
      newContent.getElement(0).getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE));

}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:25,代码来源:SamplePreProcessorTest.java

示例3: testApply

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
@Test
public void testApply() throws Exception {
  ReportPreProcessor preProcessor = create();

  MasterReport report = configureReport();
  report.addPreProcessor(preProcessor);


  MasterReport materialize = materialize(report.derive(true), preProcessor);

  Assert.assertEquals(1, materialize.getReportHeader().getSubReportCount());
  SubReport sr = materialize.getReportHeader().getSubReport(0);
  DataFactory dataFactory = sr.getDataFactory();
  TableModel tableModel = dataFactory.queryData("parameter-data", new StaticDataRow());
  Assert.assertEquals(tableModel.getColumnCount(), 3);
  Assert.assertEquals(tableModel.getRowCount(), 2);
  Assert.assertNotNull(sr.getAttribute(AttributeNames.Wizard.NAMESPACE, "wizard-spec"));
  Assert.assertEquals(1, sr.getPreProcessorCount());
  Assert.assertEquals(WizardProcessor.class, sr.getPreProcessor(0).getClass());
}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:21,代码来源:GenerateParameterInformationPreProcessorTest.java

示例4: createDataItem

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
public static Element createDataItem ( 
   String text)
 { 
   Element label = new Element(); 
label.setElementType( LabelType.INSTANCE ); 
label.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, text ); 
label.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH,  100f ); 
label.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, 20f ); 
return label; 
 }
 
开发者ID:fcorti,项目名称:pentaho-8-reporting-for-java-developers,代码行数:11,代码来源:PentahoServlet.java

示例5: createFieldItem

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
public static Element createFieldItem ( 
   String text)
 { 
Element label = new Element(); 
label.setElementType( TextFieldType.INSTANCE ); 
label.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, text ); 
label.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH,  100f ); 
label.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, 20f ); 
   return label;
 }
 
开发者ID:fcorti,项目名称:pentaho-8-reporting-for-java-developers,代码行数:11,代码来源:PentahoServlet.java

示例6: processWizardSpecification

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
private AbstractReportDefinition processWizardSpecification() throws Exception {

		AbstractReportDefinition reportDefinition = getEditorModel().getReportDefinition();
		AbstractReportDefinition element = (AbstractReportDefinition) reportDefinition.derive();
		final WizardSpecification spec = getEditorModel().getReportSpec();
		element.setAttribute(AttributeNames.Wizard.NAMESPACE, "enable", Boolean.TRUE);
		WizardProcessorUtil.applyWizardSpec(element, (WizardSpecification) spec.clone());
		WizardProcessorUtil.ensureWizardProcessorIsAdded(element, null);
		return element;
	}
 
开发者ID:pentaho,项目名称:pdi-agile-bi-plugin,代码行数:11,代码来源:PreviewWizardController.java

示例7: performPreProcessing

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
/**
 * Moves the existing page-footer content into a new subband and adds a new field to the
 * footer.
 *
 * @param definition
 * @param flowController
 * @return
 * @throws ReportProcessingException
 */
public MasterReport performPreProcessing(final MasterReport definition,
                                         final DefaultFlowController flowController) throws ReportProcessingException
{
  final PageFooter pageFooter = definition.getPageFooter();
  final Band oldContent = new Band();
  for (Element e : pageFooter)
  {
    oldContent.addElement(e);
  }

  oldContent.setLayout(pageFooter.getLayout());

  Element textField = new Element();
  textField.setElementType(LabelType.INSTANCE);
  textField.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, text);
  textField.getStyle().setStyleProperty(ElementStyleKeys.PAINT, color);
  textField.getStyle().setStyleProperty(ElementStyleKeys.POS_X, x);
  textField.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, x);
  textField.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, true);

  Band newContent = new Band();
  newContent.addElement(textField);

  pageFooter.setLayout(BandStyleKeys.LAYOUT_BLOCK);
  pageFooter.addElement(oldContent);
  pageFooter.addElement(newContent);
  return definition;
}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:38,代码来源:SamplePreProcessor.java

示例8: materialize

import org.pentaho.reporting.engine.classic.core.AttributeNames; //导入依赖的package包/类
/**
 * Helper method to invoke a pre-processor outside of the report processing. This is strictly for
 * unit-testing only.
 *
 * @param report
 * @param processor
 * @return
 * @throws org.pentaho.reporting.engine.classic.core.ReportProcessingException
 */
protected static MasterReport materialize(final MasterReport report,
                                        final ReportPreProcessor processor) throws ReportProcessingException
{
  final PerformanceMonitorContext pmc = new NoOpPerformanceMonitorContext();
  final DefaultProcessingContext processingContext = new DefaultProcessingContext(report);
  final DataSchemaDefinition definition = report.getDataSchemaDefinition();
  final DefaultFlowController flowController = new DefaultFlowController(processingContext,
      definition, StateUtilities.computeParameterValueSet(report), pmc);
  final CachingDataFactory dataFactory = new CachingDataFactory(report.getDataFactory(), false);
  dataFactory.initialize(new ProcessingDataFactoryContext(processingContext, dataFactory));

  try
  {
    final DefaultFlowController postQueryFlowController = flowController.performQuery
        (dataFactory, report.getQuery(), report.getQueryLimit(),
            report.getQueryTimeout(), flowController.getMasterRow().getResourceBundleFactory());

    final Object originalEnable =
        report.getAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ENABLE);
    report.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ENABLE, Boolean.TRUE);
    final MasterReport masterReport = processor.performPreProcessing(report, postQueryFlowController);
    masterReport.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ENABLE, originalEnable);

    masterReport.setName(null);
    DesignTimeUtil.resetDocumentMetaData(masterReport);
    return masterReport;
  }
  finally
  {
    dataFactory.close();
  }
}
 
开发者ID:tmorgner,项目名称:pentaho-reporting-oem-sdk,代码行数:42,代码来源:PreProcessorTestBase.java


注:本文中的org.pentaho.reporting.engine.classic.core.AttributeNames类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。