KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openbravo > erpReports > RptC_ProposalJr


1 /*
2  *************************************************************************
3  * The contents of this file are subject to the Openbravo Public License
4  * Version 1.0 (the "License"), being the Mozilla Public License
5  * Version 1.1 with a permitted attribution clause; you may not use this
6  * file except in compliance with the License. You may obtain a copy of
7  * the License at http://www.openbravo.com/legal/license.html
8  * Software distributed under the License is distributed on an "AS IS"
9  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10  * License for the specific language governing rights and limitations
11  * under the License.
12  * The Original Code is Openbravo ERP.
13  * The Initial Developer of the Original Code is Openbravo SL
14  * All portions are Copyright (C) 2001-2006 Openbravo SL
15  * All Rights Reserved.
16  * Contributor(s): ______________________________________.
17  ************************************************************************
18 */

19 package org.openbravo.erpReports;
20
21 import org.openbravo.base.secureApp.*;
22 import org.openbravo.xmlEngine.XmlDocument;
23 import java.io.*;
24 import javax.servlet.*;
25 import javax.servlet.http.*;
26 import java.util.HashMap JavaDoc;
27 import org.openbravo.erpCommon.utility.Utility;
28
29
30 public class RptC_ProposalJr extends HttpSecureAppServlet {
31   
32   
33   public void init (ServletConfig config) {
34     super.init(config);
35     boolHist = false;
36   }
37
38   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
39     VariablesSecureApp vars = new VariablesSecureApp(request);
40
41     if (vars.commandIn("DEFAULT")) {
42       String JavaDoc strClave = vars.getSessionValue("RptC_ProposalJr.inpcProjectproposalId_R");
43       if (strClave.equals("")) strClave = vars.getSessionValue("RptC_ProposalJr.inpcProjectproposalId");
44       printPagePartePDF(response, vars, strClave);
45     } else pageError(response);
46   }
47
48
49    void printPagePartePDF(HttpServletResponse response, VariablesSecureApp vars, String JavaDoc strClave) throws IOException,ServletException{
50     if (log4j.isDebugEnabled()) log4j.debug("Output: pdf");
51     RptCProposalJrData[] data = RptCProposalJrData.select(this, strClave, Utility.getContext(this, vars, "#User_Client", "RptC_ProposalJr"), Utility.getContext(this, vars, "#User_Org", "RptC_ProposalJr"));
52     String JavaDoc discard[] = {""};
53     //if (data==null || data.length==0) discard[0] = new String("sectionDetailHeader");
54
//RptCProposalData[][] dataHeader = new RptCProposalData[data.length][];
55
//RptCProposalData[][] dataLines = new RptCProposalData[data.length][];
56
//RptCProposalData[][] dataFootnote = new RptCProposalData[data.length][];
57

58    
59    /* XmlDocument xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpReports/RptC_Proposal", discard).createXmlDocument();
60     // here we pass the familiy-ID with report.setData
61     xmlDocument.setData("structure", data);
62     xmlDocument.setDataArray("reportProposalHeader", "structure1", dataHeader);
63     xmlDocument.setDataArray("reportProposalLines", "structure2", dataLines);
64     xmlDocument.setDataArray("reportProposalFootnote", "structure3", dataFootnote);*/

65
66     String JavaDoc strOutput = "pdf";
67     String JavaDoc strReportName = "@basedesign@/org/openbravo/erpReports/RptC_ProposalJr.jrxml";
68       //if (strOutput.equals("pdf")) response.setHeader("Content-disposition", "inline; filename=RptC_ProposalJr.pdf");
69

70       //data = RptCProposalData.selectNoComparative(this, Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "RptC_ProposalJr"));
71
//HashMap<String, Object> parameters = new HashMap<String, Object>();
72
// parameters.put("Title", "Proposal");
73
//parameters.put("PRODUCT_LEVEL", new Integer(intProductLevel));
74
renderJR(vars, response, strReportName, strOutput, null, data, null);
75     
76     //String strResult = xmlDocument.print();
77
//if (log4j.isDebugEnabled()) log4j.debug(strResult);
78
//renderFO(strResult, response);
79
}
80
81   public String JavaDoc getServletInfo() {
82     return "Servlet that presents the RptCOrders seeker";
83   } // End of getServletInfo() method
84
}
85
Popular Tags