on 03-03-2014 8:52 AM
Hello Experts,
I have one scenario where I have to generate ".XLSX" file and I have followed the below post by Aashish Sinha.
The output file is generated with ".xlsx" however while we are trying open the file,it is saying that the file is corrupt.If we change the extension manually to ".xls" then it opens,though it gives a warning. We need to generate a proper ".XLSX" file which could be opened without any warning.
Can any one advise if there is any way to have that? Appreciate your help!!
Note:I tried the JAVA mapping and got same problem.
Regards,
Arijit
Hi Arijit
Have you tried the JExcel API?
If not then you can have a look on the below
CODE - Create an Excel File via the JExcel API - Process Integration - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arijit
The link I have provided has the code . Only you need to use them inside a java mapping.
You can find thousands of blog on Java mapping in SAP PI.
This is simple format of java mapping
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class JavaMapForHemant extends AbstractTransformation {
public void transform(TransformationInput arg0, TransformationOutput arg1)
throws StreamTransformationException {
try {
} catch (Exception e) {
e.printStackTrace();
}
} // end of transform
}
You need to write your code inside the transform method.
Thanks Indrajit,But here I have the input in XML which looks like below.
<MT_TEST>
<Records>
<Name1>
<Name2>
</Records>
<Records>
....
...
</Records>
</MT_TEST>
Now I need to write the EXCEL(.xlsx) file with two header Name1 and Name2. Can you please help me with the code? Appreciate your kind help!!
Thanks,
Arijit
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.