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


C++ ORPrintRender类代码示例

本文整理汇总了C++中ORPrintRender的典型用法代码示例。如果您正苦于以下问题:C++ ORPrintRender类的具体用法?C++ ORPrintRender怎么用?C++ ORPrintRender使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ORPrintRender类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printer

bool orReport::exportToPDF( const QString& fileName )
{
  if ( !isValid() )
    return false;

  ORODocument * doc = _internal->_prerenderer.generate();

  if(doc)
  {
    QString localFileName = fileName;

    QPrinter printer( QPrinter::HighResolution );
    if (! localFileName.endsWith(".pdf", Qt::CaseInsensitive))
      localFileName.append(".pdf");
    printer.setOutputFileName( localFileName );
#ifdef Q_WS_MAC
    printer.setOutputFormat( QPrinter::NativeFormat );
#else
    printer.setOutputFormat( QPrinter::PdfFormat );
#endif

    ORPrintRender render;
    render.setupPrinter(doc, &printer);
    render.setPrinter(&printer);
    return render.render(doc);
  }
  return false;
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:28,代码来源:openreports.cpp

示例2: printer

void RenderWindow::print(bool showPreview)
{
  ORPreRender pre;
  pre.setDom(_doc);
  pre.setParamList(getParameterList());
  ORODocument * doc = pre.generate();

  if(doc)
  {
    QPrinter printer(QPrinter::HighResolution);
    if(!_printerName.isEmpty())
    {
      printer.setPrinterName(_printerName);
      _printerName = QString::null;
    }

    if(showPreview) 
    {
      PreviewDialog preview (doc, &printer, this);
      if (preview.exec() == QDialog::Rejected) 
        return;
    }

    ORPrintRender render;
    render.setupPrinter(doc, &printer);

    QPrintDialog pd(&printer);
    pd.setMinMax(1, doc->pages());
    if(pd.exec() == QDialog::Accepted)
    {
      render.setPrinter(&printer);
      render.render(doc);
    }
  }
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:35,代码来源:renderwindow.cpp

示例3: render

bool orReport::render(QPainter *pPainter, QPrinter *pPrinter)
{
  QApplication::setOverrideCursor( Qt::WaitCursor );
  bool retval = false;

  if(_internal != 0 && pPrinter != 0)
  {
    ORODocument * doc = _internal->_genDoc;
    if(doc == 0)
      doc = _internal->_prerenderer.generate();

    if(doc)
    {
      ORPrintRender render;
  
      render.setPrinter(pPrinter);
      render.setPainter(pPainter);
      retval = render.render(doc);
    }
  }
  else
  {
    // rendering to a non print device isn't supported at this time
    qDebug("Trying to render to a non print device");
  }

  QApplication::restoreOverrideCursor();

  return retval;
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:30,代码来源:openreports.cpp

示例4: slotPrintReport

void KexiReportView::slotPrintReport()
{
    QPrinter printer;
    ORPrintRender pr;

    // do some printer initialization
    pr.setPrinter(&printer);
    pr.setupPrinter(m_reportDocument, &printer);

    QPrintDialog *dialog = new QPrintDialog(&printer, this);
    if (dialog->exec() != QDialog::Accepted)
        return;

    pr.render(m_reportDocument);
}
开发者ID:JeremiasE,项目名称:KFormula,代码行数:15,代码来源:kexireportview.cpp

示例5: printer

bool ORPrintRender::exportToPDF(ORODocument * pDocument, QString pdfFileName)
{
  if(!pDocument)
    return false;

  ReportPrinter printer(QPrinter::ScreenResolution);
  printer.setResolution(300);

#ifdef Q_WS_MAC
  printer.setOutputFormat( QPrinter::NativeFormat );
#else
  printer.setOutputFormat( QPrinter::PdfFormat );
#endif

  printer.setOutputFileName( pdfFileName );

  ORPrintRender render;
  return render.render(pDocument, &printer);
}
开发者ID:dwatson78,项目名称:openrpt,代码行数:19,代码来源:orprintrender.cpp

示例6: printer

void RenderWindow::print(bool showPreview, int numCopies )
{
  ORPreRender pre;
  pre.setDom(_doc);
  pre.setParamList(getParameterList());
  ORODocument * doc = pre.generate();

  if(doc)
  {
    QPrinter printer(QPrinter::HighResolution);
#if QT_VERSION < 0x040700 // if qt < 4.7.0 then use the old function call.
    printer.setNumCopies( numCopies );
#else
    printer.setCopyCount( numCopies );
#endif
    if(!_printerName.isEmpty())
    {
      printer.setPrinterName(_printerName);
      _printerName = QString::null;
    }

    ORPrintRender render;
    render.setupPrinter(doc, &printer);

    if(showPreview) 
    {
      if(printer.printerName().isEmpty())
      {
        QPrintDialog pd(&printer);
        if(pd.exec() != QDialog::Accepted)
        {
          return; // no printer, can't preview
        }
      }
      PreviewDialog preview (doc, &printer, this);
      if (preview.exec() == QDialog::Rejected) 
        return;
    }

    if(_autoPrint)
    {
      render.setPrinter(&printer);
      render.render(doc);
    }
    else
    {
      QPrintDialog pd(&printer);
      pd.setMinMax(1, doc->pages());
      if(pd.exec() == QDialog::Accepted)
      {
        render.setPrinter(&printer);
        render.render(doc);
      }
    }
    delete doc;
  }
}
开发者ID:0TheFox0,项目名称:MayaOpenRPT,代码行数:57,代码来源:renderwindow.cpp

示例7: WHERE

void displayPrivate::print(ParameterList pParams, bool showPreview, bool forceSetParams)
{
  int numCopies = 1;
  ParameterList params = pParams;

  if (forceSetParams || !params.count())
  {
    if(!_parent->setParams(params))
      return;
  }
  params.append("isReport", true);

  XSqlQuery report;
  report.prepare("SELECT report_grade, report_source "
                 "  FROM report "
                 " WHERE (report_name=:report_name)"
                 " ORDER BY report_grade DESC LIMIT 1");
  report.bindValue(":report_name", reportName);
  report.exec();
  QDomDocument _doc;
  if (report.first())
  {
    QString errorMessage;
    int     errorLine;

    if (!_doc.setContent(report.value("report_source").toString(), &errorMessage, &errorLine))
    {
      QMessageBox::critical(_parent, ::display::tr("Error Parsing Report"),
        ::display::tr("There was an error Parsing the report definition. %1 %2").arg(errorMessage).arg(errorLine));
      return;
    }
  }
  else
  {
    QMessageBox::critical(_parent, ::display::tr("Report Not Found"),
      ::display::tr("The report %1 does not exist.").arg(reportName));
    return;
  }

  ORPreRender pre;
  pre.setDom(_doc);
  pre.setParamList(params);
  ORODocument * doc = pre.generate();

  if(doc)
  {
    ReportPrinter printer(QPrinter::HighResolution);
    printer.setNumCopies( numCopies );

    ORPrintRender render;
    render.setupPrinter(doc, &printer);

    if(showPreview)
    {
      QPrinter * tPrinter = &printer;
      QPrinter pdfPrinter(QPrinter::HighResolution);
      if(!printer.isValid())
      {
        render.setupPrinter(doc, &pdfPrinter);
        pdfPrinter.setOutputFormat(QPrinter::PdfFormat);
        tPrinter = &pdfPrinter;
      }
      PreviewDialog preview (doc, tPrinter, _parent);
      if (preview.exec() == QDialog::Rejected)
        return;
    }

    QPrintDialog pd(&printer);
    pd.setMinMax(1, doc->pages());
    if(pd.exec() == QDialog::Accepted)
    {
      render.render(doc, &printer);
    }
    delete doc;
  }
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:76,代码来源:display.cpp


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