1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: rpt_Grouping.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 07:43:42 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : marc.neumann@sun.com
36 '* short description : Grouping Report
38 '\***********************************************************************************
41 printlog "------------------ rpt_Grouping.inc ---------------------"
46 '-------------------------------------------------------------------------
47 '-------------------------------------------------------------------------
48 '-------------------------------------------------------------------------
51 '/// open Bibliography database
52 printlog "open Bibliography database"
53 call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb"))
55 '/// open the report designer
56 printlog "open the report designer"
57 call fOpenNewReportDesign
61 '/// select the first table in the content list box
62 printlog "select the first table in the content list box"
63 Kontext "ReportDataProperties"
65 Content.typeKeys("<RETURN>",true) ' important to leave the listbox
67 'close the Add Field dialog to get the focus back to the design
68 call fCloseAddFieldDialog
70 '/// turn of the page header
71 call fSwitchPageHeader
73 '/// insert a data control
74 printlog "insert a data control"
75 Kontext "FormControls"
79 Kontext "ReportDesign"
80 ReportDesign.MouseDown ( 30, 10 )
81 ReportDesign.MouseMove ( 40, 20 )
82 ReportDesign.MouseUp ( 40, 20 )
84 Kontext "ReportDesign"
86 '/// align the control to the left
92 '/// align the control to the top
100 Kontext "ReportPropertiesTabControl"
101 ReportPropertiesTabControl.setPage ReportDataProperties
103 Kontext "ReportDataProperties"
105 DataField.typeKeys("<RETURN>",true) ' important to leave the listbox
107 ' select detail section with unselect the control
108 Kontext "ReportDesign"
109 ReportDesign.MouseDown(50, 10)
110 ReportDesign.MouseUp(50, 10)
112 Kontext "ReportGeneralProperties"
114 Height.typeKeys("<RETURN>",true)
118 '/// open the sorting and grouping
119 Kontext "ReportDesign"
126 Kontext "ReportSortingGrouping"
127 if (ReportSortingGrouping.exists(3)) then
128 Groups.typeKeys("Type",true)
129 Groups.typeKeys("<return>",true)
131 ReportSortingGrouping.Close
133 warnlog "ReportSortingGrouping doesn't exists"
138 '/// execute the report
143 '/// check if the report is created
144 printlog "check if the report is created"
145 Kontext "DocumentWriter"
146 if (DocumentWriter.exists(10)) then
147 call fCloseReportView
149 warnlog "No report is created."
152 '/// close the report designer
153 printlog "close the report designer"
154 call fCloseReportDesign
156 '/// close the database
157 printlog "close the database"
161 '-------------------------------------------------------------------------