Skip to content

Commit

Permalink
Fix a bug in reportlet run, Only both bookmark and instanceid are not…
Browse files Browse the repository at this point in the history
… null, the document is reportlet document.
  • Loading branch information
Gang Liu committed Aug 11, 2010
1 parent 49285af commit 5e94389
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Expand Up @@ -365,6 +365,15 @@ private String getBuildNumber( )
return "UNKNOWN";
}

public void removeReportletDoucment( )
{
if ( archive.exists( REPORTLET_DOCUMENT_STREAM ) )
{
archive.dropStream( REPORTLET_DOCUMENT_STREAM );
}
}


public void saveReportletDocument( String bookmark, InstanceID iid )
throws IOException
{
Expand Down
Expand Up @@ -161,10 +161,17 @@ private void openReportDocument( ) throws EngineException
writer = new ReportDocumentWriter( engine, archiveWriter, exts );
executionContext.setReportDocWriter( writer );
DocumentDataSource ds = executionContext.getDataSource( );
if ( ds != null && ds.isReportletDocument( ) )
if ( ds != null)
{
writer.saveReportletDocument( ds.getBookmark( ), ds
.getInstanceID( ) );
if( ds.isReportletDocument( ))
{
writer.saveReportletDocument( ds.getBookmark( ), ds
.getInstanceID( ) );
}
else
{
writer.removeReportletDoucment( );
}
}
}
catch ( IOException ex )
Expand Down

0 comments on commit 5e94389

Please sign in to comment.