cancel
Showing results for 
Search instead for 
Did you mean: 

Download Excel file through Web dynpro with no windows open?

Former Member
0 Kudos

Can we have a web dynpro application that just returns an Excel file in the response with no open windows? Similar to a java servlet that is used to download a Excel file?

This basically means that I cannot use wdComponentAPI.getWindowManager().createNonModalExternalWindow()

Java Servlet Code

HttpSession session = request.getSession();      // get a handle on the session id
response.setContentType("application/download");
response.setHeader("Content-Disposition", "filename=RTIS_Report.xls");
PrintWriter out = null;
out = response.getWriter();
String report = request.getParameter("REPORT");
JCO.Table lines = download(request, session, report);

for (int i = 0; i < lines.getNumRows(); i++) {
	lines.setRow(i);
	String content = lines.getString("LINES") + "\n";
	out.write(content);
	out.flush();
}
out.flush();
out.close();
}

View Entire Topic
Qualiture
Active Contributor
0 Kudos

Hi Faraz,

then why not simply use a servlet?

Web Dynpro is SAP's MVC framework, and as such requires at least one View element, so I don't think your requirement is possible (i.e. to write directly to the output stream)

Best,

Robin

Former Member
0 Kudos

Thats what i was thinking too. Using servlet.