Home » Archived » BIRT » Help! PDFRender.handleHyperlinkAction generates NullPointer Exception
Help! PDFRender.handleHyperlinkAction generates NullPointer Exception [message #199434] |
Mon, 06 November 2006 15:01  |
Eclipse User |
|
|
|
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 emitting a =
blue=20
zillion of the following exceptions when crearting PDF output=20
containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> IEngineTask=20
task;<BR> task =3D=20
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO investigate =
use of PDF=20
font directories   ; =20
<BR>// =20
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set rendering options =
- such=20
as file or stream output, <BR> //output format, =
whether it is=20
embeddable, etc<BR> IRenderOption options =3D new=20
RenderOptionBase();<BR> <BR> =20
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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   |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> 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 emitting a =
blue=20
zillion of the following exceptions when crearting PDF =
output=20
containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> IEngineTask=20
task;<BR> task =3D=20
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO investigate =
use of PDF=20
font directories   ; =
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set rendering =
options - such=20
as file or stream output, <BR> //output format, =
whether it=20
is embeddable, etc<BR> IRenderOption options =3D new =
RenderOptionBase();<BR> <BR> =20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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   |
Eclipse User |
|
|
|
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: <A=20
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns: <A=20
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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 emitting a blue=20
zillion of the following exceptions when crearting PDF =
output=20
containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> IEngineTask=20
task;<BR> task =3D=20
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO =
investigate use of=20
PDF font =
directories   ; =20
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set rendering =
options -=20
such as file or stream output, <BR> //output =
format,=20
whether it is embeddable, etc<BR> IRenderOption =
options =3D=20
new RenderOptionBase();<BR> <BR> =
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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   |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =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> if =
("TEST".equals(roStatus))=20
{<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
href=3D"http://test/test1">http://test/test1</A>"));<BR>  =
; } else=20
{<BR> =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> </DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing the =
problem? 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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> 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: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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 emitting a blue=20
zillion of the following exceptions when crearting PDF =
output=20
containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> IEngineTask=20
task;<BR> task =3D=20
reportEngine.createRunAndRenderTask(design);<BR> =
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO =
investigate use of=20
PDF font =
directories   ; =20
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if=20
("TEST".equals(roStatus)) {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set rendering =
options -=20
such as file or stream output, <BR> //output =
format,=20
whether it is embeddable, etc<BR> IRenderOption =
options=20
=3D new RenderOptionBase();<BR> =
<BR> =20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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   |
Eclipse User |
|
|
|
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://... =
values=20
(instead of https://.... values) didn't help; https must not be the =
culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run & =
render example=20
that I could stare at. 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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =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> if =
("TEST".equals(roStatus))=20
{<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>  =
; }=20
else {<BR> =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> </DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing =
the=20
problem? 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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>>=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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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 emitting a blue=20
zillion of the following exceptions when crearting PDF =
output=20
containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> IEngineTask=20
task;<BR> task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO =
investigate use=20
of PDF font=20
=
directories   ; =20
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if=20
("TEST".equals(roStatus)) {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set rendering =
options=20
- such as file or stream output, <BR> //output =
format,=20
whether it is embeddable, etc<BR> =
IRenderOption=20
options =3D new RenderOptionBase();<BR> =20
<BR> =20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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   |
Eclipse User |
|
|
|
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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>import java.util.HashMap;<BR>import=20
java.util.logging.Level;</FONT></DIV>
<DIV> </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> </DIV><FONT face=3DArial size=3D2>
<DIV><BR>public class RenderReport {<BR> public void runReport() =
throws=20
EngineException<BR> { <BR> IReportEngine=20
engine=3Dnull;<BR> EngineConfig config =3D=20
null;<BR> //config.setRourcePath()<BR> try{ </DIV>
<DIV> </DIV>
<DIV><BR> //System.setProperty(=20
EngineConstants.WEBAPP_CLASSPATH_KEY,<BR> // "c:/myclasse=
s"=20
); <BR> <BR> //Configure the =
Engine and=20
start the Platform<BR> config =3D new EngineConfig(=20
);<BR> config.setEngineHome(=20
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine"=20
);<BR> config.setLogConfig(null,=20
Level.FINE);<BR> config.setResourcePath( "c:/mybirtresour=
ces/");</DIV>
<DIV> </DIV>
<DIV> Platform.startup( config=20
);<BR> IReportEngineFactory factory =3D =
(IReportEngineFactory)=20
Platform<BR> .createFactoryObject(=20
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY=20
);<BR> engine =3D factory.createReportEngine( config=20
);<BR> engine.changeLogLevel( Level.WARNING );</DIV>
<DIV> </DIV>
<DIV> }catch( Exception=20
ex){<BR> ex.printStackTrace(); <BR> }</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> //Open a report design - use design to modify design, =
retrieve=20
embedded images etc. <BR> IReportRunnable design =3D=20
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign"); </DIV>
<DIV> </DIV>
<DIV> //Create task to run the report - use the task to =
execute and=20
run the report,<BR> IRunTask task =3D =
engine.createRunTask(design);=20
</DIV>
<DIV> </DIV>
<DIV><BR> //run the report and save the report=20
document<BR> task.run("C:/temp/ProdLineChart.rptdocument ");&nb=
sp; <BR> task.close();</DIV>
<DIV> </DIV>
<DIV><BR> IReportDocument iReportDocument =3D=20
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");<BR> =
IRenderTask=20
rtask =3D =
engine.createRenderTask(iReportDocument);<BR> </DIV>
<DIV> </DIV>
<DIV> //Set Render context to handle url and image=20
locataions<BR> PDFRenderContext renderContext =3D new=20
PDFRenderContext();<BR> //Set the Base URL for all=20
actions<BR> renderContext.setBaseURL("<A=20
href=3D"http://localhost/">http://localhost/</A>");</DIV>
<DIV> </DIV>
<DIV> //Tell the Engine what image formats are =
supported. Note=20
you must have SVG in the string <BR> //to render charts in=20
SVG.<BR> renderContext.setSupportedImageFormats( "JPG;PNG;BMP;S=
VG");<BR> HashMap=20
contextMap =3D new HashMap();<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext=20
);<BR> rtask.setAppContext( contextMap=20
);<BR> <BR> //Set Render=20
Options<BR> HTMLRenderOption options =3D new=20
HTMLRenderOption();<BR> //options.setOutputStream(System.out);=
<BR> options.setOutputFileName("C:/temp/output.pdf ");<BR> =
; options.setOutputFormat("pdf");</DIV>
<DIV> </DIV>
<DIV> rtask.setRenderOption(options);<BR > <BR> =
;<BR> //Render=20
Page=20
1<BR> //rtask.setPageRange("1-4,7");<BR > //use<BR>&=
nbsp; //iReportDocument.getPageCount();<BR> <BR> &nb=
sp;rtask.setPageNumber(1);<BR> =20
rtask.render();</DIV>
<DIV> </DIV>
<DIV> rtask.close();<BR> engine.shutdown(); <BR>&nbs=
p; Platform.shutdown();<BR> System.out.println( "Finished"=
);;<BR> }<BR> public=20
static void main(String[] args) =
{<BR> try<BR> {</DIV >
<DIV> </DIV>
<DIV> RenderReport ex =3D new RenderReport(=20
);<BR> ex.runReport();</DIV>
<DIV> </DIV>
<DIV> }<BR> catch ( Exception e=20
)<BR> {<BR> e.printStackTrace(); <BR> &nb=
sp;}<BR> }<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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> 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://... values=20
(instead of https://.... values) didn't help; https must not be =
the=20
culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run & =
render=20
example that I could stare at. 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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2> if =
("TEST".equals(roStatus))=20
{<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =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> if =
("TEST".equals(roStatus))=20
{<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>  =
; }=20
else {<BR> =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> </DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is causing =
the=20
problem? 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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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: <A =
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>>=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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> 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 emitting a blue=20
zillion of the following exceptions when crearting =
PDF=20
output containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> =
IEngineTask=20
task;<BR> task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new =
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO =
investigate use=20
of PDF font=20
=
directories   ; =20
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if=20
("TEST".equals(roStatus)) {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext=20
);<BR> <BR> //Set =
rendering=20
options - such as file or stream output, =
<BR> =20
//output format, whether it is embeddable, =
etc<BR> =20
IRenderOption options =3D new =
RenderOptionBase();<BR> =20
<BR> =20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =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  |
Eclipse User |
|
|
|
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 =
& Render=20
tasks like your example, but it didn't help. 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> </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> at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> at=20
org.eclipse.birt.report.engine.layout.area.impl.ContainerAre a.accept(Cont=
ainerArea.java:64)<BR> 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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>> =
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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>import java.util.HashMap;<BR>import=20
java.util.logging.Level;</FONT></DIV>
<DIV> </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> </DIV><FONT face=3DArial =
size=3D2>
<DIV><BR>public class RenderReport {<BR> public void runReport() =
throws=20
EngineException<BR> { <BR> IReportEngine=20
engine=3Dnull;<BR> EngineConfig config =3D=20
=
null;<BR> //config.setRourcePath()<BR> try{ </DIV>
<DIV> </DIV>
<DIV><BR> //System.setProperty(=20
=
EngineConstants.WEBAPP_CLASSPATH_KEY,<BR> // "c:/myclasse=
s"=20
); <BR> <BR> //Configure the =
Engine and=20
start the Platform<BR> config =3D new EngineConfig(=20
);<BR> config.setEngineHome(=20
"C:/birt-runtime-2_1_1/birt-runtime-2_1_1/ReportEngine"=20
);<BR> config.setLogConfig(null,=20
=
Level.FINE);<BR> config.setResourcePath( "c:/mybirtresour=
ces/");</DIV>
<DIV> </DIV>
<DIV> Platform.startup( config=20
);<BR> IReportEngineFactory factory =3D =
(IReportEngineFactory)=20
Platform<BR> .createFactoryObject(=20
IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY=20
);<BR> engine =3D factory.createReportEngine( config=20
);<BR> engine.changeLogLevel( Level.WARNING );</DIV>
<DIV> </DIV>
<DIV> }catch( Exception=20
ex){<BR> ex.printStackTrace(); <BR> }</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> //Open a report design - use design to modify design, =
retrieve embedded images etc. <BR> IReportRunnable design =
=3D=20
engine.openReportDesign("C:/temp/ProdLineChart.rptdesign"); </DIV>
<DIV> </DIV>
<DIV> //Create task to run the report - use the task to =
execute and=20
run the report,<BR> IRunTask task =3D =
engine.createRunTask(design);=20
</DIV>
<DIV> </DIV>
<DIV><BR> //run the report and save the report=20
=
document<BR> task.run("C:/temp/ProdLineChart.rptdocument ");&nb=
sp; <BR> task.close();</DIV>
<DIV> </DIV>
<DIV><BR> IReportDocument iReportDocument =3D=20
=
engine.openReportDocument("C:/temp/ProdLineChart.rptdocument ");<BR> =
IRenderTask=20
rtask =3D =
engine.createRenderTask(iReportDocument);<BR> </DIV>
<DIV> </DIV>
<DIV> //Set Render context to handle url and image=20
locataions<BR> PDFRenderContext renderContext =3D new=20
PDFRenderContext();<BR> //Set the Base URL for all=20
actions<BR> renderContext.setBaseURL("<A=20
href=3D"http://localhost/">http://localhost/</A>");</DIV>
<DIV> </DIV>
<DIV> //Tell the Engine what image formats are =
supported. =20
Note you must have SVG in the string <BR> //to render =
charts in=20
=
SVG.<BR> renderContext.setSupportedImageFormats( "JPG;PNG;BMP;S=
VG");<BR> HashMap=20
contextMap =3D new HashMap();<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext=20
);<BR> rtask.setAppContext( contextMap=20
);<BR> <BR> //Set Render=20
Options<BR> HTMLRenderOption options =3D new=20
=
HTMLRenderOption();<BR> //options.setOutputStream(System.out);=
<BR> options.setOutputFileName("C:/temp/output.pdf ");<BR> =
; options.setOutputFormat("pdf");</DIV>
<DIV> </DIV>
=
<DIV> rtask.setRenderOption(options);<BR > <BR> =
;<BR> //Render=20
Page=20
=
1<BR> //rtask.setPageRange("1-4,7");<BR > //use<BR>&=
nbsp; //iReportDocument.getPageCount();<BR> <BR> &nb=
sp;rtask.setPageNumber(1);<BR> =20
rtask.render();</DIV>
<DIV> </DIV>
=
<DIV> rtask.close();<BR> engine.shutdown(); <BR>&nbs=
p; Platform.shutdown();<BR> System.out.println( "Finished"=
);;<BR> }<BR> public=20
static void main(String[] args) =
{<BR> try<BR> {</DIV >
<DIV> </DIV>
<DIV> RenderReport ex =3D new RenderReport(=20
);<BR> ex.runReport();</DIV>
<DIV> </DIV>
<DIV> }<BR> catch ( Exception e=20
=
)<BR> {<BR> e.printStackTrace(); <BR> &nb=
sp;}<BR> }<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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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://... values=20
(instead of https://.... values) didn't help; https must not be =
the=20
culprit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Do you know of a good PDF run & =
render=20
example that I could stare at. 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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>>=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> </DIV>
<DIV><FONT face=3DArial size=3D2> if=20
("TEST".equals(roStatus)) {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =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> if=20
("TEST".equals(roStatus)) {<BR> =20
renderContext.setBaseURL(BundleUtil.getValue("<A=20
=
href=3D"http://test/test1">http://test/test1</A>"));<BR>  =
; }=20
else {<BR> =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> </DIV>
<DIV><FONT face=3DArial size=3D2>Just to see if the https is =
causing the=20
problem? 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> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> =
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: =
<A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd/frameset">https://uisapp2.iu.edu/=
birt-prd/frameset</A><BR>httpsBirtViewerTest=20
returns: <A=20
=
href=3D"https://uisapp2.iu.edu/birt-prd2/frameset">https://uisapp2.iu.edu=
/birt-prd2/frameset</A></FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:jweathersby@actuate.com">jweathersby@actuate.com</A>>=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> </DIV>
<DIV><FONT face=3DArial size=3D2>Jason</FONT></DIV>
<DIV> </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" <<A=20
=
href=3D"mailto:rileymg@indiana.edu">rileymg@indiana.edu</A>> 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 emitting a=20
blue zillion of the following exceptions when =
crearting=20
PDF output containing Hyperlinks. 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> </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> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.handleHyp=
erlinkAction(PDFEmitter.java:1789)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.drawConta=
iner(PDFEmitter.java:798)<BR> at=20
=
org.eclipse.birt.report.engine.emitter.pdf.PDFEmitter$PDFRen der.startCont=
ainer(PDFEmitter.java:556)<BR> 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> </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> </DIV>
<DIV><FONT face=3DArial size=3D2> =
IEngineTask=20
task;<BR> task =3D=20
=
reportEngine.createRunAndRenderTask(design);<BR> =20
PDFRenderContext renderContext =3D new=20
PDFRenderContext();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> //TODO =
investigate=20
use of PDF font=20
=
directories   ; =20
<BR>// =20
=
renderContext.setFontDirectory(this.appUrlPrefix+"pdfFonts"); <BR>// =
=20
renderContext.setEmbededFont(true);</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> if=20
("TEST".equals(roStatus)) =
{<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewerTest"));<BR> =20
} else {<BR> =20
=
renderContext.setBaseURL(BundleUtil.getValue("edu.iu.uis.settings.ie.IEDB=
","httpsBirtViewer"));<BR> =20
}<BR> contextMap.put(=20
EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext =
);<BR> <BR> //Set =
rendering=20
options - such as file or stream output, =
<BR> =20
//output format, whether it is embeddable, =
etc<BR> =20
IRenderOption options =3D new=20
RenderOptionBase();<BR> =
<BR> =20
=
options.setOutputFileName(reportOutputDir+outputFileName);<BR >  =
; =20
=
options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF); <BR> &nb=
sp; =20
=
((IRunAndRenderTask)task).setRenderOption(options);</FONT></DIV ></BLOCKQU=
OTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE> </BLOCKQUOTE></BO=
DY></HTML>
------=_NextPart_000_0019_01C70CC1.125B6730--
|
|
|
Goto Forum:
Current Time: Mon May 05 02:42:36 EDT 2025
Powered by FUDForum. Page generated in 0.03690 seconds
|