Пример #1
0
 def test_compile_to_file(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports', 'csv.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports',
                                  'compile_to_file')
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #2
0
 def test_compile_to_file_jasperreports_functions2(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports',
                                 'Blank_A4_1.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports',
                                  'blank_A4_1')
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #3
0
 def test_fill_javascript(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports',
                                 'charactersetTestWithJavaScript.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports',
                                  'characterset_test_with_javascript')
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #4
0
 def test_compile_to_file_jasperreports_functions(self):
     config = Config()
     config.input = os.path.join(
         self.RESOURCES_DIR, 'reports',
         'charactersetTestWithStudioBuiltinFunctions.jrxml')
     config.output = os.path.join(
         self.RESOURCES_DIR, 'reports',
         'characterset_test_with_studio_builtin_functions')
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #5
0
 def test_fill_from_jsonql_datasource(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports',
                                 'jsonql.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports', 'jsonql')
     config.dataFile = os.path.join(self.RESOURCES_DIR, 'contacts.json')
     config.dbType = 'jsonql'
     config.jsonQuery = 'contacts.person'
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #6
0
 def test_fill_from_xml_datasource_no_xpath(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports',
                                 'CancelAck.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports',
                                  'cancel_ack_no_xpath')
     config.dataFile = os.path.join(self.RESOURCES_DIR, 'CancelAck.xml')
     config.dbType = 'xml'
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)
Пример #7
0
 def test_fill_from_xml_barcode4j(self):
     config = Config()
     config.input = os.path.join(self.RESOURCES_DIR, 'reports',
                                 'barcode4j.jrxml')
     config.output = os.path.join(self.RESOURCES_DIR, 'reports',
                                  'barcode4j')
     config.dataFile = os.path.join(self.RESOURCES_DIR, 'barcode4j.xml')
     config.dbType = 'xml'
     config.xmlXpath = '/nalepka/ident'
     instance = Report(config, config.input)
     instance.fill()
     instance.export_jrprint()
     self.assertEqual(os.path.isfile(config.output + '.jrprint'), True)