Skip to main content



      Home
Home » Archived » BIRT » Help! PDFRender.handleHyperlinkAction generates NullPointer Exception
Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #199434] Mon, 06 November 2006 15:01 Go to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0083_01C701B4.6B95F800
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

The BIRT API is emitting a blue zillion of the following exceptions when =
crearting PDF output containing Hyperlinks. The PDF document is =
created, but the Hyperlinks appears as plain text instead of an actual =
Hyperlink (...and of course, my logs are full of these exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, =
renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0083_01C701B4.6B95F800
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>The BIRT API is&nbsp;emitting&nbsp;a =
blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting PDF output=20
containing Hyperlinks.&nbsp; The PDF document is created, but the =
Hyperlinks=20
appears as plain text instead of an actual Hyperlink (...and of course, =
my logs=20
are full of these exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I use to =
setup a PDF=20
task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO investigate =
use of PDF=20
font directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set rendering options =
- such=20
as file or stream output, <BR>&nbsp;&nbsp;&nbsp; //output format, =
whether it is=20
embeddable, etc<BR>&nbsp;&nbsp;&nbsp; IRenderOption options =3D new=20
RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;=20
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BODY></=
HTML>

------=_NextPart_000_0083_01C701B4.6B95F800--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #199746 is a reply to message #199434] Tue, 07 November 2006 14:04 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0032_01C70275.B3C8D0E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

What is this returning?
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following exceptions =
when crearting PDF output containing Hyperlinks. The PDF document is =
created, but the Hyperlinks appears as plain text instead of an actual =
Hyperlink (...and of course, my logs are full of these exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, =
renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0032_01C70275.B3C8D0E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>What is this returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API is&nbsp;emitting&nbsp;a =
blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting PDF =
output=20
containing Hyperlinks.&nbsp; The PDF document is created, but the =
Hyperlinks=20
appears as plain text instead of an actual Hyperlink (...and of =
course, my=20
logs are full of these exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I use to =
setup a PDF=20
task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO investigate =
use of PDF=20
font directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp; =

<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set rendering =
options - such=20
as file or stream output, <BR>&nbsp;&nbsp;&nbsp; //output format, =
whether it=20
is embeddable, etc<BR>&nbsp;&nbsp;&nbsp; IRenderOption options =3D new =

RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;=20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BODY></HTML>

------=_NextPart_000_0032_01C70275.B3C8D0E0--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #200056 is a reply to message #199746] Thu, 09 November 2006 14:54 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0009_01C7040E.F879E5E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

httpsBirtViewer returns: https://uisapp2.iu.edu/birt-prd/frameset
httpsBirtViewerTest returns: https://uisapp2.iu.edu/birt-prd2/frameset

"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:eiqlcg$lmt$1@utils.eclipse.org...
What is this returning?
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following exceptions =
when crearting PDF output containing Hyperlinks. The PDF document is =
created, but the Hyperlinks appears as plain text instead of an actual =
Hyperlink (...and of course, my logs are full of these exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, =
renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0009_01C7040E.F879E5E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>httpsBirtViewer returns:&nbsp; <A=20
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns:&nbsp; <A=20
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:eiqlcg$lmt$1@utils.eclipse.org">news:eiqlcg$lmt$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>What is this returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API =
is&nbsp;emitting&nbsp;a blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting PDF =
output=20
containing Hyperlinks.&nbsp; The PDF document is created, but the =
Hyperlinks=20
appears as plain text instead of an actual Hyperlink (...and of =
course, my=20
logs are full of these exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I use to =
setup a PDF=20
task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO =
investigate use of=20
PDF font =
directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set rendering =
options -=20
such as file or stream output, <BR>&nbsp;&nbsp;&nbsp; //output =
format,=20
whether it is embeddable, etc<BR>&nbsp;&nbsp;&nbsp; IRenderOption =
options =3D=20
new RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; =

=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0009_01C7040E.F879E5E0--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #200261 is a reply to message #200056] Fri, 10 November 2006 10:30 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C704B3.4FC55CE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Can you try setting this

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
to
if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test1"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test2"));

Just to see if the https is causing the problem? It looks like the =
error is happening when the system trys to get this url later.


Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ej011q$hpi$1@utils.eclipse.org...
httpsBirtViewer returns: https://uisapp2.iu.edu/birt-prd/frameset
httpsBirtViewerTest returns: =
https://uisapp2.iu.edu/birt-prd2/frameset

"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:eiqlcg$lmt$1@utils.eclipse.org...
What is this returning?
=
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following =
exceptions when crearting PDF output containing Hyperlinks. The PDF =
document is created, but the Hyperlinks appears as plain text instead of =
an actual Hyperlink (...and of course, my logs are full of these =
exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// =
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, =
renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0015_01C704B3.4FC55CE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Can you try setting this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test1">http://test/test1</A>"));<BR>&nbsp;&nbsp;&nbsp=
; } else=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test2">http://test/test2</A>"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing the =

problem?&nbsp; It looks like the error is happening when the system trys =
to get=20
this url later.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:ej011q$hpi$1@utils.eclipse.org">news:ej011q$hpi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>httpsBirtViewer returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt; =
wrote=20
in message <A=20
=
href=3D"news:eiqlcg$lmt$1@utils.eclipse.org">news:eiqlcg$lmt$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>What is this =
returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API =
is&nbsp;emitting&nbsp;a blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting PDF =
output=20
containing Hyperlinks.&nbsp; The PDF document is created, but the=20
Hyperlinks appears as plain text instead of an actual Hyperlink =
(...and of=20
course, my logs are full of these exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I use =
to setup a PDF=20
task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp; =

PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO =
investigate use of=20
PDF font =
directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set rendering =
options -=20
such as file or stream output, <BR>&nbsp;&nbsp;&nbsp; //output =
format,=20
whether it is embeddable, etc<BR>&nbsp;&nbsp;&nbsp; IRenderOption =
options=20
=3D new RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0015_01C704B3.4FC55CE0--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #201702 is a reply to message #200261] Fri, 17 November 2006 16:53 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0111_01C70A68.E8CF1330
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Using hard-coded http://... values (instead of https://.... values) =
didn't help; https must not be the culprit.

Do you know of a good PDF run & render example that I could stare at. =
The one on the BIRT API integration page is for HTML, and only mentions =
PDF.
"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:ej25v8$n2k$1@utils.eclipse.org...
Can you try setting this

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
to
if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test1"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test2"));

Just to see if the https is causing the problem? It looks like the =
error is happening when the system trys to get this url later.


Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ej011q$hpi$1@utils.eclipse.org...
httpsBirtViewer returns: https://uisapp2.iu.edu/birt-prd/frameset
httpsBirtViewerTest returns: =
https://uisapp2.iu.edu/birt-prd2/frameset

"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:eiqlcg$lmt$1@utils.eclipse.org...
What is this returning?
=
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following =
exceptions when crearting PDF output containing Hyperlinks. The PDF =
document is created, but the Hyperlinks appears as plain text instead of =
an actual Hyperlink (...and of course, my logs are full of these =
exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// =
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( =
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0111_01C70A68.E8CF1330
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Using hard-coded http://...&nbsp;&nbsp; =
values=20
(instead of&nbsp;https://.... values) didn't help; https must not be the =

culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run &amp; =
render example=20
that I could stare at.&nbsp; The one on the BIRT API integration page is =
for=20
HTML, and only mentions PDF.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ej25v8$n2k$1@utils.eclipse.org">news:ej25v8$n2k$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Can you try setting this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>&nbsp;&nbsp;&nbsp=
; }=20
else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test2">http://test/test2</A>"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing =
the=20
problem?&nbsp; It looks like the error is happening when the system =
trys to=20
get this url later.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ej011q$hpi$1@utils.eclipse.org">news:ej011q$hpi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>httpsBirtViewer returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:eiqlcg$lmt$1@utils.eclipse.org">news:eiqlcg$lmt$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>What is this =
returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API =
is&nbsp;emitting&nbsp;a blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting PDF =
output=20
containing Hyperlinks.&nbsp; The PDF document is created, but =
the=20
Hyperlinks appears as plain text instead of an actual Hyperlink =
(...and=20
of course, my logs are full of these exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I =
use to setup a=20
PDF task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO =
investigate use=20
of PDF font=20
=
directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set rendering =
options=20
- such as file or stream output, <BR>&nbsp;&nbsp;&nbsp; //output =
format,=20
whether it is embeddable, etc<BR>&nbsp;&nbsp;&nbsp; =
IRenderOption=20
options =3D new RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;=20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML >

------=_NextPart_000_0111_01C70A68.E8CF1330--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #201903 is a reply to message #201702] Mon, 20 November 2006 10:48 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_003A_01C70C91.61A39450
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Try this one:



Jason



import java.util.HashMap;
import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.IRenderTask;
import org.eclipse.birt.report.engine.api.IReportDocument;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunTask;
import org.eclipse.birt.report.engine.api.PDFRenderContext;


public class RenderReport {
public void runReport() throws EngineException
{=20
IReportEngine engine=3Dnull;
EngineConfig config =3D null;
//config.setRourcePath()
try{


//System.setProperty( EngineConstants.WEBAPP_CLASSPATH_KEY,
//"c:/myclasses" );=20
=20
//Configure the Engine and start the Platform
config =3D new EngineConfig( );
config.setEngineHome( =
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine" );
config.setLogConfig(null, Level.FINE);
config.setResourcePath("c:/mybirtresources/");

Platform.startup( config );
IReportEngineFactory factory =3D (IReportEngineFactory) Platform
.createFactoryObject( =
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine =3D factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );

}catch( Exception ex){
ex.printStackTrace();
}



//Open a report design - use design to modify design, retrieve =
embedded images etc.=20
IReportRunnable design =3D =
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign");=20

//Create task to run the report - use the task to execute and run the =
report,
IRunTask task =3D engine.createRunTask(design);=20


//run the report and save the report document
task.run("C:/temp/ProdLineChart.rptdocument"); =20
task.close();


IReportDocument iReportDocument =3D =
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");
IRenderTask rtask =3D engine.createRenderTask(iReportDocument);
=20

//Set Render context to handle url and image locataions
PDFRenderContext renderContext =3D new PDFRenderContext();
//Set the Base URL for all actions
renderContext.setBaseURL("http://localhost/");

//Tell the Engine what image formats are supported. Note you must =
have SVG in the string=20
//to render charts in SVG.
renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
HashMap contextMap =3D new HashMap();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, =
renderContext );
rtask.setAppContext( contextMap );
=20
//Set Render Options
HTMLRenderOption options =3D new HTMLRenderOption();
//options.setOutputStream(System.out);
options.setOutputFileName("C:/temp/output.pdf");
options.setOutputFormat("pdf");

rtask.setRenderOption(options);
=20
=20
//Render Page 1
//rtask.setPageRange("1-4,7");
//use
//iReportDocument.getPageCount();
=20
rtask.setPageNumber(1);
rtask.render();

rtask.close();
engine.shutdown();
Platform.shutdown();
System.out.println("Finished");;
}
public static void main(String[] args) {
try
{

RenderReport ex =3D new RenderReport( );
ex.runReport();

}
catch ( Exception e )
{
e.printStackTrace();
}
}
}
"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ejlb0g$boi$1@utils.eclipse.org...
Using hard-coded http://... values (instead of https://.... values) =
didn't help; https must not be the culprit.

Do you know of a good PDF run & render example that I could stare at. =
The one on the BIRT API integration page is for HTML, and only mentions =
PDF.
"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:ej25v8$n2k$1@utils.eclipse.org...
Can you try setting this

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
to
if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test1"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test2"));

Just to see if the https is causing the problem? It looks like the =
error is happening when the system trys to get this url later.


Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ej011q$hpi$1@utils.eclipse.org...
httpsBirtViewer returns: https://uisapp2.iu.edu/birt-prd/frameset
httpsBirtViewerTest returns: =
https://uisapp2.iu.edu/birt-prd2/frameset

"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:eiqlcg$lmt$1@utils.eclipse.org...
What is this returning?
=
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following =
exceptions when crearting PDF output containing Hyperlinks. The PDF =
document is created, but the Hyperlinks appears as plain text instead of =
an actual Hyperlink (...and of course, my logs are full of these =
exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new PDFRenderContext();

//TODO investigate use of PDF font directories =20
// =
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( =
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext );
=20
//Set rendering options - such as file or stream output,=20
//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
options.setOutputFileName(reportOutputDir+outputFileName);
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_003A_01C70C91.61A39450
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Try this one:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import java.util.HashMap;<BR>import=20
java.util.logging.Level;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import=20
org.eclipse.birt.core.framework.Platform;<BR>import=20
org.eclipse.birt.report.engine.api.EngineConfig;<BR>import=20
org.eclipse.birt.report.engine.api.EngineConstants;<BR>import=20
org.eclipse.birt.report.engine.api.EngineException;<BR>import=20
org.eclipse.birt.report.engine.api.HTMLRenderOption;<BR>import=20
org.eclipse.birt.report.engine.api.IRenderTask;<BR>import=20
org.eclipse.birt.report.engine.api.IReportDocument;<BR>import=20
org.eclipse.birt.report.engine.api.IReportEngine;<BR>import=20
org.eclipse.birt.report.engine.api.IReportEngineFactory;<BR >import=20
org.eclipse.birt.report.engine.api.IReportRunnable;<BR>import=20
org.eclipse.birt.report.engine.api.IRunTask;<BR>import=20
org.eclipse.birt.report.engine.api.PDFRenderContext;</FONT> </DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>public class RenderReport {<BR>&nbsp;public void runReport() =
throws=20
EngineException<BR>&nbsp;{&nbsp;<BR>&nbsp;&nbsp;IReportEngine=20
engine=3Dnull;<BR>&nbsp;&nbsp;EngineConfig config =3D=20
null;<BR>&nbsp;&nbsp;//config.setRourcePath()<BR>&nbsp;&nbsp;try{ </DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;//System.setProperty(=20
EngineConstants.WEBAPP_CLASSPATH_KEY,<BR>&nbsp;&nbsp;&nbsp;// "c:/myclasse=
s"=20
);&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;//Configure the =
Engine and=20
start the Platform<BR>&nbsp;&nbsp;&nbsp;config =3D new EngineConfig(=20
);<BR>&nbsp;&nbsp;&nbsp;config.setEngineHome(=20
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine"=20
);<BR>&nbsp;&nbsp;&nbsp;config.setLogConfig(null,=20
Level.FINE);<BR>&nbsp;&nbsp;&nbsp;config.setResourcePath( "c:/mybirtresour=
ces/");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;Platform.startup( config=20
);<BR>&nbsp;&nbsp;&nbsp;IReportEngineFactory factory =3D =
(IReportEngineFactory)=20
Platform<BR>&nbsp;&nbsp;&nbsp;.createFactoryObject(=20
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY=20
);<BR>&nbsp;&nbsp;&nbsp;engine =3D factory.createReportEngine( config=20
);<BR>&nbsp;&nbsp;&nbsp;engine.changeLogLevel( Level.WARNING );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;}catch( Exception=20
ex){<BR>&nbsp;&nbsp;&nbsp;ex.printStackTrace(); <BR>&nbsp;&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Open a report design - use design to modify design, =
retrieve=20
embedded images etc. <BR>&nbsp;&nbsp;IReportRunnable design =3D=20
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign"); </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Create task to run the report - use the task to =
execute and=20
run the report,<BR>&nbsp;&nbsp;IRunTask task =3D =
engine.createRunTask(design);=20
</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;//run the report and save the report=20
document<BR>&nbsp;&nbsp;task.run("C:/temp/ProdLineChart.rptdocument ");&nb=
sp;&nbsp;<BR>&nbsp;&nbsp;task.close();</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;IReportDocument iReportDocument =3D=20
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");<BR>&nbsp;=
&nbsp;IRenderTask=20
rtask =3D =
engine.createRenderTask(iReportDocument);<BR>&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Set Render context to handle url and image=20
locataions<BR>&nbsp;&nbsp;PDFRenderContext renderContext =3D new=20
PDFRenderContext();<BR>&nbsp;&nbsp;//Set the Base URL for all=20
actions<BR>&nbsp;&nbsp;renderContext.setBaseURL("<A=20
href=3D"http://localhost/">http://localhost/</A>");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Tell the Engine what image formats are =
supported.&nbsp; Note=20
you must have SVG in the string <BR>&nbsp;&nbsp;//to render charts in=20
SVG.<BR>&nbsp;&nbsp;renderContext.setSupportedImageFormats( "JPG;PNG;BMP;S=
VG");<BR>&nbsp;&nbsp;HashMap=20
contextMap =3D new HashMap();<BR>&nbsp;&nbsp;contextMap.put(=20
EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;rtask.setAppContext( contextMap=20
);<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;//Set Render=20
Options<BR>&nbsp;&nbsp;HTMLRenderOption options =3D new=20
HTMLRenderOption();<BR>&nbsp;&nbsp;//options.setOutputStream(System.out);=
<BR>&nbsp;&nbsp;options.setOutputFileName("C:/temp/output.pdf ");<BR>&nbsp=
;&nbsp;options.setOutputFormat("pdf");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;rtask.setRenderOption(options);<BR >&nbsp;&nbsp;<BR>&nbsp=
;<BR>&nbsp;&nbsp;//Render=20
Page=20
1<BR>&nbsp;&nbsp;//rtask.setPageRange("1-4,7");<BR >&nbsp;&nbsp;//use<BR>&=
nbsp;&nbsp;//iReportDocument.getPageCount();<BR>&nbsp;&nbsp; <BR>&nbsp;&nb=
sp;rtask.setPageNumber(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
rtask.render();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;rtask.close();<BR>&nbsp;&nbsp;engine.shutdown(); <BR>&nbs=
p;&nbsp;Platform.shutdown();<BR>&nbsp;&nbsp;System.out.println( "Finished"=
);;<BR>&nbsp;}<BR>&nbsp;public=20
static void main(String[] args) =
{<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;{</DIV >
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;RenderReport ex =3D new RenderReport(=20
);<BR>&nbsp;&nbsp;&nbsp;ex.runReport();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;catch ( Exception e=20
)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace(); <BR>&nbsp;&nb=
sp;}<BR>&nbsp;}<BR>}</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; wrote =
in message=20
<A=20
=
href=3D"news:ejlb0g$boi$1@utils.eclipse.org">news:ejlb0g$boi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Using hard-coded =
http://...&nbsp;&nbsp; values=20
(instead of&nbsp;https://.... values) didn't help; https must not be =
the=20
culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run &amp; =
render=20
example that I could stare at.&nbsp; The one on the BIRT API =
integration page=20
is for HTML, and only mentions PDF.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt; =
wrote=20
in message <A=20
=
href=3D"news:ej25v8$n2k$1@utils.eclipse.org">news:ej25v8$n2k$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Can you try setting =
this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if =
("TEST".equals(roStatus))=20
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>&nbsp;&nbsp;&nbsp=
; }=20
else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test2">http://test/test2</A>"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing =
the=20
problem?&nbsp; It looks like the error is happening when the system =
trys to=20
get this url later.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ej011q$hpi$1@utils.eclipse.org">news:ej011q$hpi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>httpsBirtViewer returns:&nbsp; <A =

=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:eiqlcg$lmt$1@utils.eclipse.org">news:eiqlcg$lmt$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>What is this =
returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
=
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; wrote in =

message <A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API =
is&nbsp;emitting&nbsp;a blue=20
zillion&nbsp;of the following exceptions&nbsp;when crearting =
PDF=20
output containing Hyperlinks.&nbsp; The PDF document is =
created, but=20
the Hyperlinks appears as plain text instead of an actual =
Hyperlink=20
(...and of course, my logs are full of these=20
exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code I =
use to setup a=20
PDF task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO =
investigate use=20
of PDF font=20
=
directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set =
rendering=20
options - such as file or stream output, =
<BR>&nbsp;&nbsp;&nbsp;=20
//output format, whether it is embeddable, =
etc<BR>&nbsp;&nbsp;&nbsp;=20
IRenderOption options =3D new =
RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp;=20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE> </BODY></HTML>

------=_NextPart_000_003A_01C70C91.61A39450--
Re: Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #201976 is a reply to message #201903] Mon, 20 November 2006 16:29 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_0019_01C70CC1.125B6730
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I changed my code to use separate Run & Render tasks like your example, =
but it didn't help. The url-links in the PDF are still ending up as =
plain text in the output, and a zillion of the following null-ptr =
exception is still showing up in the BIRT log output:

Nov 20, 2006 4:19:04 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
at or
"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:ejsinp$dmm$1@utils.eclipse.org...
Try this one:



Jason



import java.util.HashMap;
import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineConstants;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.IRenderTask;
import org.eclipse.birt.report.engine.api.IReportDocument;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunTask;
import org.eclipse.birt.report.engine.api.PDFRenderContext;


public class RenderReport {
public void runReport() throws EngineException
{=20
IReportEngine engine=3Dnull;
EngineConfig config =3D null;
//config.setRourcePath()
try{


//System.setProperty( EngineConstants.WEBAPP_CLASSPATH_KEY,
//"c:/myclasses" );=20
=20
//Configure the Engine and start the Platform
config =3D new EngineConfig( );
config.setEngineHome( =
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine" );
config.setLogConfig(null, Level.FINE);
config.setResourcePath("c:/mybirtresources/");

Platform.startup( config );
IReportEngineFactory factory =3D (IReportEngineFactory) Platform
.createFactoryObject( =
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
engine =3D factory.createReportEngine( config );
engine.changeLogLevel( Level.WARNING );

}catch( Exception ex){
ex.printStackTrace();
}



//Open a report design - use design to modify design, retrieve =
embedded images etc.=20
IReportRunnable design =3D =
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign");=20

//Create task to run the report - use the task to execute and run =
the report,
IRunTask task =3D engine.createRunTask(design);=20


//run the report and save the report document
task.run("C:/temp/ProdLineChart.rptdocument"); =20
task.close();


IReportDocument iReportDocument =3D =
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");
IRenderTask rtask =3D engine.createRenderTask(iReportDocument);
=20

//Set Render context to handle url and image locataions
PDFRenderContext renderContext =3D new PDFRenderContext();
//Set the Base URL for all actions
renderContext.setBaseURL("http://localhost/");

//Tell the Engine what image formats are supported. Note you must =
have SVG in the string=20
//to render charts in SVG.
renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
HashMap contextMap =3D new HashMap();
contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, =
renderContext );
rtask.setAppContext( contextMap );
=20
//Set Render Options
HTMLRenderOption options =3D new HTMLRenderOption();
//options.setOutputStream(System.out);
options.setOutputFileName("C:/temp/output.pdf");
options.setOutputFormat("pdf");

rtask.setRenderOption(options);
=20
=20
//Render Page 1
//rtask.setPageRange("1-4,7");
//use
//iReportDocument.getPageCount();
=20
rtask.setPageNumber(1);
rtask.render();

rtask.close();
engine.shutdown();
Platform.shutdown();
System.out.println("Finished");;
}
public static void main(String[] args) {
try
{

RenderReport ex =3D new RenderReport( );
ex.runReport();

}
catch ( Exception e )
{
e.printStackTrace();
}
}
}
"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ejlb0g$boi$1@utils.eclipse.org...
Using hard-coded http://... values (instead of https://.... =
values) didn't help; https must not be the culprit.

Do you know of a good PDF run & render example that I could stare =
at. The one on the BIRT API integration page is for HTML, and only =
mentions PDF.
"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:ej25v8$n2k$1@utils.eclipse.org...
Can you try setting this

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
to
if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test1"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("http://test/test2"));

Just to see if the https is causing the problem? It looks like =
the error is happening when the system trys to get this url later.


Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:ej011q$hpi$1@utils.eclipse.org...
httpsBirtViewer returns: =
https://uisapp2.iu.edu/birt-prd/frameset
httpsBirtViewerTest returns: =
https://uisapp2.iu.edu/birt-prd2/frameset

"Jason Weathersby" <jweathersby@actuate.com> wrote in message =
news:eiqlcg$lmt$1@utils.eclipse.org...
What is this returning?
=
BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB","httpsBirtViewer "));

Jason

"BITBURNER" <rileymg@indiana.edu> wrote in message =
news:eio4ah$pli$1@utils.eclipse.org...
The BIRT API is emitting a blue zillion of the following =
exceptions when crearting PDF output containing Hyperlinks. The PDF =
document is created, but the Hyperlinks appears as plain text instead of =
an actual Hyperlink (...and of course, my logs are full of these =
exceptions!).

Nov 6, 2006 2:52:16 PM =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der =
handleHyperlinkAction
WARNING: null
java.lang.NullPointerException
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)
at =
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)
at =
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)
....

Here is the code I use to setup a PDF task.

IEngineTask task;
task =3D reportEngine.createRunAndRenderTask(design);
PDFRenderContext renderContext =3D new =
PDFRenderContext();

//TODO investigate use of PDF font directories =20
// =
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts");
// renderContext.setEmbededFont(true);

if ("TEST".equals(roStatus)) {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));
} else {
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));
}
contextMap.put( =
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext );
=20
//Set rendering options - such as file or stream output, =

