Changeset View
Changeset View
Standalone View
Standalone View
kexi/plugins/reports/kexireportview.cpp
Show First 20 Lines • Show All 391 Lines • ▼ Show 20 Line(s) | 389 | if (tempData()->reportSchemaChangedInPreviousView) { | |||
---|---|---|---|---|---|
392 | kDebug() << "Schema changed"; | 392 | kDebug() << "Schema changed"; | ||
393 | delete m_preRenderer; | 393 | delete m_preRenderer; | ||
394 | 394 | | |||
395 | //kDebug() << tempData()->reportDefinition.tagName(); | 395 | //kDebug() << tempData()->reportDefinition.tagName(); | ||
396 | m_preRenderer = new KoReportPreRenderer(tempData()->reportDefinition); | 396 | m_preRenderer = new KoReportPreRenderer(tempData()->reportDefinition); | ||
397 | if (m_preRenderer->isValid()) { | 397 | if (m_preRenderer->isValid()) { | ||
398 | KoReportData *reportData = 0; | 398 | KoReportData *reportData = 0; | ||
399 | if (!tempData()->connectionDefinition.isNull()) { | 399 | if (!tempData()->connectionDefinition.isNull()) { | ||
400 | reportData = sourceData(tempData()->connectionDefinition); | 400 | reportData = createSourceData(tempData()->connectionDefinition); | ||
401 | } | 401 | } | ||
402 | if (!reportData) { | 402 | if (!reportData) { | ||
403 | reportData = new KexiDBReportData(QString(), QString(), | 403 | reportData = new KexiDBReportData(QString(), QString(), | ||
404 | KexiMainWindowIface::global()->project()->dbConnection(), this); | 404 | KexiMainWindowIface::global()->project()->dbConnection(), this); | ||
405 | } | 405 | } | ||
406 | m_preRenderer->setSourceData(reportData); | 406 | m_preRenderer->setSourceData(reportData); | ||
407 | 407 | | |||
408 | m_currentPage = 1; | 408 | m_currentPage = 1; | ||
Show All 28 Lines | 430 | #endif | |||
437 | m_reportView->centerOn(0,0); | 437 | m_reportView->centerOn(0,0); | ||
438 | } else { | 438 | } else { | ||
439 | KMessageBox::error(this, i18n("Report schema appears to be invalid or corrupt"), i18n("Opening failed")); | 439 | KMessageBox::error(this, i18n("Report schema appears to be invalid or corrupt"), i18n("Opening failed")); | ||
440 | } | 440 | } | ||
441 | } | 441 | } | ||
442 | return true; | 442 | return true; | ||
443 | } | 443 | } | ||
444 | 444 | | |||
445 | KoReportData* KexiReportView::sourceData(const QDomElement &e) | 445 | KoReportData* KexiReportView::createSourceData(const QDomElement &e) | ||
446 | { | 446 | { | ||
447 | KoReportData *kodata = 0; | 447 | KoReportData *kodata = 0; | ||
448 | 448 | | |||
449 | if (e.attribute("type") == "internal") { | 449 | if (e.attribute("type") == "internal") { | ||
450 | kodata = new KexiDBReportData(e.attribute("source"), | 450 | kodata = new KexiDBReportData(e.attribute("source"), | ||
451 | e.attribute("source-class"), | 451 | e.attribute("source-class"), | ||
452 | KexiMainWindowIface::global()->project()->dbConnection(), | 452 | KexiMainWindowIface::global()->project()->dbConnection(), | ||
453 | this); | 453 | this); | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |