Ejemplo n.º 1
0
 private static IAutoTextEventHandler getEventHandler(
     ReportItemDesign design, ExecutionContext context) {
   try {
     return (IAutoTextEventHandler) getInstance(design, context);
   } catch (ClassCastException e) {
     addClassCastException(context, e, design.getHandle(), IAutoTextEventHandler.class);
   } catch (EngineException e) {
     addException(context, e, design.getHandle());
   }
   return null;
 }
 protected void doSkipToExecutor(InstanceID id, long offset) throws Exception {
   ListBandDesign bandDesign = (ListBandDesign) design;
   int contentCount = bandDesign.getContentCount();
   long contentDesignId = id.getComponentID();
   for (int i = 0; i < contentCount; i++) {
     ReportItemDesign childDesign = bandDesign.getContent(i);
     if (contentDesignId == childDesign.getID()) {
       // this one is the first executed element.
       nextItem = i;
       return;
     }
   }
   nextItem = contentCount;
 }
Ejemplo n.º 3
0
 public static void handleOnPageBreak(IAutoTextContent content, ExecutionContext context) {
   Object generateBy = content.getGenerateBy();
   if (generateBy == null) {
     return;
   }
   ReportItemDesign autoTextDesign = (ReportItemDesign) generateBy;
   try {
     if (!needOnPageBreak(autoTextDesign)) {
       return;
     }
     // fromGrid doesn't matter here since row data is null
     IAutoTextInstance autoText = new AutoTextInstance(content, context, RunningState.PAGEBREAK);
     if (handleScript(autoText, autoTextDesign.getOnPageBreak(), context).didRun()) return;
     IAutoTextEventHandler eh = getEventHandler(autoTextDesign, context);
     if (eh != null) eh.onPageBreak(autoText, context.getReportContext());
   } catch (Exception e) {
     addException(context, e, autoTextDesign.getHandle());
   }
 }
Ejemplo n.º 4
0
  public static void handleOnCreate(IAutoTextContent content, ExecutionContext context) {
    Object generateBy = content.getGenerateBy();
    if (generateBy == null) {
      return;
    }
    ReportItemDesign autoTextItemDesign = (ReportItemDesign) generateBy;
    try {
      if (!needOnCreate(autoTextItemDesign)) {
        return;
      }
      IAutoTextInstance autoText = new AutoTextInstance(content, context, RunningState.CREATE);
      if (handleScript(autoText, autoTextItemDesign.getOnCreate(), context).didRun()) return;
      IAutoTextEventHandler eh = getEventHandler(autoTextItemDesign, context);
      if (eh != null) eh.onCreate(autoText, context.getReportContext());

    } catch (Exception e) {
      addException(context, e, autoTextItemDesign.getHandle());
    }
  }