private void doPrintSetting() {

    requestMeta.setFuncId(this.printSettingButton.getFuncId());

    requestMeta.setPageType(this.getCompoId() + "_L");

    new PrintSettingDialog(requestMeta);
  }
  @SuppressWarnings("unchecked")
  private void doPrint() {

    List printList = getCheckedList();

    if (printList.size() == 0) {

      JOptionPane.showMessageDialog(this, "请选择需要打印的数据 !", "提示", JOptionPane.INFORMATION_MESSAGE);

      return;
    }

    requestMeta.setFuncId(this.printButton.getFuncId());

    requestMeta.setPageType(getCompoId() + "_L");

    boolean success = true;

    boolean printed = false;

    try {

      PrintObject printObject =
          this.baseDataServiceDelegate.genMainBillPrintObjectFN(printList, requestMeta);

      if (Printer.print(printObject)) {

        printed = true;
      }

    } catch (Exception e) {

      success = false;

      logger.error(e.getMessage(), e);

      JOptionPane.showMessageDialog(
          this, "打印出错!\n" + e.getMessage(), "错误", JOptionPane.ERROR_MESSAGE);
    }

    if (success && printed) {}
  }
  @SuppressWarnings("unchecked")
  private void doPrintPreview() {

    final List printList = getCheckedList();

    if (printList.size() == 0) {

      JOptionPane.showMessageDialog(this, "请选择需要打印预览的数据 !", "提示", JOptionPane.INFORMATION_MESSAGE);

      return;
    }

    requestMeta.setFuncId(this.printPreviewButton.getFuncId());

    requestMeta.setPageType(getCompoId() + "_L");

    try {

      PrintObject printObject =
          this.baseDataServiceDelegate.genMainBillPrintObjectFN(printList, requestMeta);

      PrintPreviewer previewer =
          new PrintPreviewer(printObject) {

            @Override
            protected void afterSuccessPrint() {}
          };

      previewer.preview();

    } catch (Exception e) {

      logger.error(e.getMessage(), e);

      JOptionPane.showMessageDialog(
          this, "打印预览出错!\n" + e.getMessage(), "错误", JOptionPane.ERROR_MESSAGE);
    }
  }
Exemplo n.º 4
0
package com.ufgov.zc.client.zc.auditsheet;