KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > compiere > report > MReport


1 /******************************************************************************
2  * The contents of this file are subject to the Compiere License Version 1.1
3  * ("License"); You may not use this file except in compliance with the License
4  * You may obtain a copy of the License at http://www.compiere.org/license.html
5  * Software distributed under the License is distributed on an "AS IS" basis,
6  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
7  * the specific language governing rights and limitations under the License.
8  * The Original Code is Compiere ERP & CRM Smart Business Solution
9  * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
10  * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
11  * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved.
12  * Contributor(s): ______________________________________.
13  *****************************************************************************/

14 package org.compiere.report;
15
16 import java.util.*;
17 import java.sql.*;
18 import java.math.*;
19 import java.io.Serializable JavaDoc;
20
21 import org.compiere.model.*;
22 import org.compiere.util.*;
23
24
25 /**
26  * Report Model
27  *
28  * @author Jorg Janke
29  * @version $Id: MReport.java,v 1.6 2003/07/05 06:06:49 jjanke Exp $
30  */

31 public class MReport extends X_PA_Report
32 {
33     /**
34      * Constructor
35      * @param ctx context
36      * @param PA_Report_ID id
37      */

38     public MReport (Properties ctx, int PA_Report_ID)
39     {
40         super (ctx, PA_Report_ID);
41         if (PA_Report_ID == 0)
42         {
43             setName (null);
44             setPA_ReportLineSet_ID (0);
45             setPA_ReportColumnSet_ID (0);
46             setListSources(false);
47             setListTrx(false);
48         }
49         else
50         {
51             m_columnSet = new MReportColumnSet (ctx, getPA_ReportColumnSet_ID());
52             m_lineSet = new MReportLineSet (ctx, getPA_ReportLineSet_ID());
53         }
54     } // MReport
55

56     private MReportColumnSet m_columnSet = null;
57     private MReportLineSet m_lineSet = null;
58
59     /**
60      * List Info
61      */

62     public void list()
63     {
64         System.out.println(toString());
65         if (m_columnSet != null)
66             m_columnSet.list();
67         System.out.println();
68         if (m_lineSet != null)
69             m_lineSet.list();
70     } // dump
71

72     /**
73      * Get Where Clause for Report
74      * @return Where Clause for Report
75      */

76     public String JavaDoc getWhereClause()
77     {
78         // AD_Client indirectly via AcctSchema
79
StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
80         // Mandatory AcctSchema
81
sb.append("C_AcctSchema_ID=").append(getC_AcctSchema_ID());
82         //
83
return sb.toString();
84     } // getWhereClause
85

86     /*************************************************************************/
87
88     /**
89      * String Representation
90      * @return Info
91      */

92     public String JavaDoc toString ()
93     {
94         StringBuffer JavaDoc sb = new StringBuffer JavaDoc ("MReport[")
95             .append(getID()).append(" - ").append(getName());
96         if (getDescription() != null)
97             sb.append("(").append(getDescription()).append(")");
98         sb.append(" - C_AcctSchema_ID=").append(getC_AcctSchema_ID())
99             .append(", C_Calendar_ID=").append(getC_Calendar_ID());
100         sb.append ("]");
101         return sb.toString ();
102     } // toString
103

104
105     public MReportColumnSet getColumnSet()
106     {
107         return m_columnSet;
108     }
109
110     public MReportLineSet getLineSet()
111     {
112         return m_lineSet;
113     }
114
115 } // MReport
116
Popular Tags