예제 #1
0
def subGroups(pdf,fac,p,g):
	i = 1
	filename = p+'ORG-com-'+repr(i)+'-ROLLUP'
	while os.path.isfile(filename+'.csv'):
		pdf.add_page()
		reader = csv.reader(open(filename+'.csv', 'rb'),delimiter = ',')
		f = p+'\\'+'ORG-com-'+repr(i)
		pdf.set_font('Helvetica','BU',8)
		pdf.cell(0,3,fac+' SUB-GROUP '+repr(i),0,1,'C')
		vna2mpb3.subgroupmap(f,1)
		image1 = f+'-subgroupmap.png'
                pdf.image(image1,30,30,150,100,type='')
		pdf.set_font('Helvetica','',8)
		pdf.ln(115)
		
		for row in reader:
			j = 0		
			str = ['','','','','','','','','','']
			while len(row) > j:
				str[j] = row[j]
				str[j].rstrip()
				j = j+1
			pdf.cell(9,4,str[0],1,0)	
			pdf.cell(31,4,str[1],1,0)	
			pdf.cell(15,4,str[2],1,0)	
			pdf.cell(30,4,str[3][0:14],1,0)
			pdf.cell(30,4,str[4][0:14],1,0)	
			pdf.cell(15,4,str[5][0:14],1,0)
			pdf.cell(15,4,str[6][0:14],1,0)	
			pdf.cell(15,4,str[7],1,0)
			pdf.cell(6,4,str[8][0:1],1,0)	
			pdf.cell(24,4,str[9],1,1)
			
		i = i+1
		filename = p+'ORG-com-'+repr(i)+'-ROLLUP'