Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » NPE when generate MS word using BIRT
NPE when generate MS word using BIRT [message #537650] Thu, 03 June 2010 09:20 Go to next message
Alex Chen is currently offline Alex ChenFriend
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 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #538280 is a reply to message #537778] Mon, 07 June 2010 08:26 Go to previous messageGo to next message
Alex Chen is currently offline Alex ChenFriend
Messages: 11
Registered: July 2009
Junior Member
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
Re: NPE when generate MS word using BIRT [message #538422 is a reply to message #538280] Mon, 07 June 2010 14:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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
Re: NPE when generate MS word using BIRT [message #538917 is a reply to message #538422] Wed, 09 June 2010 05:49 Go to previous message
Alex Chen is currently offline Alex ChenFriend
Messages: 11
Registered: July 2009
Junior Member
We use Eclipse 3.5.2, which include org.eclipse.birt.report.engine_2.5.2.v20100210.jar, I have created a bugzilla for this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=316239 , you can see code snippet there.

Thanks much!
--Alex
Previous Topic:java.lang.IllegalArgumentException when generate MS word
Next Topic:Passing "Null Value" to report using url
Goto Forum:
  


Current Time: Thu Apr 25 03:30:16 GMT 2024

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

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

Back to the top