//output format, whether it is embeddable, etc
IRenderOption options =3D new RenderOptionBase();
=20
=
options.setOutputFileName(reportOutputDir+outputFileName);
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
((IRunAndRenderTask)task).setRenderOption(options);
------=_NextPart_000_0019_01C70CC1.125B6730
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2995" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I changed my code to use separate Run =
&amp; Render=20
tasks like your example, but it didn't help.&nbsp; The url-links in the =
PDF are=20
still ending up as plain text in the output, and a zillion of the =
following=20
null-ptr exception is still showing up in the BIRT log =
output:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Nov 20, 2006 4:19:04 PM=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)<BR>&nbsp;at=20
or</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ejsinp$dmm$1@utils.eclipse.org">news:ejsinp$dmm$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Try this one:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import java.util.HashMap;<BR>import=20
java.util.logging.Level;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>import=20
org.eclipse.birt.core.framework.Platform;<BR>import=20
org.eclipse.birt.report.engine.api.EngineConfig;<BR>import=20
org.eclipse.birt.report.engine.api.EngineConstants;<BR>import=20
org.eclipse.birt.report.engine.api.EngineException;<BR>import=20
org.eclipse.birt.report.engine.api.HTMLRenderOption;<BR>import=20
org.eclipse.birt.report.engine.api.IRenderTask;<BR>import=20
org.eclipse.birt.report.engine.api.IReportDocument;<BR>import=20
org.eclipse.birt.report.engine.api.IReportEngine;<BR>import=20
org.eclipse.birt.report.engine.api.IReportEngineFactory;<BR >import=20
org.eclipse.birt.report.engine.api.IReportRunnable;<BR>import=20
org.eclipse.birt.report.engine.api.IRunTask;<BR>import=20
org.eclipse.birt.report.engine.api.PDFRenderContext;</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV><FONT face=3DArial =
size=3D2>
<DIV><BR>public class RenderReport {<BR>&nbsp;public void runReport() =
throws=20
EngineException<BR>&nbsp;{&nbsp;<BR>&nbsp;&nbsp;IReportEngine=20
engine=3Dnull;<BR>&nbsp;&nbsp;EngineConfig config =3D=20
=
null;<BR>&nbsp;&nbsp;//config.setRourcePath()<BR>&nbsp;&nbsp;try{ </DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;//System.setProperty(=20
=
EngineConstants.WEBAPP_CLASSPATH_KEY,<BR>&nbsp;&nbsp;&nbsp;// "c:/myclasse=
s"=20
);&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;//Configure the =
Engine and=20
start the Platform<BR>&nbsp;&nbsp;&nbsp;config =3D new EngineConfig(=20
);<BR>&nbsp;&nbsp;&nbsp;config.setEngineHome(=20
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine"=20
);<BR>&nbsp;&nbsp;&nbsp;config.setLogConfig(null,=20
=
Level.FINE);<BR>&nbsp;&nbsp;&nbsp;config.setResourcePath( "c:/mybirtresour=
ces/");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;Platform.startup( config=20
);<BR>&nbsp;&nbsp;&nbsp;IReportEngineFactory factory =3D =
(IReportEngineFactory)=20
Platform<BR>&nbsp;&nbsp;&nbsp;.createFactoryObject(=20
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY=20
);<BR>&nbsp;&nbsp;&nbsp;engine =3D factory.createReportEngine( config=20
);<BR>&nbsp;&nbsp;&nbsp;engine.changeLogLevel( Level.WARNING );</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;}catch( Exception=20
ex){<BR>&nbsp;&nbsp;&nbsp;ex.printStackTrace(); <BR>&nbsp;&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Open a report design - use design to modify design, =

retrieve embedded images etc. <BR>&nbsp;&nbsp;IReportRunnable design =
=3D=20
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign"); </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Create task to run the report - use the task to =
execute and=20
run the report,<BR>&nbsp;&nbsp;IRunTask task =3D =
engine.createRunTask(design);=20
</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;//run the report and save the report=20
=
document<BR>&nbsp;&nbsp;task.run("C:/temp/ProdLineChart.rptdocument ");&nb=
sp;&nbsp;<BR>&nbsp;&nbsp;task.close();</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;IReportDocument iReportDocument =3D=20
=
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");<BR>&nbsp;=
&nbsp;IRenderTask=20
rtask =3D =
engine.createRenderTask(iReportDocument);<BR>&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Set Render context to handle url and image=20
locataions<BR>&nbsp;&nbsp;PDFRenderContext renderContext =3D new=20
PDFRenderContext();<BR>&nbsp;&nbsp;//Set the Base URL for all=20
actions<BR>&nbsp;&nbsp;renderContext.setBaseURL("<A=20
href=3D"http://localhost/">http://localhost/</A>");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//Tell the Engine what image formats are =
supported.&nbsp;=20
Note you must have SVG in the string <BR>&nbsp;&nbsp;//to render =
charts in=20
=
SVG.<BR>&nbsp;&nbsp;renderContext.setSupportedImageFormats( "JPG;PNG;BMP;S=
VG");<BR>&nbsp;&nbsp;HashMap=20
contextMap =3D new HashMap();<BR>&nbsp;&nbsp;contextMap.put(=20
EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext=20
);<BR>&nbsp;&nbsp;rtask.setAppContext( contextMap=20
);<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;//Set Render=20
Options<BR>&nbsp;&nbsp;HTMLRenderOption options =3D new=20
=
HTMLRenderOption();<BR>&nbsp;&nbsp;//options.setOutputStream(System.out);=
<BR>&nbsp;&nbsp;options.setOutputFileName("C:/temp/output.pdf ");<BR>&nbsp=
;&nbsp;options.setOutputFormat("pdf");</DIV>
<DIV>&nbsp;</DIV>
=
<DIV>&nbsp;&nbsp;rtask.setRenderOption(options);<BR >&nbsp;&nbsp;<BR>&nbsp=
;<BR>&nbsp;&nbsp;//Render=20
Page=20
=
1<BR>&nbsp;&nbsp;//rtask.setPageRange("1-4,7");<BR >&nbsp;&nbsp;//use<BR>&=
nbsp;&nbsp;//iReportDocument.getPageCount();<BR>&nbsp;&nbsp; <BR>&nbsp;&nb=
sp;rtask.setPageNumber(1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
rtask.render();</DIV>
<DIV>&nbsp;</DIV>
=
<DIV>&nbsp;&nbsp;rtask.close();<BR>&nbsp;&nbsp;engine.shutdown(); <BR>&nbs=
p;&nbsp;Platform.shutdown();<BR>&nbsp;&nbsp;System.out.println( "Finished"=
);;<BR>&nbsp;}<BR>&nbsp;public=20
static void main(String[] args) =
{<BR>&nbsp;&nbsp;try<BR>&nbsp;&nbsp;{</DIV >
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;RenderReport ex =3D new RenderReport(=20
);<BR>&nbsp;&nbsp;&nbsp;ex.runReport();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;catch ( Exception e=20
=
)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;e.printStackTrace(); <BR>&nbsp;&nb=
sp;}<BR>&nbsp;}<BR>}</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ejlb0g$boi$1@utils.eclipse.org">news:ejlb0g$boi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Using hard-coded =
http://...&nbsp;&nbsp; values=20
(instead of&nbsp;https://.... values) didn't help; https must not be =
the=20
culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run &amp; =
render=20
example that I could stare at.&nbsp; The one on the BIRT API =
integration=20
page is for HTML, and only mentions PDF.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:ej25v8$n2k$1@utils.eclipse.org">news:ej25v8$n2k$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>Can you try setting =
this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>&nbsp;&nbsp;&nbsp=
; }=20
else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test2">http://test/test2</A>"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is =
causing the=20
problem?&nbsp; It looks like the error is happening when the =
system trys=20
to get this url later.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:ej011q$hpi$1@utils.eclipse.org">news:ej011q$hpi$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>httpsBirtViewer returns:&nbsp; =
<A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns:&nbsp; <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Jason Weathersby" &lt;<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:eiqlcg$lmt$1@utils.eclipse.org">news:eiqlcg$lmt$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>What is this =
returning?</FONT></DIV>
<DIV><FONT face=3DArial=20
=
size=3D2>BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB", "httpsBirtView=
er"));</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: =
5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BITBURNER" &lt;<A=20
=
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>&gt; wrote=20
in message <A=20
=
href=3D"news:eio4ah$pli$1@utils.eclipse.org">news:eio4ah$pli$1@utils.ecli=
pse.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>The BIRT API =
is&nbsp;emitting&nbsp;a=20
blue zillion&nbsp;of the following exceptions&nbsp;when =
crearting=20
PDF output containing Hyperlinks.&nbsp; The PDF document is =
created,=20
but the Hyperlinks appears as plain text instead of an =
actual=20
Hyperlink (...and of course, my logs are full of these=20
exceptions!).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV><FONT face=3DArial size=3D2>Nov 6, 2006 2:52:16 PM=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der=20
handleHyperlinkAction<BR>WARNING:=20
null<BR>java.lang.NullPointerException<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR>&nbsp;at=20
=
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>....</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial size=3D2>Here is the code =
I use to setup=20
a PDF task.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
IEngineTask=20
task;<BR>&nbsp;&nbsp;&nbsp; task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR>&nbsp;&nbsp;&nbsp;=20
PDFRenderContext renderContext =3D new=20
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; //TODO =
investigate=20
use of PDF font=20
=
directories&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;=20
<BR>//&nbsp;&nbsp;&nbsp;=20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>//&nbsp;=
&nbsp;&nbsp;=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; if=20
("TEST".equals(roStatus)) =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR>&nbsp;&nbsp;&nbsp;=20
} else {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR>&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp; contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext =

);<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; //Set =
rendering=20
options - such as file or stream output, =
<BR>&nbsp;&nbsp;&nbsp;=20
//output format, whether it is embeddable, =
etc<BR>&nbsp;&nbsp;&nbsp;=20
IRenderOption options =3D new=20
RenderOptionBase();<BR>&nbsp;&nbsp;&nbsp; =
<BR>&nbsp;&nbsp;&nbsp;=20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >&nbsp;&nbsp=
;&nbsp;=20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR>&nbsp;&nb=
sp;&nbsp;=20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE> </BLOCKQUOTE></BO=
DY></HTML>

------=_NextPart_000_0019_01C70CC1.125B6730--
Previous Topic:DEAPI Requirements?
Next Topic:Scrolling of rows in Tables
Goto Forum:
  


Current Time: Mon May 05 06:17:21 EDT 2025

Powered by FUDForum. Page generated in 0.04036 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top