Changeset View
Changeset View
Standalone View
Standalone View
kexi/plugins/reports/kexireportview.cpp
Context not available. | |||||
388 | Q_UNUSED(mode); | 388 | Q_UNUSED(mode); | ||
---|---|---|---|---|---|
389 | 389 | | |||
390 | if (tempData()->reportSchemaChangedInPreviousView) { | 390 | if (tempData()->reportSchemaChangedInPreviousView) { | ||
391 | tempData()->reportSchemaChangedInPreviousView = false; | ||||
392 | | ||||
391 | kDebug() << "Schema changed"; | 393 | kDebug() << "Schema changed"; | ||
392 | delete m_preRenderer; | 394 | delete m_preRenderer; | ||
393 | 395 | | |||
Context not available. | |||||
399 | reportData = sourceData(tempData()->connectionDefinition); | 401 | reportData = sourceData(tempData()->connectionDefinition); | ||
400 | } | 402 | } | ||
401 | if (!reportData) { | 403 | if (!reportData) { | ||
402 | reportData = new KexiDBReportData(QString(), KexiMainWindowIface::global()->project()->dbConnection()); | 404 | reportData = new KexiDBReportData(QString(), KexiMainWindowIface::global()->project()->dbConnection(), this); | ||
403 | } | 405 | } | ||
404 | m_preRenderer->setSourceData(reportData); | 406 | m_preRenderer->setSourceData(reportData); | ||
405 | 407 | | |||
Context not available. | |||||
421 | 423 | | |||
422 | delete m_reportDocument; // prev document | 424 | delete m_reportDocument; // prev document | ||
423 | m_reportDocument = m_preRenderer->generate(); | 425 | m_reportDocument = m_preRenderer->generate(); | ||
424 | if (m_reportDocument) { | 426 | if (!m_reportDocument) { | ||
425 | m_pageCount = m_reportDocument->pages(); | 427 | return false; | ||
428 | } | ||||
429 | m_pageCount = m_reportDocument->pages(); | ||||
426 | #ifndef KEXI_MOBILE | 430 | #ifndef KEXI_MOBILE | ||
427 | m_pageSelector->setRecordCount(m_pageCount); | 431 | m_pageSelector->setRecordCount(m_pageCount); | ||
428 | m_pageSelector->setCurrentRecordNumber(1); | 432 | m_pageSelector->setCurrentRecordNumber(1); | ||
429 | #endif | 433 | #endif | ||
430 | } | | |||
431 | | ||||
432 | m_reportPage = new KoReportPage(this, m_reportDocument); | 434 | m_reportPage = new KoReportPage(this, m_reportDocument); | ||
433 | m_reportPage->setObjectName("KexiReportPage"); | 435 | m_reportPage->setObjectName("KexiReportPage"); | ||
434 | 436 | | |||
Context not available. | |||||
436 | m_reportScene->addItem(m_reportPage); | 438 | m_reportScene->addItem(m_reportPage); | ||
437 | m_reportPage->setPos(20,20); | 439 | m_reportPage->setPos(20,20); | ||
438 | m_reportView->centerOn(0,0); | 440 | m_reportView->centerOn(0,0); | ||
439 | | ||||
440 | } else { | 441 | } else { | ||
441 | KMessageBox::error(this, i18n("Report schema appears to be invalid or corrupt"), i18n("Opening failed")); | 442 | KMessageBox::error(this, i18n("Report schema appears to be invalid or corrupt"), i18n("Opening failed")); | ||
442 | } | 443 | } | ||
443 | | ||||
444 | | ||||
445 | tempData()->reportSchemaChangedInPreviousView = false; | | |||
446 | } | 444 | } | ||
447 | return true; | 445 | return true; | ||
448 | } | 446 | } | ||
Context not available. | |||||
452 | KoReportData *kodata = 0; | 450 | KoReportData *kodata = 0; | ||
453 | 451 | | |||
454 | if (e.attribute("type") == "internal") { | 452 | if (e.attribute("type") == "internal") { | ||
455 | kodata = new KexiDBReportData(e.attribute("source"), KexiMainWindowIface::global()->project()->dbConnection()); | 453 | kodata = new KexiDBReportData(e.attribute("source"), | ||
454 | KexiMainWindowIface::global()->project()->dbConnection(), | ||||
455 | this); | ||||
456 | } | 456 | } | ||
457 | #ifndef KEXI_MOBILE | 457 | #ifndef KEXI_MOBILE | ||
458 | if (e.attribute("type") == "external") { | 458 | if (e.attribute("type") == "external") { | ||
Context not available. |