Bug 125060 Export to CSV should repeat values in each data row
When a user exports content to CSV, they typically do so in order to further manipulate the data using other tools such as Excel. For example, to export the data and then build an Excel Pivot Table around the data. They typically do no want to export the data in it's "visual" format -- they want the raw data so they can work with it. To support this common usage, when exporting to CSV from the viewer, the value for each column should be repeated in each row. That is, we should do a data export rather than trying to approximate the formatted layout of the report. For example, if you export data using BIRT 2.0 from the report design attached to bugzilla entry 125058, you get something like: Classic Cars 1948 Porsche 356-A Roadster Scale: 1:18 ... 1948 Porsche Type 356 Roadster Scale: 1:18 ... 1949 Jaguar XK 120 Scale: 1:24 ... ... This does not support the analysis that users are going to typically want to do. We should export this as: Classic Cars 1948 Porsche 356-A Roadster Scale: 1:18 ... Classic Cars 1948 Porsche Type 356 Roadster Scale: 1:18 ... Classic Cars 1949 Jaguar XK 120 Scale: 1:24 ... ...
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/parser/EngineIRVisitor.java
else if ( DesignChoiceConstants.PARAM_TYPE_FLOAT.equals( valueType ) )
			scalarParameter.setDataType( IScalarParameterDefn.TYPE_FLOAT );
		else if ( DesignChoiceConstants.PARAM_TYPE_STRING.equals( valueType ) )
			scalarParameter.setDataType( IScalarParameterDefn.TYPE_STRING );
		else
			scalarParameter.setDataType( IScalarParameterDefn.TYPE_ANY );
		ArrayList values = new ArrayList( );
		Iterator selectionIter = handle.choiceIterator( );
		while ( selectionIter.hasNext( ) )
		{
			SelectionChoiceHandle selection = (SelectionChoiceHandle) selectionIter
					.next( );
			ParameterSelectionChoice selectionChoice = new ParameterSelectionChoice(
					this.handle );
			selectionChoice.setLabel( selection.getLabelKey( ), selection
					.getLabel( ) );
			selectionChoice.setValue( selection.getValue( ), scalarParameter
					.getDataType( ) );
			values.add( selectionChoice );
		}
		scalarParameter.setSelectionList( values );
		scalarParameter.setAllowNewValues( !handle.isMustMatch( ) );
		scalarParameter.setFixedOrder( handle.isFixedOrder( ) );
		if ( scalarParameter.getSelectionList( ) != null
				&& scalarParameter.getSelectionList( ).size( ) > 0 )
			scalarParameter
					.setSelectionListType( IScalarParameterDefn.SELECTION_LIST_STATIC );
		else
			scalarParameter
					.setSelectionListType( IScalarParameterDefn.SELECTION_LIST_NONE );