Hi Dominik,

i tried that in a previous approach, but no luck. This throws a NullPointerException.

regards, Daniel

Am 05.03.2017 um 22:37 schrieb Dominik Stadler:
Hi,

I don't know much about all this, but XSSFRelation seems to contain
constants for a number of types, one of them HYPERLINK, so it seems you can
use something like:

drawing.addRelation(rel.getId(), XSLFRelation.HYPERLINK, new
POIXMLDocumentPart());

Dominik.

On Wed, Mar 1, 2017 at 3:49 PM, Daniel Küppers <dan...@tetralog.com> wrote:

Hi,
before apache poi 3.14-Beta1 i used to connect a picture with a hyperlink
over the XSSFDrawing.addRelation() method.
Example:
XSSFDrawing drawing = row.getSheet().createDrawingPatriarch();
PackageRelationship rel = drawing.getPackagePart().addRelationship(
   new URI(myWebsiteTarget), TargetMode.EXTERNAL, "
http://schemas.openxmlformats.org/officeDocument/2006/relat
ionships/hyperlink");
*drawing.addRelation(rel.getId(), new POIXMLDocumentPart());*
CTPictureNonVisual nvPicPr = picture.getCTPicture().getNvPicPr();
CTHyperlink hLinkClick = nvPicPr.getCNvPr().addNewHlinkClick();
hLinkClick.setId(rel.getId());

however, since 3.14-Beta1, it is required to submit a POIXMLRelation zu
the addRelation()-method.
How is it supposed to aquire this? Does anyone else overcome this change?
I couldn't find something related in the patchnotes either.

kind regards, Daniel


--
Mit freundlichen Gruessen / Kind regards
gez. / signed *Daniel Küppers* (Developer)
*TETRALOG* - Kunststoffrecycling e.K.
Am Muensterwald 1, D - 52159 Roetgen, GERMANY
phone/Tel.: +49 - 2471 - 133 70 - 13 / fax: - 29
Amtsgericht Aachen, HRA 4627
www.tetralog.com
        
Tetralog Logo

Reply via email to