Subversion Repositories SmartDukaan

Rev

Rev 1631 | Rev 1677 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1631 Rev 1632
Line 58... Line 58...
58
			endDate = df.parse(endDateStr);
58
			endDate = df.parse(endDateStr);
59
			Calendar cal = Calendar.getInstance();
59
			Calendar cal = Calendar.getInstance();
60
			cal.setTime(endDate);
60
			cal.setTime(endDate);
61
			cal.add(Calendar.DATE, 1);
61
			cal.add(Calendar.DATE, 1);
62
			endDate.setTime(cal.getTimeInMillis());
62
			endDate.setTime(cal.getTimeInMillis());
63
			errorMsg = "Date Range: " + startDate + " to " + endDate;
-
 
64
		} catch(ParseException pe) {
63
		} catch(ParseException pe) {
65
			errorMsg = "Please enter start and end dates in format MM/dd/yyyy";
64
			errorMsg = "Please enter start and end dates in format MM/dd/yyyy";
66
			return "report";
65
			return "report";
67
		}
66
		}
68
 
67
 
Line 70... Line 69...
70
		ByteArrayOutputStream baos = paymentDetailGenerator.generatePaymentDetailsReport(startDate, endDate);
69
		ByteArrayOutputStream baos = paymentDetailGenerator.generatePaymentDetailsReport(startDate, endDate);
71
 
70
 
72
		if(baos == null) {
71
		if(baos == null) {
73
			errorMsg = "No output for given date range";
72
			errorMsg = "No output for given date range";
74
			return "report";
73
			return "report";
-
 
74
		} else {
-
 
75
			errorMsg = "";
75
		}
76
		}
76
 
77
 
77
		// Preparing XLS file for output
78
		// Preparing XLS file for output
78
		response.setContentType("application/vnd.ms-excel");
79
		response.setContentType("application/vnd.ms-excel");
79
		response.setHeader("Content-disposition", "inline; filename=payments-report" + ".xls");
80
		response.setHeader("Content-disposition", "inline; filename=payments-report" + ".xls");