本文整理汇总了Java中net.sf.jasperreports.engine.design.JasperDesign类的典型用法代码示例。如果您正苦于以下问题:Java JasperDesign类的具体用法?Java JasperDesign怎么用?Java JasperDesign使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JasperDesign类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JasperDesign类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performAction
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
if (zoomValue != null && zoomValue.length() > 0) {
CommandTarget target = getCommandTarget(getJasperReportsContext(), getReportContext());
if (target != null) {
// execute command
try {
getCommandStack().execute(
new ResetInCacheCommand(
new SaveZoomCommand((JasperDesign)target.getIdentifiable(), zoomValue),
getJasperReportsContext(),
getReportContext(),
target.getUri()
)
);
} catch (CommandException e) {
throw new ActionException(e);
}
}
} else {
errors.addAndThrow("net.sf.jasperreports.web.actions.empty.zoom");
}
}
示例2: compileReport
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
public JasperReport compileReport(String jrxmlFileName) throws JRException, IOException
{
JasperReport jasperReport = null;
InputStream jrxmlInput = JRLoader.getResourceInputStream(jrxmlFileName);
if (jrxmlInput != null)
{
JasperDesign design;
try
{
design = JRXmlLoader.load(jrxmlInput);
}
finally
{
jrxmlInput.close();
}
jasperReport = JasperCompileManager.compileReport(design);
}
return jasperReport;
}
示例3: verifyEvaluation
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
XYChartComponent chart)
{
EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
if (evaluationTime == EvaluationTimeEnum.AUTO)
{
verifier.addBrokenRule("Axis chart evaluation time cannot be Auto", chart);
}
else if (evaluationTime == EvaluationTimeEnum.GROUP)
{
String groupName = chart.getEvaluationGroup();
if (groupName == null)
{
verifier.addBrokenRule("Evaluation group not set for axis chart", chart);
}
else
{
JasperDesign report = verifier.getReportDesign();
if (!report.getGroupsMap().containsKey(groupName))
{
verifier.addBrokenRule("Axis chart evaluation group " + groupName
+ " not found in report", chart);
}
}
}
}
示例4: verifyEvaluation
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
PieChartComponent chart)
{
EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
if (evaluationTime == EvaluationTimeEnum.AUTO)
{
verifier.addBrokenRule("Pie chart evaluation time cannot be Auto", chart);
}
else if (evaluationTime == EvaluationTimeEnum.GROUP)
{
String groupName = chart.getEvaluationGroup();
if (groupName == null)
{
verifier.addBrokenRule("Evaluation group not set for pie chart", chart);
}
else
{
JasperDesign report = verifier.getReportDesign();
if (!report.getGroupsMap().containsKey(groupName))
{
verifier.addBrokenRule("Pie chart evaluation group " + groupName
+ " not found in report", chart);
}
}
}
}
示例5: performAction
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction()
{
// JasperDesign jasperDesign = getJasperDesign();
JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
Map<String, JasperDesignReportResource> cachedResources = cache.getCachedResources();
for (String uri : cachedResources.keySet())
{
JasperDesignReportResource resource = cachedResources.get(uri);
JasperDesign jasperDesign = resource.getJasperDesign();
if (jasperDesign != null)
{
JasperReport jasperReport = resource.getReport();
String appRealPath = null;//FIXMECONTEXT WebFileRepositoryService.getApplicationRealPath();
try
{
JRSaver.saveObject(jasperReport, new File(new File(new File(appRealPath), "WEB-INF/repository"), uri));//FIXMEJIVE harcoded
}
catch (JRException e)
{
throw new JRRuntimeException(e);
}
}
}
}
示例6: ReportConverter
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
/**
*
*/
public ReportConverter(JasperReportsContext jasperReportsContext, JRReport report, boolean ignoreContent)
{
this.jasperReportsContext = jasperReportsContext;
this.componentsEnvironment = ComponentsEnvironment.getInstance(jasperReportsContext);
this.report = report;
this.locale = readLocale();//allow to pass this explicitly?
this.timezone = readTimeZone();
if (report instanceof JasperDesign)
{
((JasperDesign)report).preprocess();
}
convert(ignoreContent);
}
示例7: setParentStyle
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
protected void setParentStyle(JRDesignStyle currentStyle, String parentStyleName)
{
JasperDesign jasperDesign = (JasperDesign) digester.peek(digester.getCount() - 2);
Map<String,JRStyle> stylesMap = jasperDesign.getStylesMap();
if (stylesMap.containsKey(parentStyleName))
{
JRStyle parent = stylesMap.get(parentStyleName);
currentStyle.setParentStyle(parent);
}
else
{
currentStyle.setParentStyleNameReference(parentStyleName);
}
}
示例8: createObject
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public Object createObject(Attributes attrs) throws Exception
{
JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
JRDesignGenericElement element = new JRDesignGenericElement(jasperDesign);
EvaluationTimeEnum evaluationTime = EvaluationTimeEnum.getByName(attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationTime));
if (evaluationTime != null)
{
element.setEvaluationTime(evaluationTime);
}
if (element.getEvaluationTimeValue() == EvaluationTimeEnum.GROUP)
{
String groupName = attrs.getValue(JRXmlConstants.ATTRIBUTE_evaluationGroup);
if (groupName != null)
{
element.setEvaluationGroupName(groupName);
}
}
return element;
}
示例9: createObject
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public Object createObject(Attributes atts)
{
JasperDesign jasperDesign = (JasperDesign)digester.peek(digester.getCount() - 2);
JRDesignSubreport subreport = new JRDesignSubreport(jasperDesign);
String isUsingCache = atts.getValue(JRXmlConstants.ATTRIBUTE_isUsingCache);
if (isUsingCache != null && isUsingCache.length() > 0)
{
subreport.setUsingCache(Boolean.valueOf(isUsingCache));
}
String runToBottomAttr = atts.getValue(JRXmlConstants.ATTRIBUTE_runToBottom);
if (runToBottomAttr != null)
{
subreport.setRunToBottom(Boolean.valueOf(runToBottomAttr));
}
return subreport;
}
示例10: begin
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void begin(String namespace, String name, Attributes attributes)
throws Exception
{
DesignStyleContainer styleContainer = (DesignStyleContainer) digester.peek();
JasperDesign jasperDesign = (JasperDesign) digester.peek(digester.getCount() - 2);
styleContainer.setDefaultStyleProvider(jasperDesign);
String styleName = attributes.getValue(styleAttribute);
if (styleName != null)
{
Map<String,JRStyle> stylesMap = jasperDesign.getStylesMap();
if (stylesMap.containsKey(styleName))
{
JRStyle style = stylesMap.get(styleName);
styleContainer.setStyle(style);
}
else
{
styleContainer.setStyleNameReference(styleName);
}
}
}
示例11: compileReport
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void compileReport() throws JRException, IOException
{
InputStream jrxmlInput = JRLoader.getResourceInputStream(jrxml);
JasperDesign design;
try
{
design = JRXmlLoader.load(jrxmlInput);
}
finally
{
jrxmlInput.close();
}
report = JasperCompileManager.compileReport(design);
fillManager = JasperFillManager.getInstance(jasperReportsContext);
}
示例12: verifyEvaluation
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
protected void verifyEvaluation(JRVerifier verifier,
SpiderChartComponent chart)
{
EvaluationTimeEnum evaluationTime = chart.getEvaluationTime();
if (evaluationTime == EvaluationTimeEnum.AUTO)
{
verifier.addBrokenRule("Spider chart evaluation time cannot be Auto", chart);
}
else if (evaluationTime == EvaluationTimeEnum.GROUP)
{
String groupName = chart.getEvaluationGroup();
if (groupName == null)
{
verifier.addBrokenRule("Evaluation group not set for spider chart", chart);
}
else
{
JasperDesign report = verifier.getReportDesign();
if (!report.getGroupsMap().containsKey(groupName))
{
verifier.addBrokenRule("Spider chart evaluation group " + groupName
+ " not found in report", chart);
}
}
}
}
示例13: performAction
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();
String datasetName = datasetRun.getDatasetName();
JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
// execute command
try {
getCommandStack().execute(
new ResetInCacheCommand(
new FilterCommand(getJasperReportsContext(), dataset, getFilterData()),
getJasperReportsContext(),
getReportContext(),
targetUri
)
);
} catch (CommandException e) {
throw new ActionException(e);
}
}
示例14: performAction
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
@Override
public void performAction() throws ActionException {
JRDesignDatasetRun datasetRun = (JRDesignDatasetRun)table.getDatasetRun();
String datasetName = datasetRun.getDatasetName();
JasperDesignCache cache = JasperDesignCache.getInstance(getJasperReportsContext(), getReportContext());
JasperDesign jasperDesign = cache.getJasperDesign(targetUri);
JRDesignDataset dataset = (JRDesignDataset)jasperDesign.getDatasetMap().get(datasetName);
// execute command
try {
getCommandStack().execute(
new ResetInCacheCommand(
new SortCommand(getJasperReportsContext(), dataset, getSortData()),
getJasperReportsContext(),
getReportContext(),
targetUri
)
);
} catch (CommandException e) {
throw new ActionException(e);
}
}
示例15: loadJasperDesign
import net.sf.jasperreports.engine.design.JasperDesign; //导入依赖的package包/类
public static JasperDesign loadJasperDesign(byte[] template) throws SchemaException{
try {
byte[] reportTemplate = Base64.decodeBase64(template);
InputStream inputStreamJRXML = new ByteArrayInputStream(reportTemplate);
JasperDesign jasperDesign = JRXmlLoader.load(inputStreamJRXML);
// LOGGER.trace("load jasper design : {}", jasperDesign);
return jasperDesign;
} catch (JRException ex){
throw new SchemaException(ex.getMessage(), ex.getCause());
}
}