|
@@ -496,7 +496,10 @@ public class ReportSettlementServiceImpl implements IReportSettlementService {
|
|
|
ImageIO.write(bufferImg, imagePath.substring(imagePath.lastIndexOf(".") + 1), byteArrayOut);
|
|
|
//anchor主要用于设置图片的属性
|
|
|
int startIndex = settlementList.size()+7;
|
|
|
- HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex+(5*j)+50*j, (short) 25, startIndex+(5*j)+50*(j+1));
|
|
|
+ int hight = (int)Math.round(bufferImg.getHeight() / 28.35 / (sheet.getDefaultRowHeightInPoints() / 28.35));
|
|
|
+ int width = (int)Math.round(bufferImg.getWidth() / (96/2.54) / ((sheet.getColumnWidthInPixels(settlementList.size()) / (96 / 2.54))));
|
|
|
+ HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 255, 255, (short) 0, startIndex+(5*j)+hight*j, (short) width, startIndex+(5*j)+hight*(j+1));
|
|
|
+
|
|
|
//HSSFClientAnchor anchor2 = new HSSFClientAnchor(0, 0, 255, 255, (short) 5, settlementList.size() + 40, (short) 10, 40 * 2);
|
|
|
anchor.setAnchorType(ClientAnchor.AnchorType.DONT_MOVE_AND_RESIZE);
|
|
|
//插入图片
|