Skip to main content

All Questions

Tagged with
0 votes
2 answers
638 views

Delete an Excel file after processing in Java

I want to take an input Java file from an HTMl form process it using servlets, and delete it after use. However I am not able to find any viable solutions for the same. What are the options I can go ...
lord foul's user avatar
0 votes
1 answer
517 views

Upload Excel file using servlet for temporary use, Java Eclipse [duplicate]

I am trying to upload an excel file using servlet on Tomcat server using Eclipse IDE. I have written the following code to take the file via an HTML form. There are no errors on the program but the ...
lord foul's user avatar
0 votes
1 answer
654 views

Receiving corrupted response when writing xlsx file to HttpServletResponse

I have a Spring controller that should return xlsx file: @PostMapping("/export") public void exportExcelFile( HttpServletResponse response) { myService.exportExcel(response); }...
Mykhailo Bormashenko's user avatar
0 votes
1 answer
1k views

Excel file exported to ServletOutputStream is corrupted

I am writing an excel file onto ServletOutputStream (using HSSFWorkBook for xls and XSSFWorkBook for xlsx). The excel that gets downloaded as part of the ServletResponse is corrupted and contains junk ...
durgapmenon's user avatar
1 vote
3 answers
7k views

Reading Excel File Column in Java

I have a sample of Excel data that needs to be read and store in the database. Example: Code | BO1 | BO2 | BO3 | ..... 10001 | 200.00 | 400.00 | 0.00 | ..... 10002 | 0.00 | 100.00 | 500....
Ask Warvin's user avatar
0 votes
1 answer
701 views

Apache POI - XSSFWorkbook + servlet response

I find a problem on using apache-poi. Here is my code. XSSFWorkbook workbook = new XSSFWorkbook(new FileInputStream(request.getSession().getServletContext().getRealPath("/Testing.xlsx"))); ...
user3259913's user avatar
0 votes
0 answers
21 views

Excel file is saved in Eclipse jee folder, not in project folder [duplicate]

Goodmorning, I am trying to download a Excel file that in my main method saves the excel file in my root folder of my project, but when I try it via the webapp with a HTTPServlet it gets saved in C:\...
PRIVATE ACCOUNT's user avatar
0 votes
0 answers
18 views

Servlet with java.lang.IllegalStateException: Cannot forward after response has been committed [Apache POI] when export to Excel [duplicate]

I have the following code and get an exception. Can you help me what I am doing wrong? package com.java400; import com.ibm.as400.access.*; import java.io.IOException; import javax.servlet....
Rully Adentra's user avatar
3 votes
1 answer
8k views

Streaming a POI SXSSFWorkbook to the servlet output stream

We are building a Spring boot REST endpoint that generates a large XLS file (may contain ~ 1mil lines) and provides it for download. The current solution uses the SXSSF API of Apache POI library for ...
chirina's user avatar
  • 143
1 vote
1 answer
1k views

How to print two columns in excel side by side after writing all rows from the first column?

I have created code in which data is accessible through the database and then that data is written in the excel sheet. Now data is written successfully. But the issue is when the data is get written ...
steave jackson's user avatar
-3 votes
1 answer
651 views

How to write data in excel sheet in specific cell using servlet?

I'm New to Servlet please help me out. I have created a Servlet file in which one excel file contains some data from the user. data is printed through the string. Now, most of the data is printed as ...
steave jackson's user avatar
0 votes
0 answers
650 views

why excel file downloaded using java servlet and apache POI library complains about file format or extension?

I have created a java servlet class. The getEmployeeExperienceInExcel() method of this servlet creates the excel file where employee details should be printed (employee details are featched from ...
Saroj's user avatar
  • 31
1 vote
1 answer
389 views

How to download excel sheet which fetch resultset from database

I have used Apache POI library and generated excel sheet from database using query to obtain list of doctors and their details. I have to go to the below mentioned location "C:\Users\Mohan\Downloads\...
Mohan's user avatar
  • 11
3 votes
1 answer
6k views

Could not initialize class org.apache.poi.poifs.filesystem.FileMagic

while uploading .xlsx java.lang.NoClassDefFoundError: Could not initialize class org.apache.poi.poifs.filesystem.FileMagic and while uploading .xls file getting error java.io.IOException: Unable to ...
smita mishra's user avatar
0 votes
1 answer
444 views

Uploading excel in servlet

I’m trying to upload an excel in servlet and process it. While uploading I set enctype=“multipart/form-data” in my form. But in my servlet .isMultiPart(request) returns false. JSP code: function ...
Charan 's user avatar
  • 143

15 30 50 per page
1
2 3 4 5