Skip to Content
0
Former Member
Apr 12, 2007 at 10:37 AM

Problem while updating excel file in Km

9 Views

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