cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while updating excel file in Km

Former Member
0 Kudos

Hai,

I am using jxl api to generate excel file . I need to update the excel file. for that i am creating tht excel file in temp location , and updating using this code.


excelFile=new File(fileName);
embedDataIntoExcel();
workbook.write(); 
workbook.close(); 
IWDClientUser wdClientUser = WDClientUser.getCurrentUser(); 
		com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser(); 
		 IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser); 
		 ResourceContext context = new ResourceContext(ep5User); 
		 RID rid = RID.getRID("/path/excelFile.xls"); 
		 IResourceFactory factory =ResourceFactory.getInstance(); 
		 IResource folder = (IResource) factory.getResource(rid,context); 
		
		FileInputStream fin = new FileInputStream(excelFile); 
		 fin.read(); 
		 Content content = new Content(fin,"ms-excel", -1); 
		 folder.updateContent(content);

<b>problem is the excel file is generating with some junk data </b>

how can i solve this

regards,

naga

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,


Content content = new Content(fin,"ms-excel", -1);

in this.. is ms-excel a supported media type ?

Did u try using "text" instead.. ?

Regards

Bharathwaj

Former Member
0 Kudos

Hai,

I am using jxl api to generate excel file . I need to update the excel file. for that i am creating tht excel file in temp location , and updating using this code.

excelFile=new File(fileName);

embedDataIntoExcel();

workbook.write();

workbook.close();

IWDClientUser wdClientUser = WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);

ResourceContext context = new ResourceContext(ep5User);

RID rid = RID.getRID("/path/excelFile.xls");

IResourceFactory factory =ResourceFactory.getInstance();

IResource folder = (IResource) factory.getResource(rid,context);

FileInputStream fin = new FileInputStream(excelFile);

fin.read();

Content content = new Content(fin,"ms-excel", -1);

folder.updateContent(content);

problem is the excel file is generating with some junk data

how can i solve this

regards,

naga

Former Member
0 Kudos

Hai,

Please Hepl me to solve this problem