+ -
当前位置:首页 → 问答吧 → excel插入图片

excel插入图片

时间:2011-10-11

来源:互联网

在导出的时候,把图片插入excel里面,但是图片要么是太大,或太小,要么就成个反的了。有没有谁能给我解释下poi里面HSSFClientAnchor里那八个参数的具体用法,不管我怎么调试都有问题。

作者: belong_jars   发布时间: 2011-10-11

这个还真没 研究过,你去找找poi文档

作者: softroad   发布时间: 2011-10-11

public HSSFClientAnchor(int dx1,
  int dy1,
  int dx2,
  int dy2,
  short col1,
  int row1,
  short col2,
  int row2)Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor. 

Parameters:
dx1 - the x coordinate within the first cell.
dy1 - the y coordinate within the first cell.
dx2 - the x coordinate within the second cell.
dy2 - the y coordinate within the second cell.
col1 - the column (0 based) of the first cell.
row1 - the row (0 based) of the first cell.
col2 - the column (0 based) of the second cell.
row2 - the row (0 based) of the second cell.

作者: softroad   发布时间: 2011-10-11

Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.

作者: softroad   发布时间: 2011-10-11

引用 2 楼 softroad 的回复:

public HSSFClientAnchor(int dx1,
int dy1,
int dx2,
int dy2,
short col1,
in……
我知道这个 我是要他的具体解释

作者: belong_jars   发布时间: 2011-10-11

看看HSSFClientAnchor的父类怎么解释的

作者: softroad   发布时间: 2011-10-11

HSSFClientAnchor anchor = new HSSFClientAnchor(0,0,图片宽,图片高,列,行,列,行);

作者: bill0605030109   发布时间: 2011-10-12

引用 6 楼 bill0605030109 的回复:

HSSFClientAnchor anchor = new HSSFClientAnchor(0,0,图片宽,图片高,列,行,列,行);

就是这里里面数字的定义,有什么规律的。怎么就可以不管有多少条数据,生成的图片都会自动放在最下面,不会遮住excel本身的那套数据。因为我导出的excel里面是有两套数据的,一套是直接用excel显示,还一套是以图片的方式显示。

作者: belong_jars   发布时间: 2011-10-12

图片的位置是根据参数设定的,你要放到最下面就要计算当前行是多少了。

作者: softroad   发布时间: 2011-10-12

引用 8 楼 softroad 的回复:

图片的位置是根据参数设定的,你要放到最下面就要计算当前行是多少了。

怎么计算的

作者: belong_jars   发布时间: 2011-10-12

mark

作者: dxqrr   发布时间: 2011-10-12

我最近也在做这个,不过我们用的是 jxl

作者: zh0134   发布时间: 2011-10-12

引用 11 楼 zh0134 的回复:

我最近也在做这个,不过我们用的是 jxl


头疼啊 位置老是搞不定 如果没数据导出的图片又失真了

作者: belong_jars   发布时间: 2011-10-12

各位大哥大姐,怎么解决jfreechart生成的图片插入到excel的时候保证图片不失真啊?

作者: belong_jars   发布时间: 2011-10-12

热门下载

更多