def do_load_report(self, filename): report = Report() try: report.initFromFile(filename, self.storages) except Exception as ex: QMessageBox.critical(self, 'Error while loading report', 'Error while loading report: %s' % ex.message); return self.filters = [] for filter in report.filters: self.filters.extend(filter.get_trivial()) self.show_filters()
def main(): storages = parseConfigFile() for storageName in storages: storage = storages[storageName] print storage.path report = Report() report.setStorage(storage) report.setHorizontalDimension(storage.getDimensionByName("Shops")) report.setVerticalDimension(storage.getDimensionByName("Customers")) fKinds = EqualityFilter(["ranetki",], storage.getDimensionByName("Kinds")) f = InequalityFilter(storage.getDimensionByName('Customers'), {'from':'kolesov93', 'to':'kolesov93'}) report.setFilters([f, fKinds]) report.saveToFile("ololo.xml") print report.executeQuery() report = Report() report.initFromFile("reports/inequalityReport.xml", storages) print report.executeQuery()