on 11-15-2007 11:32 AM
Hello Experts,
Can someone please tell me how to read an excel file in a webdynpro application?
There is a tutorial for how to write contect into an excel, but i want to read the excel.
Can someone help please !!
Thanks and Kind regards,
G.Singh.
Hi
Check this thread ....
https://forums.sdn.sap.com/click.jspa?searchID=6699422&messageID=2935176
https://forums.sdn.sap.com/click.jspa?searchID=6699422&messageID=2760876
check this blog ...
/people/subramanian.venkateswaran2/blog/2006/10/02/enhanced-file-upload--uploading-and-processing-excel-sheets
Regards
Akshaya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks experts...
Kind Regards,
G. Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi G.Singh,
I have a similar requirement for my application can u let me know the procedure step-by-step on how u got to fulfill the requirement.
In my application i have a Browse Button,when i click on it and get the Excel file the contents of the file must be displayed in the page through WebDynPro.
Can anyone let me know how this is possible.
Thanks and regards,
Chandrashekar.
Hello Experts,
I have done all the given above.
I want to read a excel file from KM. My code is as below
ResourceContext resourceContext = buildResourceContext();
IResourceFactory resourceFactory = ResourceFactory.getInstance();
RID pathRID = RID.getRID("/documents/ExcelReport.xls");
IResource resource = resourceFactory.getResource(pathRID, resourceContext);
Workbook wb = Workbook.getWorkbook(resource.getURI().getPath());
Sheet sh = wb.getSheet(0);
int columns = sh.getColumns();
int rows = sh.getRows();
wdComponentAPI.getMessageManager().reportSuccess(" Rows: " + rows);
wdComponentAPI.getMessageManager().reportSuccess(" Columns: " + columns);
This does not give me the excel file form the KM
Can you please just what i can do at this point?
Kind Regards,
G Singh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you please be a little elaborate on how to create and external library and then how to refer it..
Thanks and Regards,
G. Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have laready added it as an External jar to my project.
Thanks and Regards,
G. Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello LakshmiNarayana
Yes i am using a DC. Can you tell me how to include this jar into the DC project.
Regards,
G. Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Experts,
I have already gone through all these links.
My code looks something like this
File xlsFile = new File(resource.getURI().getPath());
Workbook wb =Workbook.getWorkbook(xlsFile);
Sheet sh = wb.getSheet(0);
int columns = sh.getColumns();
int rows = sh.getRows();
int i=0;
for(int j=1;j<=rows;j++){
Cell c1 = sh.getCell(i,j); wdComponentAPI.getMessageManager().reportSuccess( " Report ID: " + c1.getContents());
}
I am addinh the Librarary reference to "jxl.jar". Also copying it to the Lib folder of my project. But still i get the error
"java.lang.NoClassDefFoundError: jxl/Workbook "
Can you help.
Kind Regards,
G. Singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
try this code Using JExcel Library
Workbook w=Workbook.getWorkbook(f);
Sheet sh=w.getSheet(0);
int cols=sh.getColumns();
int rows=sh.getRows();
Cell c=null;
String s1=null;
String s2=null;
String s3=null;
String s4=null;
for(int i=1;i<rows;i++)
{
s1=sh.getCell(0,i).getContents();
s2=sh.getCell(1,i).getContents();
s3=sh.getCell(2,i).getContents();
s4=sh.getCell(3,i).getContents();
}
Add jxl.jar file in java build path of your application
then Organize imports
Regards
LakshmiNarayana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.