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_PageNumber.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 : Page Number
38 '\***********************************************************************************
41 printlog "------------------ rpt_PageNumber.inc ---------------------"
47 '-------------------------------------------------------------------------
48 '-------------------------------------------------------------------------
49 '-------------------------------------------------------------------------
50 testcase tDefaultSetting
52 '/// FILE / OPEN / biblio.odb
53 printlog "FILE / OPEN / biblio.odb"
54 call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb"))
57 printlog "INSERT / REPORT"
58 call fOpenNewReportDesign
62 '/// select any section to get the insert page number menu item activated
63 printlog "select any section to get the insert page number menu item activated"
64 Kontext "ReportDesign"
65 ReportDesign.MouseDown(50, 10)
66 ReportDesign.MouseUp(50, 10)
68 '/// INSERT / PAGE NUMBER
69 Kontext "ReportDesign"
75 '/// check if the "Page Number" dialog appear
76 printlog "check if the ""Page Number"" dialog appear"
77 Kontext "ReportPageNumber"
78 if (ReportPageNumber.exists(3)) then
80 '/// check if PageN is checked
81 printlog "check if PageN is checked"
82 if ( PageN.isChecked() ) then
83 printlog "Default PageN is checked"
85 warnlog "Default PageN is not checked"
88 '/// check if PageOfPage is checked
89 printlog "check if PageOfPage is checked"
90 if TopOfPage.isChecked() then
91 printlog "Default TopOfPage is checked"
93 warnlog "Default TopOfpage is not checked"
96 '/// check if PageAlignment is set to center
97 printlog "check if PageAlignment is set to center"
98 if ( PageNumberAlignment.getSelIndex() = 2 ) then
99 printlog "center alignment is selected"
101 warnlog "center alignment is not selected"
104 '/// check if ShowNumberOnFirstPage checkboc is available. If not issue i78945
105 printlog "check if ShowNumberOnFirstPage checkboc is available"
106 if ( ShowNumberOnFirstPage.isVisible() ) then
108 '/// check if ShowNumberOnFirstPage is checked
109 printlog "check if PageAlignment is set to center"
110 if ( ShowNumberOnFirstPage.isChecked() ) then
111 printlog "ShowNumberOnFirstPage is checked"
113 warnlog "ShowNumberOnFirstPage is not checked"
116 qaerrorlog "#i78945# ShowNumberOnFirstPage is not visible"
118 '/// close dialog with OK
119 printlog "close dialog with OK"
122 warnlog "ReportPageNumber doesn't exists"
125 '/// close the report designer with WINDOW / CLOSE
126 printlog "close the report designer with WINDOW / CLOSE"
127 call fCloseReportDesign
129 '/// close the database with FILE / CLOSE
130 printlog "close the database with FILE / CLOSE"
134 '-------------------------------------------------------------------------
137 '/// open Bibliography database
138 printlog "open Bibliography database"
139 call fOpenDataBase(gOfficePath + ConvertPath("user/database/biblio.odb"))
141 '/// open the report designer
142 printlog "open the report designer"
143 call fOpenNewReportDesign
147 '/// select the first table in the content list box
148 printlog "select the first table in the content list box"
149 Kontext "ReportDataProperties"
151 Content.typeKeys("<RETURN>",true) ' important to leave the listbox
153 'close the Add Field dialog to get the focus back to the design
154 call fCloseAddFieldDialog
156 '/// turn of the page header
157 call fSwitchPageHeader
158 '/// insert a data control
159 printlog "insert a data control"
160 Kontext "FormControls"
164 Kontext "ReportDesign"
165 ReportDesign.MouseDown ( 30, 10 )
166 ReportDesign.MouseMove ( 40, 20 )
167 ReportDesign.MouseUp ( 40, 20 )
169 Kontext "ReportDesign"
171 '/// align the control to the left
177 '/// align the control to the top
185 Kontext "ReportPropertiesTabControl"
186 ReportPropertiesTabControl.setPage ReportDataProperties
188 Kontext "ReportDataProperties"
190 DataField.typeKeys("<RETURN>",true) ' important to leave the listbox
192 ' select detail section with unselect the control
193 Kontext "ReportDesign"
194 ReportDesign.MouseDown(50, 10)
195 ReportDesign.MouseUp(50, 10)
197 Kontext "ReportGeneralProperties"
199 Height.typeKeys("<RETURN>",true)
201 '/// INSERT / PAGE NUMBER
202 Kontext "ReportDesign"
209 Kontext "ReportPageNumber"
211 printlog "check PageNofM"
213 '/// check BottomOfPage
214 printlog "check BottomOfPage"
216 '/// select the 3 entry inPageNumberAlignment
217 printlog "select the 3 entry inPageNumberAlignment"
218 PageNumberAlignment.select(3)
220 '/// close dialog with OK
221 printlog "close dialog with OK"
227 Kontext "ReportPropertiesTabControl"
228 ReportPropertiesTabControl.setPage ReportDataProperties
230 Kontext "ReportDataProperties"
232 s = DataField.getSelText()
233 if ((instr(s," & PageNumber() & ") = 0) OR (instr(s," & PageCount()") = 0)) then
234 warnlog "The page number function is not correct.The function is " + s
236 printlog "The page number function is correct."
239 '/// execute the report
244 '/// check if the report is created
245 printlog "check if the report is created"
246 Kontext "DocumentWriter"
247 if (DocumentWriter.exists(10)) then
248 call fCloseReportView
250 warnlog "No report is created."
253 '/// close the report designer with WINDOW / CLOSE
254 printlog "close the report designer with WINDOW / CLOSE"
255 call fCloseReportDesign
257 '/// close the database with FILE / CLOSE
258 printlog "close the database with FILE / CLOSE"
262 '-------------------------------------------------------------------------