NPE when generate MS word using BIRT [message #537650] |
Thu, 03 June 2010 09:20 |
Alex Chen Messages: 11 Registered: July 2009 |
Junior Member |
|
|
Hi BIRT guru,
I use BIRT engine API to generate MS word document in my code, but I get NPE when I upgrade to Eclipse 3.5, it like:
Jun 3, 2010 4:09:02 PM org.eclipse.birt.report.engine.api.impl.RunTask doRun
SEVERE: An error happened while running the report. Cause:
Throwable occurred: java.lang.NullPointerException
at org.eclipse.birt.report.engine.nLayout.area.impl.TableArea.s plit(TableArea.java:296)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea._split(BlockContainerArea.java:366)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea.split(BlockContainerArea.java:308)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea._split(BlockContainerArea.java:366)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea.split(BlockContainerArea.java:308)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea._split(BlockContainerArea.java:366)
at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai nerArea.split(BlockContainerArea.java:308)
at org.eclipse.birt.report.engine.nLayout.area.impl.RowArea._sp lit(RowArea.java:318)
After checking CVS of BIRT, I find it has been fixed start from version 1.21.2.1, http://dev.eclipse.org/viewcvs/index.cgi/source/org.eclipse. birt.report.engine/src/org/eclipse/birt/report/engine/nLayou t/area/impl/TableArea.java?root=BIRT_Project&view=log
And the comment in BIRT code like:
if ( context.isFixedLayout( ) )
{
FixedLayoutPageHintGenerator pageHintGenerator = context
.getPageHintGenerator( );
if ( pageHintGenerator != null && unresolvedRow != null )
{
InstanceID unresolvedTableIID = unresolvedRow
.getTableArea( ).getContent( ).getInstanceID( );
// this iid can be null, because the table may be generated
// from HTML2Content.
// in this case, they are ignored by unresloved row hint.
// Currently, large HTML text is not supported to be split.
if ( unresolvedTableIID != null )
{
pageHintGenerator.addUnresolvedRowHint(
unresolvedTableIID.toUniqueString( ),
convertRowToHint( unresolvedRow ) );
}
}
}
My question is: if I can't use the latest build of BIRT which contains that fix, what should I do? to make change in my report templates? if so, how to locate the possible place which cause this issue in report templates?
Thanks much,
--Alex
|
|
|
Re: NPE when generate MS word using BIRT [message #537778 is a reply to message #537650] |
Thu, 03 June 2010 15:18 |
|
Alex,
Have you tried using Auto layout instead of Fixed?
Jason
On 6/3/2010 5:20 AM, Alex Chen wrote:
> Hi BIRT guru,
>
> I use BIRT engine API to generate MS word document in my code, but I get
> NPE when I upgrade to Eclipse 3.5, it like:
>
> Jun 3, 2010 4:09:02 PM org.eclipse.birt.report.engine.api.impl.RunTask
> doRun
> SEVERE: An error happened while running the report. Cause:
> Throwable occurred: java.lang.NullPointerException
> at org.eclipse.birt.report.engine.nLayout.area.impl.TableArea.s
> plit(TableArea.java:296)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea._split(BlockContainerArea.java:366)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea.split(BlockContainerArea.java:308)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea._split(BlockContainerArea.java:366)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea.split(BlockContainerArea.java:308)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea._split(BlockContainerArea.java:366)
> at org.eclipse.birt.report.engine.nLayout.area.impl.BlockContai
> nerArea.split(BlockContainerArea.java:308)
> at org.eclipse.birt.report.engine.nLayout.area.impl.RowArea._sp
> lit(RowArea.java:318)
>
> After checking CVS of BIRT, I find it has been fixed start from version
> 1.21.2.1,
> http://dev.eclipse.org/viewcvs/index.cgi/source/org.eclipse. birt.report.engine/src/org/eclipse/birt/report/engine/nLayou t/area/impl/TableArea.java?root=BIRT_Project&view=log
>
>
> And the comment in BIRT code like:
> if ( context.isFixedLayout( ) )
> {
> FixedLayoutPageHintGenerator pageHintGenerator = context
> .getPageHintGenerator( );
> if ( pageHintGenerator != null && unresolvedRow != null )
> {
> InstanceID unresolvedTableIID = unresolvedRow
> .getTableArea( ).getContent( ).getInstanceID( );
> // this iid can be null, because the table may be generated
> // from HTML2Content.
> // in this case, they are ignored by unresloved row hint.
> // Currently, large HTML text is not supported to be split.
> if ( unresolvedTableIID != null )
> {
> pageHintGenerator.addUnresolvedRowHint(
> unresolvedTableIID.toUniqueString( ),
> convertRowToHint( unresolvedRow ) );
> }
> }
> }
>
>
> My question is: if I can't use the latest build of BIRT which contains
> that fix, what should I do? to make change in my report templates? if
> so, how to locate the possible place which cause this issue in report
> templates?
>
> Thanks much,
> --Alex
|
|
|
|
Re: NPE when generate MS word using BIRT [message #538422 is a reply to message #538280] |
Mon, 07 June 2010 14:48 |
|
Alex
What version of BIRT are you using? Can you post your code?
Jason
On 6/7/2010 4:26 AM, Alex Chen wrote:
> Hi Jason,
>
> I've checked our rptdesign file, we did use Auto layout instead of Fixed
> layout.
>
> Any insight to fix our issue?
>
>
> Thanks very much!
> --Alex
|
|
|
|
Powered by
FUDForum. Page generated in 0.04200 seconds