Example #1
0
	def getAttachments(self, reqId, expId, expIdObj, report_name):
		for attach in expIdObj.get('attachments',[]):
			attachFileName = attach.get("fileName")
			content = self.jps.getAttachment(reqId, expId, attachFileName)
			from jasper_erpnext_report.utils.file import get_html_reports_images_path, get_html_reports_path
			report_path = get_html_reports_path(report_name, hash=self.html_hash)
			image_path = get_html_reports_images_path(report_path)
			write_file(content.content, os.path.join(image_path, attachFileName), "wb")
	def copy_images(self, content, outputPath, fileName, report_name, localsite):
		from distutils.dir_util import copy_tree

		src = fileName + "." + "html_files"
		html_files = os.path.join(outputPath, src)
		#this is a report without folder html_files
		if not os.path.exists(html_files):
			return
		report_path = self.get_html_path(report_name, localsite=localsite, content=content)
		dst = get_html_reports_images_path(report_path, where=src)
		copy_tree(html_files, dst)
Example #3
0
	def copy_images(self, content, outputPath, fileName, report_name, localsite):
		from distutils.dir_util import copy_tree

		src = fileName + "." + "html_files"
		html_files = os.path.join(outputPath, src)
		#this is a report without folder html_files
		if not os.path.exists(html_files):
			return
		report_path = self.get_html_path(report_name, localsite=localsite, content=content)
		dst = get_html_reports_images_path(report_path, where=src)
		copy_tree(html_files, dst)