%line | %branch | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
net.sf.infrared.web.action.ExportSummaryReportToExcel |
|
|
1 | /* |
|
2 | * Copyright 2005 Tavant Technologies and Contributors |
|
3 | * |
|
4 | * Licensed under the Apache License, Version 2.0 (the "License") |
|
5 | * you may not use this file except in compliance with the License. |
|
6 | * You may obtain a copy of the License at |
|
7 | * |
|
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
|
9 | * |
|
10 | * Unless required by applicable law or agreed to in writing, software |
|
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 | * See the License for the specific language governing permissions and |
|
14 | * limitations under the License. |
|
15 | * |
|
16 | * |
|
17 | * |
|
18 | * Original Author: kamal.govindraj (Tavant Technologies) |
|
19 | * Contributor(s): subin.p; |
|
20 | * |
|
21 | */ |
|
22 | package net.sf.infrared.web.action; |
|
23 | ||
24 | import org.apache.struts.action.Action; |
|
25 | import org.apache.struts.action.ActionForward; |
|
26 | import org.apache.struts.action.ActionMapping; |
|
27 | import org.apache.struts.action.ActionForm; |
|
28 | ||
29 | import javax.servlet.http.HttpServletRequest; |
|
30 | import javax.servlet.http.HttpServletResponse; |
|
31 | import javax.servlet.http.HttpSession; |
|
32 | ||
33 | import net.sf.infrared.web.report.SummaryReport; |
|
34 | import net.sf.infrared.web.report.ReportFactory; |
|
35 | import net.sf.infrared.web.util.PerformanceDataSnapshot; |
|
36 | ||
37 | import java.util.Set; |
|
38 | import java.util.Iterator; |
|
39 | import java.io.IOException; |
|
40 | ||
41 | /** |
|
42 | * This is the action class, which generates an excel report of the performance statistics. |
|
43 | */ |
|
44 | 0 | public class ExportSummaryReportToExcel |
45 | extends Action |
|
46 | { |
|
47 | public ActionForward execute(ActionMapping mapping, |
|
48 | ActionForm form, |
|
49 | HttpServletRequest request, |
|
50 | HttpServletResponse response) throws IOException |
|
51 | { |
|
52 | 0 | HttpSession session = request.getSession(); |
53 | 0 | SummaryReport report = ReportFactory.createReport(ReportFactory.EXCEL); |
54 | ||
55 | 0 | PerformanceDataSnapshot perfData = |
56 | (PerformanceDataSnapshot) session.getAttribute("perfData"); |
|
57 | ||
58 | 0 | report.addSnapShot(perfData); |
59 | ||
60 | 0 | response.setContentType("application/vnd.ms-excel"); |
61 | 0 | report.save(response.getOutputStream()); |
62 | 0 | return null; |
63 | } |
|
64 | } |
This report is generated by jcoverage, Maven and Maven JCoverage Plugin. |