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: ReportBuilder01.inc,v $
13 '* last change: $Author: obo $ $Date: 2008-07-25 07:44:12 $
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 : report builder include file
38 '\***********************************************************************************
41 printlog "------------------ ReportBuilder01.inc ---------------------"
43 if ( tools_reporttools_InstallExtension() = 0 ) then
47 call tConditionalFormatingDialog
53 call tReportHeaderFooter
54 call tPageHeaderFooter
57 warnlog "report extension could not installed"
61 '-------------------------------------------------------------------------
62 '-------------------------------------------------------------------------
63 '-------------------------------------------------------------------------
68 '/// open Bibliography database
70 call hFileOpen(gOfficePath + ConvertPath("user/database/biblio.odb"))
74 Insight.MouseDown(50,50)
75 Insight.MouseUp(50,50)
78 '/// open the report designer
79 call fOpenNewReportDesign
83 '/// check the menu for the right entries
86 Kontext "ReportDesign"
87 if ( ReportDesign.exists( 20 ) ) then
89 '/// check if there are 10 items in the file menu.
90 printlog "check if there are 10 items in the file menu."
91 hMenuSelectNr(1) ' the file menu
92 iCount = hMenuItemGetCount()
93 if ( lcase( gPlatform ) = "osx" ) then
94 if ( iCount <> 9 ) then
95 warnlog( "File menu: 9 Items expected, found " & iCount )
98 if (iCount <> 10 ) then
99 warnlog "There should be 10 items in the file menu but there are " + iCount + " items."
103 '/// check if there are 12 items in the FILE/NEW menu.
104 printlog "check if there are 12 items in the FILE/NEW menu."
105 hMenuSelectNr(1) ' FILE/NEW menu
106 iCount = hMenuItemGetCount()
107 if (iCount <> 12) then
108 warnlog "There should 12 items in the FILE/NEW menu but there are " + iCount + " items."
110 call hMenuClose() ' close the FILE menu
112 '/// check the FILE/AUTOPILOTS
113 printlog "check the FILE/AUTOPILOTS"
115 hMenuSelectNr(1) ' the file menu
116 hMenuSelectNr(4) ' the autopilots menu
117 iCount = hMenuItemGetCount()
118 if (iCount <> 8) then
119 warnlog "There should 8 items in the FILE/AUTOPILOTS menu but there are " + iCount + " items."
125 '/// check if there are 11 items in the edit menu.
126 printlog "check if there are 11 items in the edit menu."
129 iCount = hMenuItemGetCount()
130 if (iCount <> 11) then
131 warnlog "There should 11 items in the edit menu but there are " + iCount + " items."
137 '/// check if there are 11 items in the view menu.
138 printlog "check if there are 11 items in the view menu."
141 iCount = hMenuItemGetCount()
142 if (iCount <> 11) then
143 warnlog "There should 11 items in the view menu but there are " + iCount + " items."
149 '/// check if there are 3 items in the insert menu.
150 printlog "check if there are 3 items in the insert menu."
153 iCount = hMenuItemGetCount()
154 if (iCount <> 3) then
155 warnlog "There should 3 items in the insert menu but there are " + iCount + " items."
161 '/// check if there are 7 items in the format menu.
162 printlog "check if there are 7 items in the format menu."
165 iCount = hMenuItemGetCount()
166 if (iCount <> 7) then
167 warnlog "There should 7 items in the format menu but there are " + iCount + " items."
171 '/// check if there are 6 items in the format/arange menu.
172 printlog "check if there are 6 items in the format/arange menu."
176 iCount = hMenuItemGetCount()
177 if (iCount <> 6) then
178 warnlog "There should 6 items in the format/arrange menu but there are " + iCount + " items."
182 '/// check if there are 6 items in the format/alignment menu.
183 printlog "check if there are 6 items in the format/alignment menu."
187 iCount = hMenuItemGetCount()
188 if (iCount <> 6) then
189 warnlog "There should 6 items in the format/alignment menu but there are " + iCount + " items."
193 '/// check if there are 4 items in the format/object resiing menu.
194 printlog "check if there are 4 items in the format/object resiing menu."
198 iCount = hMenuItemGetCount()
199 if (iCount <> 4) then
200 warnlog "There should 4 items in the format/alignment menu but there are " + iCount + " items."
207 '/// check if there are 4 items in the tools menu.
208 printlog "check if there are 4 items in the tools menu."
211 iCount = hMenuItemGetCount()
212 if ( lcase( gPlatform ) = "osx" ) then
213 if ( iCount <> 3 ) then
214 warnlog( "Tools menu: 3 items expected, found " & iCount )
217 if (iCount <> 4) then
218 warnlog "There should 4 items in the tools menu but there are " + iCount + " items."
225 '/// check if there are 9 items in the help menu.
226 printlog "check if there are 9 items in the help menu."
229 iCount = hMenuItemGetCount()
230 if ( lcase( gPlatform ) = "osx" ) then iCount = iCount + 1 ' dirty, but check is fuzzy anyway.
232 if (iCount <> 9) then
233 warnlog "There should 9 items in the help menu but there are " + iCount + " items."
236 if (iCount <> 9 AND iCount <> 8 ) then
237 warnlog "There should 8 or 9 items in the help menu but there are " + iCount + " items."
243 '/// close the report designer
244 call fCloseReportDesign
247 warnlog "The Report Designer did not open within expected timeframe"
249 '/// close the database
253 '-------------------------------------------------------------------------
254 testcase tConditionalFormatingDialog
256 '/// open Bibliography database
257 printlog "open Bibliography database"
258 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
260 '/// open the report designer
261 printlog "open the report designer"
262 call fOpenNewReportDesign
264 Kontext "ReportDesign"
265 ReportDesign.Maximize()
267 '/// insert a data control
268 printlog "insert a data control"
269 Kontext "FormControls"
273 Kontext "ReportDesign"
274 ReportDesign.MouseDown ( 30, 10 )
275 ReportDesign.MouseMove ( 40, 20 )
276 ReportDesign.MouseUp ( 40, 20 )
279 '/// open the conditional formating dialog via the menu
280 printlog "open the conditional formating dialog via the menu"
281 Kontext "ReportDesign"
286 '/// check if the conditional formating dialog appear
287 printlog "check if the conditional formating dialog appear"
289 Kontext "ConditionalFormating"
290 if ( not ConditionalFormating.exists(3)) then
291 warnlog "Condditional Formating Dialog doesn't appear"
292 call fCloseReportDesign
296 printlog "Conditional Formating Dialog appear"
297 call DialogTest(ConditionalFormating)
298 ConditionalFormating.Cancel
301 '/// check if there is one condition
302 '/// add 2 more conditions and check if the dialog grows
303 '/// add one more condition and check if the scrollbar gets enabled
304 '/// check if the right condition is displayed
305 '/// remove the second condition and check if the scrollbar gets disabled
306 '/// remove 2 conditions and check if the dialog skrink
308 '/// close the report designer
309 call fCloseReportDesign
310 '/// close the database
314 '-------------------------------------------------------------------------
315 testcase tExecuteReport
317 '/// open Bibliography database
318 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
320 '/// open the report designer
321 call fOpenNewReportDesign
323 '/// select the first table in the content list box
324 printlog "select the first table in the content list box"
325 Kontext "ReportDataProperties"
327 Content.typeKeys("<RETURN>",true) ' important to leave the listbox
329 Kontext "ReportDesign"
330 ReportDesign.TypeKeys("<MOD1 TAB>",true)
331 ReportDesign.TypeKeys("<MOD1 TAB>",true)
333 Kontext "ReportAddField"
334 ReportAddFieldList.select 1
335 ReportAddField.TypeKeys("<RETURN>",true)
337 'close the Add Field dialog to get the focus back to the design
338 call fCloseAddFieldDialog()
340 '/// execute the report
341 printlog "execute the report"
342 Kontext "ReportDesign"
349 '/// ckeck if the report is created
350 printlog "ckeck if the report is created"
351 Kontext "DocumentWriter"
352 if (DocumentWriter.exists(10)) then
353 call fCloseReportView
355 warnlog "No report is created."
359 '/// close the report design
360 printlog "close the report design"
361 call fCloseReportDesign
363 '/// close the database
364 printlog "close the database"
368 '-------------------------------------------------------------------------
371 '/// open Bibliography database
372 printlog "open Bibliography database"
373 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
375 '/// open the report designer
376 printlog "open the report designer"
377 call fOpenNewReportDesign
379 '/// insert a data control
380 printlog "insert a data control"
381 Kontext "FormControls"
385 Kontext "ReportDesign"
386 ReportDesign.MouseDown ( 30, 20 )
387 ReportDesign.MouseMove ( 40, 30 )
388 ReportDesign.MouseUp ( 40, 30 )
391 '/// open page number dialog via the menu
392 printlog "open page number dialog via the menu"
393 Kontext "ReportDesign"
398 '/// check if the page number dialog appear
399 printlog "check if the page number dialog appear"
400 Kontext "ReportPageNumber"
401 if ( not ReportPageNumber.exists(3)) then
402 warnlog "Page Number Dialog doesn't appear"
403 call fCloseReportDesign
407 printlog "Page Number Dialog appear"
408 call DialogTest(ReportPageNumber)
409 ReportPageNumber.Cancel
412 '/// close the report designer
413 call fCloseReportDesign
414 '/// close the database
418 '-------------------------------------------------------------------------
421 '/// open Bibliography database
422 printlog "open Bibliography database"
423 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
425 '/// open the report designer
426 printlog "open the report designer"
427 call fOpenNewReportDesign
429 '/// insert a data control
430 printlog "insert a data control"
431 Kontext "FormControls"
435 Kontext "ReportDesign"
436 ReportDesign.MouseDown ( 30, 20 )
437 ReportDesign.MouseMove ( 40, 30 )
438 ReportDesign.MouseUp ( 40, 30 )
441 '/// open date time dialog via the menu
442 printlog "open date time dialog via the menu"
443 Kontext "ReportDesign"
448 '/// check if the date time dialog appear
449 printlog "check if the date time dialog appear"
450 Kontext "ReportDateTime"
451 if ( not ReportDateTime.exists(3)) then
452 warnlog "Date Time Dialog doesn't appear"
453 call fCloseReportDesign
457 printlog "Date Time Dialog appear"
458 call DialogTest(ReportDateTime)
459 ReportDateTime.Cancel
463 '/// close the report designer
464 call fCloseReportDesign
465 '/// close the database
469 '-------------------------------------------------------------------------
470 testcase tGroupingSorting
472 '/// open Bibliography database
473 printlog "open Bibliography database"
474 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
476 '/// open the report designer
477 printlog "open the report designer"
478 call fOpenNewReportDesign
480 '/// insert a data control
481 printlog "insert a data control"
482 Kontext "FormControls"
486 Kontext "ReportDesign"
487 ReportDesign.MouseDown ( 30, 50 )
488 ReportDesign.MouseMove ( 40, 60 )
489 ReportDesign.MouseUp ( 40, 60 )
492 '/// open date time dialog via the menu
493 printlog "open date time dialog via the menu"
494 Kontext "ReportDesign"
499 '/// check if the sorting and grouping dialog appear
500 printlog "check if the sorting and grouping dialog appear"
501 Kontext "ReportSortingGrouping"
502 if ( not ReportSortingGrouping.exists(3)) then
503 warnlog "Sorting and Grouping Dialog doesn't appear"
504 call fCloseReportDesign
508 printlog "Sorting and Grouping Dialog appear"
509 call DialogTest(ReportSortingGrouping)
510 ReportSortingGrouping.Close
514 '/// close the report designer
515 call fCloseReportDesign
516 '/// close the database
520 '-------------------------------------------------------------------------
521 testcase tReportNavigator
523 '/// open Bibliography database
524 printlog "open Bibliography database"
525 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
527 '/// open the report designer
528 printlog "open the report designer"
529 call fOpenNewReportDesign
531 '/// insert a data control
532 printlog "insert a data control"
533 Kontext "FormControls"
537 Kontext "ReportDesign"
538 ReportDesign.MouseDown ( 30, 50 )
539 ReportDesign.MouseMove ( 40, 60 )
540 ReportDesign.MouseUp ( 40, 60 )
543 '/// open report navigator via the menu
544 printlog "open report navigator via the menu"
545 Kontext "ReportDesign"
550 '/// check if the report navigator appear
551 printlog "check if the report navigator appear"
552 Kontext "ReportNavigator"
553 if ( not ReportNavigator.exists(3)) then
554 warnlog "report navigator doesn't appear"
555 call fCloseReportDesign
559 printlog "report navigator appear"
560 call DialogTest(ReportNavigator)
561 ReportNavigator.Close
565 '/// close the report designer
566 call fCloseReportDesign
567 '/// close the database
571 '-------------------------------------------------------------------------
572 testcase tReportHeaderFooter
574 '/// open Bibliography database
575 printlog "open Bibliography database"
576 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
578 '/// open the report designer
579 printlog "open the report designer"
580 call fOpenNewReportDesign
582 '/// open report navigator
583 printlog "open report navigator"
584 call fOpenReportNavigator
586 '/// check if the report navigator appear
587 printlog "check if the report navigator appear"
588 Kontext "ReportNavigator"
589 if ( not ReportNavigator.exists(3)) then
590 warnlog "report navigator doesn't appear"
591 call fCloseReportDesign
595 '/// check if there are 6 entries in the report navigator
596 printlog "check if there are 6 entries in the report navigator"
597 if (NavigatorTree.getItemCount <> 6) then
598 warnlog "the count of items in the report navigator is not correct." + _
599 "it should 6 but it is " + NavigatorTree.getItemCount
602 'close the report navigator to get the focus back into the document
603 call fCloseReportNavigator
605 '/// turn on the report header via the edit menu
606 printlog "turn on the report header via the edit menu"
607 Kontext "ReportDesign"
612 'open the navigator again
613 call fOpenReportNavigator
615 '/// check if report header appear in the report navigator (8 entries)
616 printlog "check if report header appear in the report navigator (8 entries)"
617 Kontext "ReportNavigator"
618 if (NavigatorTree.getItemCount <> 8) then
619 warnlog "the report header is not diaplyed in the report navigator."
622 'close the report navigator to get the focus back into the document
623 call fCloseReportNavigator
625 '/// turn off the report header via the edit menu
626 printlog "turn off the report header via the edit menu"
627 Kontext "ReportDesign"
632 'open the navigator again
633 call fOpenReportNavigator
635 '/// check if report header disappear in the report navigator (6 entries)
636 printlog "check if report header disappear in the report navigator (6 entries)"
637 Kontext "ReportNavigator"
638 if (NavigatorTree.getItemCount <> 6) then
639 warnlog "the report header is not diaplyed in the report navigator."
642 'close the report navigator
643 call fCloseReportNavigator
645 '/// close the report designer
646 printlog "close the report designer"
647 call fCloseReportDesign
648 '/// close the database
649 printlog "close the database"
653 '-------------------------------------------------------------------------
654 testcase tPageHeaderFooter
656 '/// open Bibliography database
657 printlog "open Bibliography database"
658 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
660 '/// open the report designer
661 printlog "open the report designer"
662 call fOpenNewReportDesign
664 '/// open report navigator
665 call fOpenReportNavigator
667 '/// check if the report navigator appear
668 printlog "check if the report navigator appear"
669 Kontext "ReportNavigator"
670 if ( not ReportNavigator.exists(3)) then
671 warnlog "report navigator doesn't appear"
672 call fCloseReportDesign
676 '/// check if there are 6 entries in the report navigator
677 printlog "check if there are 6 entries in the report navigator"
678 if (NavigatorTree.getItemCount <> 6) then
679 warnlog "the count of items in the report navigator is not correct." + _
680 "it should 6 but it is " + NavigatorTree.getItemCount
683 'close the report navigator to get the focus back into the document
684 call fCloseReportNavigator
686 '/// turn off the page header via the edit menu
687 printlog "turn off the page header via the edit menu"
688 Kontext "ReportDesign"
693 'open the report navigator
694 call fOpenReportNavigator
696 '/// check if page header disappear in the report navigator (4 entries)
697 printlog "check if page header disappear in the report navigator (4 entries)"
698 Kontext "ReportNavigator"
699 if (NavigatorTree.getItemCount <> 4) then
700 warnlog "the page header is not displayed in the report navigator."
703 'close the report navigator to get the focus back into the document
704 call fCloseReportNavigator
706 '/// turn on the page header via the edit menu
707 printlog "turn on the page header via the edit menu"
708 Kontext "ReportDesign"
713 'open the report navigator
714 call fOpenReportNavigator
716 '/// check if page header appear in the report navigator (6 entries)
717 printlog "check if page header appear in the report navigator (6 entries)"
718 Kontext "ReportNavigator"
719 if (NavigatorTree.getItemCount <> 6) then
720 warnlog "the page header is displayed in the report navigator."
723 'close the report navigator
724 call fCloseReportNavigator
726 '/// close the report designer
727 printlog "close the report designer"
728 call fCloseReportDesign
729 '/// close the database
730 printlog "close the database"
734 '-------------------------------------------------------------------------
737 '/// open Bibliography database
738 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
740 '/// open the report designer
741 call fOpenNewReportDesign
743 '/// select the first table in the content list box
744 printlog "select the first table in the content list box"
745 Kontext "ReportDataProperties"
747 Content.typeKeys("<RETURN>",true) ' important to leave the listbox
749 Kontext "ReportDesign"
750 ReportDesign.TypeKeys("<MOD1 TAB>",true)
751 ReportDesign.TypeKeys("<MOD1 TAB>",true)
753 Kontext "ReportAddField"
754 ReportAddFieldList.select 1
755 ReportAddField.TypeKeys("<RETURN>",true)
757 'close the Add Field dialog to get the focus back to the design
758 call fCloseAddFieldDialog()
761 printlog "save the report"
762 Kontext "ReportDesign"
769 '/// insert a name into the save dialog
770 printlog "insert a name into the save dialog"
772 Kontext "FormSaveDialog" ' report and forms use the same dialog
773 FormName.setText("Report1")
776 '/// close the report design
777 printlog "close the report design"
778 call fCloseReportDesign
780 '/// open the report again in the edit mode
781 printlog "open the report again in the edit mode"
782 call fOpenReportInDesign("Report1")
784 Kontext "ReportDesign"
785 if (ReportDesign.exists(10)) then
786 call fCloseReportDesign
788 warnlog "ReportDesign not open"
791 '/// close the database
792 printlog "close the database"
796 '-------------------------------------------------------------------------
799 printlog "open Bibliography database"
800 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
802 printlog "open the report designer"
803 call fOpenNewReportDesign
805 printlog "open format/page dialog via the menu"
806 Kontext "ReportDesign"
811 printlog "check if the format page dialog appear"
813 if ( not TabSeite.exists(3)) then
814 warnlog "format page dialog doesn't appear"
815 call fCloseReportDesign
819 printlog "format page dialog appear"
820 call DialogTest(TabSeite)
824 '/// close the report designer
825 call fCloseReportDesign
826 '/// close the database
830 '-------------------------------------------------------------------------
831 testcase tFunctionWizard
833 printlog "open Bibliography database"
834 call fOpenDatabase(gOfficePath + ConvertPath("user/database/biblio.odb"))
836 printlog "open the report designer"
837 call fOpenNewReportDesign
839 printlog "select the first table in the content list box"
840 Kontext "ReportDataProperties"
842 Content.typeKeys("<RETURN>",true) ' important to leave the listbox
844 Kontext "ReportDesign"
845 ReportDesign.TypeKeys("<MOD1 TAB>",true)
846 ReportDesign.TypeKeys("<MOD1 TAB>",true)
848 Kontext "ReportAddField"
849 ReportAddFieldList.select 1
850 ReportAddField.TypeKeys("<RETURN>",true)
852 'close the Add Field dialog to get the focus back to the design
853 call fCloseAddFieldDialog()
855 'press 2 time tab to select the edit field
856 Kontext "ReportDesign"
857 ReportDesign.TypeKeys("<TAB>",true)
858 ReportDesign.TypeKeys("<TAB>",true)
862 printlog "click on the ... button behind the datafield property in the property browser"
863 Kontext "ReportDataProperties"
864 OpenFormularWizard.Click
866 printlog "check if the function wizard appear"
867 Kontext "FunctionWizard"
868 if(FunctionWizard.exists(5)) then
869 printlog "The function wizard appear -> OK"
872 warnlog "The function wizard does not appear -> FAILED"
877 printlog "close the report designer"
878 call fCloseReportDesign
879 printlog "close the database"