Commit dd635828 authored by chavanp's avatar chavanp

JSP for Downloade GST_Sales_Template and GST_Purchase_Template.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@105898 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 74563778
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="ibase.utility.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.net.URLEncoder"%>
<%@ page import="java.io.*" %>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
ibase.utility.UserInfoBean userInfo = (ibase.utility.UserInfoBean)session.getAttribute("USER_INFO");
String referer = request.getRequestURL().toString();
referer = referer.substring( referer.indexOf( "ibase" ) - 1 );
String queryString = (String)request.getQueryString();
queryString = (queryString == null) ? "" : queryString;
referer = referer +"?"+queryString;
if( userInfo == null )
{
%>
<jsp:forward page="/jsp/DirectAccess.jsp">
<jsp:param name="REFERER" value="<%=referer%>"/>
</jsp:forward>
<%
}
%>
<%
String objName = request.getParameter("OBJ_NAME");
System.out.println("objName ["+objName+"]");
if("gstr".equalsIgnoreCase(objName))
{
String filePath = CommonConstants.JBOSSHOME+File.separator+"Download"+File.separator+"Template"+File.separator+"GST_Sales_Template.xls";
System.out.println("filepath in jsp file is........." + filePath);
response.setContentType("application/excel");
System.out.println("file name is........." );
String fileName = "GST_Sales_Template.xls";
response.setHeader("Content-Disposition","attachment; fileName=\"" + fileName + "\"");
java.io.FileInputStream fileInputStream=new java.io.FileInputStream(filePath);
HSSFWorkbook workBook = new HSSFWorkbook(fileInputStream);
OutputStream outStream = response.getOutputStream();
workBook.write(outStream);
outStream.flush();
}
else
{
String filePath = CommonConstants.JBOSSHOME+File.separator+"Download"+File.separator+"Template"+File.separator+"GST_Purchase_Template.xls";
System.out.println("filepath in jsp file is........." + filePath);
response.setContentType("application/excel");
System.out.println("file name is........." );
String fileName = "GST_Purchase_Template.xls";
response.setHeader("Content-Disposition","attachment; fileName=\"" + fileName + "\"");
java.io.FileInputStream fileInputStream=new java.io.FileInputStream(filePath);
HSSFWorkbook workBook = new HSSFWorkbook(fileInputStream);
OutputStream outStream = response.getOutputStream();
workBook.write(outStream);
outStream.flush();
}
%>
<html>
<body>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment