本文整理汇总了Java中net.sf.jasperreports.engine.design.JRValidationFault类的典型用法代码示例。如果您正苦于以下问题:Java JRValidationFault类的具体用法?Java JRValidationFault怎么用?Java JRValidationFault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JRValidationFault类属于net.sf.jasperreports.engine.design包,在下文中一共展示了JRValidationFault类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValidationMarkers
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
protected void setValidationMarkers(JRValidationException e, JasperDesign design) {
for (JRValidationFault fault : e.getFaults()) {
String message = fault.getMessage();
SourceLocation location = null;
Object source = fault.getSource();
if (source != null) {
location = digester.getLocation(source);
if (location == null)
message = message + " --- " + source.toString(); //$NON-NLS-1$
}
if (source instanceof StandardTable){
JRDesignElement componentElement = getElementFromTable(design.getAllBands(), (StandardTable)source);
if (componentElement != null) source = componentElement;
}
if (location == null && source instanceof JRDesignElement) errorHandler.addMarker(message, location, (JRDesignElement)source);
else errorHandler.addMarker(message, location);
}
}
示例2: ProblemItem
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
/** Creates a new instance of ProblemItem */
public ProblemItem(int problemType, JRValidationFault fault) {
this.fault = fault;
this.problemType = problemType;
if (fault != null)
{
this.description = fault.getMessage();
}
}
示例3: verifyDesign
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
/**
* @see #verify(JasperDesign)
*/
public static Collection<JRValidationFault> verifyDesign(JasperDesign jasperDesign)
{
return getDefaultInstance().verify(jasperDesign);
}
示例4: verifyBandHeights
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
protected void verifyBandHeights() throws JRException
{
if (!filler.isIgnorePagination())
{
int pageHeight;
int topMargin = jasperReport.getTopMargin();
int bottomMargin = jasperReport.getBottomMargin();
JRBaseFiller parentFiller = filler;
do
{
// set every time, so at the end it will be the master page height
pageHeight = parentFiller.jasperReport.getPageHeight();
// sum parent page margins
topMargin += parentFiller.jasperReport.getTopMargin();
bottomMargin += parentFiller.jasperReport.getBottomMargin();
parentFiller =
parentFiller.parent != null && parentFiller.parent.getFiller() instanceof JRBaseFiller
? (JRBaseFiller) parentFiller.parent.getFiller()
: null;//FIXMEBOOK
}
while (parentFiller != null);
List<JRValidationFault> brokenRules = new ArrayList<JRValidationFault>();
JRVerifier.verifyBandHeights(brokenRules,
jasperReport, pageHeight, topMargin, bottomMargin);
if (!brokenRules.isEmpty())
{
throw new JRValidationException("Band height validation for subreport \""
+ jasperReport.getName() + "\" failed in the current page context "
+ "(height = " + pageHeight + ", top margin = " + topMargin
+ ", bottom margin = " + bottomMargin + ") : ",
brokenRules);
}
else if (log.isDebugEnabled())
{
log.debug("Band height validation for subreport \""
+ jasperReport.getName() + "\" succeeded in the current page context "
+ "(height = " + pageHeight + ", top margin = " + topMargin
+ ", bottom margin = " + bottomMargin + ")");
}
}
}
示例5: verifyDesign
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
public void verifyDesign()
{
// Remove all the WARNINGS...
for (int i=0; i<getJrxmlVisualView().getReportProblems().size(); ++i)
{
ProblemItem pii = getJrxmlVisualView().getReportProblems().get(i);
if (pii.getProblemType() == ProblemItem.WARNING ||
pii.getProblemType() == ProblemItem.INFORMATION)
{
getJrxmlVisualView().getReportProblems().remove(i);
i--;
}
}
//getJReportFrame().getReportProblems().clear();
try {
//SourceTraceDigester digester = IReportCompiler.createDigester();
//ReportWriter rw = new ReportWriter(getJReportFrame().getReport());
//ByteArrayOutputStream baos = new ByteArrayOutputStream();
//rw.writeToOutputStream(baos);
//JasperDesign jd = IReportCompiler.loadJasperDesign( new ByteArrayInputStream( baos.toByteArray() ), digester);
// set the correct class loader
Thread.currentThread().setContextClassLoader( IReportManager.getReportClassLoader());
if (getJrxmlVisualView().getModel() != null &&
getJrxmlVisualView().getModel().getJasperDesign() != null)
{
JasperDesign design = getJrxmlVisualView().getModel().getJasperDesign();
Collection ls = JasperCompileManager.verifyDesign(design);
Iterator iterator = ls.iterator();
while (iterator.hasNext())
{
JRValidationFault fault = (JRValidationFault)iterator.next();
String s = fault.getMessage();
//SourceLocation sl = digester.getLocation( fault.getSource() );
getJrxmlVisualView().getReportProblems().add( new ProblemItem(ProblemItem.WARNING, fault));
}
}
} catch (Exception ex)
{
ex.printStackTrace();
getJrxmlVisualView().getReportProblems().add(new ProblemItem(ProblemItem.WARNING, ex.getMessage(), null, null) );
}
Runnable runner = new Runnable(){
public void run()
{
//MainFrame.getMainInstance().getLogPane().getProblemsPanel().update();
ErrorHandlerTopComponent.getDefault().refreshErrors();
}
};
SwingUtilities.invokeLater(runner);
}
示例6: getFault
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
public JRValidationFault getFault() {
return fault;
}
示例7: setFault
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
public void setFault(JRValidationFault fault) {
this.fault = fault;
}
示例8: verify
import net.sf.jasperreports.engine.design.JRValidationFault; //导入依赖的package包/类
/**
* Verifies the validity and consistency of the report design object.
* Returns a collection of {@link JRValidationFault errors}, if problems are found in the report design.
*
* @param jasperDesign report design object to verify
* @return collection of {@link JRValidationFault JRValidationFault} if problems are found
* @see net.sf.jasperreports.engine.design.JRVerifier
*/
public Collection<JRValidationFault> verify(JasperDesign jasperDesign)
{
return JRVerifier.verifyDesign(jasperDesign);
}