Forums de discussion

Export JSP to excel

thumbnail
Sravan Kumar Chalvadi, modifié il y a 7 années.

Export JSP to excel

New Member Publications: 22 Date d'inscription: 13/01/16 Publications récentes
Hi,

I want to export complete JSP which has mostly labels (elements) to an excel. I tried creating resource URL (in JSP) and serveResource() (in controller).


<portlet:resourceurl var="exportToExcelURL">
  <portlet:param name="mvcPath" value="/service_notification_report.jsp" />
</portlet:resourceurl>


@Override
	public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
			throws IOException, PortletException {
		System.out.println("serve resource");
		resourceResponse.setContentType("application/vnd.ms-excel");
		resourceResponse.setProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\""+ "excel.xls" + "\"");
		super.serveResource(resourceRequest, resourceResponse);
	}


This is resulting an excel sheet with out lables text.

Thanks!
thumbnail
Byrån Zaugg, modifié il y a 7 années.

RE: Export JSP to excel

Expert Publications: 252 Date d'inscription: 06/04/12 Publications récentes
This forum is for the AlloyUI Javascript framework.

You may get more help from the Liferay Portal Development Forum .