dataStore.getMetaData().addFiedMeta(new FieldMetadata("IDX", Integer.class));
// ----------------------------------------------------
record = new Record();
record.appendField(new Field("Gennaio"));
record.appendField(new Field("SER1"));
record.appendField(new Field(new Double(33)));
record.appendField(new Field(new Integer(1)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Gennaio"));
record.appendField(new Field("SER2"));
record.appendField(new Field(new Field(new Double(12))));
record.appendField(new Field(new Integer(1)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Gennaio"));
record.appendField(new Field("SER3"));
record.appendField(new Field(new Field(new Double(64))));
record.appendField(new Field(new Integer(1)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Gennaio"));
record.appendField(new Field("SER4"));
record.appendField(new Field(new Field(new Double(21))));
record.appendField(new Field(new Integer(1)));
dataStore.appendRecord(record);
// ----------------------------------------------------
record = new Record();
record.appendField(new Field("Febbraio"));
record.appendField(new Field("SER1"));
record.appendField(new Field("56"));
record.appendField(new Field(new Integer(2)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Febbraio"));
record.appendField(new Field("SER2"));
record.appendField(new Field(new Field(new Double(35))));
record.appendField(new Field(new Integer(2)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Febbraio"));
record.appendField(new Field("SER3"));
record.appendField(new Field(new Field(new Double(13))));
record.appendField(new Field(new Integer(2)));
dataStore.appendRecord(record);
record = new Record();
record.appendField(new Field("Febbraio"));
record.appendField(new Field("SER4"));
record.appendField(new Field(new Field(new Double(75))));
record.appendField(new Field(new Integer(2)));
dataStore.appendRecord(record);
IDataStoreTransformer transformer = new PivotDataSetTransformer("SER", "VAL", "X", false);
transformer.transform(dataStore);
System.out.println(dataStore.toXml());