Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321144 - Angent Style in buildOverflowStyle HTML emitter throws nullpointer exception
Summary: Angent Style in buildOverflowStyle HTML emitter throws nullpointer exception
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.6.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-28 11:48 EDT by Jason Weathersby CLA
Modified: 2010-08-24 02:30 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Weathersby CLA 2010-07-28 11:48:12 EDT
If you add the agentstyle parameter to the viewer url and set its value to false:
__agentstyle=false

This throws a null pointer exception.  This creates a proplem for API users as this is the default value for agentstyle.  To work around the issue users need to add the setEnableAgentStyle(true) command to there code.

		HTMLRenderOption options = new HTMLRenderOption();		
		options.setOutputFileName("output/resample/MySQL.html");
		options.setOutputFormat("HTML");
		//options.setHtmlRtLFlag(false);
		options.setEnableAgentStyleEngine(true);


The error happens in

HTMLVisionOptimize.java (getElementStyle returns a null)

	public void buildCellStyle( ICellContent cell, StringBuffer styleBuffer,
			boolean isHead, boolean fixedCellHeight )
	{
		IStyle style = getElementStyle( cell );
		// implement the cell's clip.
		if ( fixedReport )
		{
			HTMLEmitterUtil.buildOverflowStyle( styleBuffer, style, true );
		}
The null style is then passed to the buildOverflowStyle method and 

	public static void buildOverflowStyle( StringBuffer buf, IStyle style,
			boolean outputHidden )
	{
		String overflow = style.getOverflow( );
throws the exception,
Comment 1 Xiaoying Gu CLA 2010-07-30 04:02:44 EDT
I can not reproduce this issue using the 2.6.0 birt runtime, previewing the sample report by URL:

http://qa-build:8080/birt_2_6_0/frameset?__report=test.rptdesign&sample=my+parameter&__agentstyle=false
Comment 2 Jason Weathersby CLA 2010-07-30 09:49:01 EDT
try it from the API, and try it within the designer with external browswer enabled and add the __agentstyle=false.  Also the report must be fixed layout.
Comment 3 Jason Weathersby CLA 2010-07-30 09:49:35 EDT
BTW, for some reason I do not get this error with sampledb, just an external db.
Comment 4 Xiaoying Gu CLA 2010-08-02 01:46:09 EDT
I can reproduce the exception in 2.6.0 release build with report accessing external db.

But this issue can not be reproduced in latest 2.6.1 build. (2.6.1.v20100801-0630)
Comment 5 Jun Ouyang CLA 2010-08-04 01:47:25 EDT
Already fixed.
Comment 6 Xiaoying Gu CLA 2010-08-04 04:03:18 EDT
Verified in daily build 2.6.1.v20100804-0630
Comment 7 Xiaoying Gu CLA 2010-08-24 02:30:40 EDT
Similar issue #318062