extremprocess2

//续1
			WritableCellFormat cf = new WritableCellFormat(new WritableFont(WritableFont.TIMES,10,WritableFont.NO_BOLD));
			cf.setBorder(Border.ALL, BorderLineStyle.HAIR, Colour.BLUE);
			cf.setAlignment(Alignment.CENTRE);
			
			for(int i=0;i<ws.length;i++)
			{
				ws[i] = wbook.createSheet(title[i], wbook.getNumberOfSheets());
				for(int j=0;j<3;j++)
				{
					ws[i].setColumnView(j, 30);
				}
				if(headline == 1)
				{
					
					ws[i].addCell(new Label(0,0,title[i],cf));
					ws[i].mergeCells(0, 0, 2, 0);
				}
			}
			
			
			cf = new WritableCellFormat(new WritableFont(WritableFont.TIMES,10,WritableFont.NO_BOLD));
			cf.setBorder(Border.ALL, BorderLineStyle.HAIR, Colour.BLUE);
			cf.setAlignment(Alignment.LEFT);
			
			Timestatic time =  new Timestatic();
			int i = headline;
			
			for(ArrayList<Date> ds : extra_weekend.values()) 
			{
				if(ds.size()==1)
				{
					if(ds.get(0).getHours()<12)
					{
						time.setParas(ds.get(0),Const.pm.getTime());
					}
					else
					{
						time.setParas(Const.am.getTime(),ds.get(0));
					}
					ws[0].addCell(new Label(0,i,String.format(dateFormat, ds.get(0)),cf));
					ws[0].addCell(new Label(1,i,"default value",cf));
					ws[0].addCell(new Label(2,i++,time.toString(),cf));
				}
				else
				{	
					ws[0].addCell(new Label(0,i,String.format(dateFormat, ds.get(0)),cf));
					ws[0].addCell(new Label(1,i,String.format(dateFormat, ds.get(1)),cf));
					time.setParas(ds.get(0), ds.get(1));
					ws[0].addCell(new Label(2,i++,time.toString(),cf));
				}
			}
			time.setExtra_weekday_all(0);
			i = headline;
			
			for(Date d : extra_weekday) 
			{
					ws[1].addCell(new Label(0,i,String.format(dateFormat,d),cf));
					time.setParas(Const.am.getTime(), d);
					ws[1].addCell(new Label(1,i++,time.toString(),cf));
			}
			i = headline;

 

你可能感兴趣的:(J#)