Changeset View
Changeset View
Standalone View
Standalone View
plan/libs/ui/reports/reportview.cpp
Context not available. | |||||
338 | 338 | | |||
---|---|---|---|---|---|
339 | KoPrintJob *ReportWidget::createPrintJob() | 339 | KoPrintJob *ReportWidget::createPrintJob() | ||
340 | { | 340 | { | ||
341 | return new ReportPrintingDialog( this, m_reportDocument ); | 341 | return new ReportPrintingDialog(this, m_preRenderer->document()); | ||
342 | } | 342 | } | ||
343 | 343 | | |||
344 | void ReportWidget::slotExport() | 344 | void ReportWidget::slotExport() | ||
Context not available. | |||||
362 | KoPageLayout ReportWidget::pageLayout() const | 362 | KoPageLayout ReportWidget::pageLayout() const | ||
363 | { | 363 | { | ||
364 | KoPageLayout p = ViewBase::pageLayout(); | 364 | KoPageLayout p = ViewBase::pageLayout(); | ||
365 | ReportPageOptions opt = m_reportDocument->pageOptions(); | 365 | ReportPageOptions opt = m_preRenderer->document()->pageOptions(); | ||
366 | p.orientation = opt.isPortrait() ? KoPageFormat::Portrait : KoPageFormat::Landscape; | 366 | p.orientation = opt.isPortrait() ? KoPageFormat::Portrait : KoPageFormat::Landscape; | ||
367 | 367 | | |||
368 | if (opt.getPageSize().isEmpty()) { | 368 | if (opt.getPageSize().isEmpty()) { | ||
Context not available. | |||||
420 | kError()<<"Cannot create odt (table) renderer"; | 420 | kError()<<"Cannot create odt (table) renderer"; | ||
421 | return; | 421 | return; | ||
422 | } | 422 | } | ||
423 | if (!renderer->render(context, m_reportDocument)) { | 423 | if (!renderer->render(context, m_preRenderer->document())) { | ||
424 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to text document failed")); | 424 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to text document failed")); | ||
425 | } | 425 | } | ||
426 | } | 426 | } | ||
Context not available. | |||||
433 | kError()<<"Cannot create odt (frames) renderer"; | 433 | kError()<<"Cannot create odt (frames) renderer"; | ||
434 | return; | 434 | return; | ||
435 | } | 435 | } | ||
436 | if (!renderer->render(context, m_reportDocument)) { | 436 | if (!renderer->render(context, m_preRenderer->document())) { | ||
437 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to text document failed")); | 437 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to text document failed")); | ||
438 | } | 438 | } | ||
439 | } | 439 | } | ||
Context not available. | |||||
447 | kError()<<"Cannot create ods renderer"; | 447 | kError()<<"Cannot create ods renderer"; | ||
448 | return; | 448 | return; | ||
449 | } | 449 | } | ||
450 | if (!renderer->render(context, m_reportDocument)) { | 450 | if (!renderer->render(context, m_preRenderer->document())) { | ||
451 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to spreadsheet failed")); | 451 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to spreadsheet failed")); | ||
452 | } | 452 | } | ||
453 | } | 453 | } | ||
Context not available. | |||||
461 | kError()<<"Cannot create html renderer"; | 461 | kError()<<"Cannot create html renderer"; | ||
462 | return; | 462 | return; | ||
463 | } | 463 | } | ||
464 | if (!renderer->render(context, m_reportDocument)) { | 464 | if (!renderer->render(context, m_preRenderer->document())) { | ||
465 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to HTML failed")); | 465 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to HTML failed")); | ||
466 | } | 466 | } | ||
467 | } | 467 | } | ||
Context not available. | |||||
475 | kError()<<"Cannot create xhtml css renderer"; | 475 | kError()<<"Cannot create xhtml css renderer"; | ||
476 | return; | 476 | return; | ||
477 | } | 477 | } | ||
478 | if (!renderer->render(context, m_reportDocument)) { | 478 | if (!renderer->render(context, m_preRenderer->document())) { | ||
479 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to XHTML failed")); | 479 | KMessageBox::error(this, i18nc( "@info", "Failed to export to <filename>%1</filename>", context.destinationUrl.prettyUrl()) , i18n("Export to XHTML failed")); | ||
480 | } | 480 | } | ||
481 | } | 481 | } | ||
Context not available. | |||||
524 | m_preRenderer->setSourceData( rd ); | 524 | m_preRenderer->setSourceData( rd ); | ||
525 | m_preRenderer->registerScriptObject(new ProjectAccess( rd ), "project"); | 525 | m_preRenderer->registerScriptObject(new ProjectAccess( rd ), "project"); | ||
526 | 526 | | |||
527 | m_reportDocument = m_preRenderer->generate(); | 527 | const bool generated = m_preRenderer->generateDocument(); | ||
528 | m_pageSelector->setMaximum( m_reportDocument ? m_reportDocument->pages() : 1 ); | 528 | m_pageSelector->setMaximum(generated ? m_preRenderer->document()->pages() : 1); | ||
529 | m_pageSelector->setCurrentPage( 1 ); | 529 | m_pageSelector->setCurrentPage( 1 ); | ||
530 | 530 | | |||
531 | m_reportPage = new KoReportPage(this, m_reportDocument); | 531 | m_reportPage = new KoReportPage(this, m_preRenderer->document()); | ||
532 | m_reportPage->setObjectName("ReportPage"); | 532 | m_reportPage->setObjectName("ReportPage"); | ||
533 | 533 | | |||
534 | m_reportScene->setSceneRect(0,0,m_reportPage->rect().width() + 40, m_reportPage->rect().height() + 40); | 534 | m_reportScene->setSceneRect(0,0,m_reportPage->rect().width() + 40, m_reportPage->rect().height() + 40); | ||
Context not available. |