summaryrefslogtreecommitdiff
path: root/source/text/sbasic/shared/03/sf_base.xhp
blob: ad5c8582049bac288ba15088eeb4b5adc8f468ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
-->

<meta>
  <topic id="SF_FormControl" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">SFDocuments.Base service</title>
    <filename>/text/sbasic/shared/03/sf_base.xhp</filename>
  </topic>
</meta>

<body>
<section id="abstract">
  <bookmark localize="false" branch="index" id="bm_id41582391760252">
    <bookmark_value>Base service</bookmark_value>
  </bookmark>
  <h1 id="bm_id781582391760253" xml-lang="en-US"><variable id="ctrls_h1"><link href="text/sbasic/shared/03/sf_base.xhp"><literal>SFDocuments</literal>.<literal>Base</literal> service</link></variable></h1>

  <paragraph role="paragraph" id="par_id901619031958273">The <literal>Base</literal> service provides a number of methods and properties to facilitate the management and handling of %PRODUCTNAME Base documents.</paragraph>
  <paragraph role="paragraph" id="par_id961619032060880">This service is closely related to the <literal>Document</literal> service, which provides generic methods for handling %PRODUCTNAME documents, including Base documents. Hence, the <literal>Base</literal> service extends the <literal>Document</literal> service and provides additional methods that are specific for Base documents, enabling users to:</paragraph>
  <list type="unordered">
    <listitem>
        <paragraph id="par_id241619032289964" role="listitem">Get access to the database contained in a Base document.</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id291619032292829" role="listitem">Open form documents stored in a Base document.</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id421619032296454" role="listitem">Check if a form document from a Base document is currently loaded.</paragraph>
    </listitem>
</list>
</section>

  <tip id="par_id241619032941497">Refer to the <link href="text/sbasic/shared/03/sf_document.xhp"><literal>Document</literal> service</link> to learn more about methods and properties that can be used to manage %PRODUCTNAME documents.</tip>

  <h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2>
  <paragraph role="paragraph" id="par_id141609955500101">Before using the <literal>Base</literal> service the <literal>ScriptForge</literal> library needs to be loaded or imported:</paragraph>
  <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#importLibs"/>

  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <paragraph role="paragraph" id="par_id311619033224680">The Base service can be invoked in a variety of ways. The code snippet below uses the method <literal>CreateBaseDocument</literal> from the <literal>UI</literal> service to create a new Base file.</paragraph>
  <paragraph role="paragraph" id="par_id101619033666470">Note that in all examples the object <literal>oDoc</literal> is an instance of the <literal>Base</literal> service.</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id791619033406225">Dim ui As Object, oDoc As Object</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id321619033409042">Set ui = CreateScriptService("UI")</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id101619033409330">Set oDoc = ui.CreateBaseDocument("C:\Documents\MyFile.odb")</paragraph>
  </bascode>
  <paragraph role="paragraph" id="par_id281619033570656">The <literal>Base</literal> service can also be instantiated while opening an existing Base file, as shown below:</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id941619033409619">Set oDoc = ui.OpenBaseDocument("C:\Documents\MyFile.odb")</paragraph>
  </bascode>
  <paragraph role="paragraph" id="par_id331619033713781">If a Base document is already open, it is possible to instantiate the <literal>Base</literal> service directly:</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id401619033791704">Dim oDoc As Object</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id21619033791983">Set oDoc = CreateScriptService("SFDocuments.Document", "MyFile.odb")</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <paragraph role="paragraph" id="par_id871623102536956">The examples above can be translated to Python as follows:</paragraph>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id401623102395018">from scriptforge import CreateScriptService</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id311623102395289">ui = CreateScriptService("UI")</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id561623102422597">doc = ui.CreateBaseDocument(r"C:\Documents\MyFile.odb")</paragraph>
  </pycode>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id971623102443669">doc = ui.OpenBaseDocument(r"C:\Documents\MyFile.odb")</paragraph>
  </pycode>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id731623102477036">doc = CreateScriptService("SFDocuments.Document", "MyFile.odb")</paragraph>
  </pycode>
  <note id="par_id281619619980185">The use of the <emph>"SFDocuments."</emph> substring in the previous example is optional.</note>

<table id="tab_id101619034669263">
   <tablerow>
       <tablecell colspan="3">
           <paragraph id="par_id451619034669263" role="tablehead">List of Methods in the Base Service</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id981619034669263" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_base.xhp#CloseFormDocument">CloseFormDocument</link><br/>
             <link href="text/sbasic/shared/03/sf_base.xhp#FormDocuments">FormDocuments</link><br/>
             <link href="text/sbasic/shared/03/sf_base.xhp#Forms">Forms</link><br/>
           </paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id721619034669263" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_base.xhp#GetDatabase">GetDatabase</link><br/>
             <link href="text/sbasic/shared/03/sf_base.xhp#IsLoaded">IsLoaded</link><br/>
             <link href="text/sbasic/shared/03/sf_base.xhp#OpenFormDocument">OpenFormDocument</link><br/>
           </paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id711619034669263" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_base.xhp#PrintOut">PrintOut</link><br/>
             <link href="text/sbasic/shared/03/sf_base.xhp#SetPrinter">SetPrinter</link><br/><br/>
           </paragraph>
       </tablecell>
   </tablerow>
</table>

<section id="CloseFormDocument">
  <comment> CloseFormDocument ------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id341609135528912" localize="false">
    <bookmark_value>Base service;CloseFormDocument</bookmark_value>
  </bookmark>
  <h2 id="hd_id61161309632927" localize="false">CloseFormDocument</h2>
  <paragraph role="paragraph" id="par_id801916099743199">Closes the given form document. Returns <literal>True</literal> if closure is successful.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id71613205516650">
    <input>svc.CloseFormDocument(formdocument: str): bool</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id941619079997810"><emph>formdocument:</emph> The name of the <literal>FormDocument</literal> to be closed, as a case-sensitive string.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <paragraph role="paragraph" id="par_id351619100723505">If form documents are organized in folders, it is necessary to include the folder name to specify the form document to be opened, as illustrated in the following examples:</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id461619100382712">oDoc.CloseFormDocument(&quot;Folder1/myFormDocument&quot;)</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id361623165059717">doc.CloseFormDocument('Folder1/myFormDocument')</paragraph>
  </pycode>
</section>

<section id="FormDocuments">
  <comment> FormDocuments --------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id401619035409457" localize="false">
    <bookmark_value>Base service;FormDocuments</bookmark_value>
  </bookmark>
  <h2 id="hd_id841619035592745" localize="false">FormDocuments</h2>
  <paragraph role="paragraph" id="par_id481619036833610">Returns an array with the full names (path/name) of all form documents in the Base document as a zero-based Array of strings.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id401623103182304">
    <input>svc.FormDocuments(): str[0..*]</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <paragraph role="paragraph" id="par_id431619037334440">The code snippet below prints the names of all form documents in the current Base document.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id121619036825329">Dim oDoc as Object, myForms as Object, formName as String</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id371619037281873">Set oDoc = CreateScriptService("Document", ThisDataBaseDocument)</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id801619037282145">Set myForms = oDoc.FormDocuments()</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id851619037282401">For Each formName In myForms</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id531619037282633">    MsgBox formName</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id851619037282890">Next formName</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id691623103639534">bas = CreateScriptService("Basic")</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id101623103639206">doc = CreateScriptService("Document", bas.ThisDataBaseDocument)</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id901623103639390">myForms = doc.FormDocuments()</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id791623103639701">for formName in myForms:</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id741623103639861">    bas.MsgBox(formName)</paragraph>
  </pycode>
  <tip id="par_id921619036922844">To learn more about form documents, refer to the <link href="text/sbasic/shared/03/sf_form.xhp"><literal>Form</literal> service help page</link>.</tip>
</section>

<section id="Forms">
  <comment> Forms ---------------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id861619035438484" localize="false">
    <bookmark_value>Base service;Forms</bookmark_value>
  </bookmark>
  <h2 id="hd_id291619035603979" localize="false">Forms</h2>
  <paragraph role="paragraph" id="par_id191619037523467">Depending on the parameters provided this method will return:</paragraph>
  <list type="unordered">
    <listitem>
        <paragraph id="par_id781619037575043" role="listitem">A zero-based Array with the names of all the forms contained in a form document (if the <literal>Form</literal> argument is absent)</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id111619037577804" role="listitem">A <literal>SFDocuments.Form</literal> object representing the form specified in the <literal>Form</literal> argument.</paragraph>
    </listitem>
  </list>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id851623104561457">
    <input>svc.Forms(formdocument: str): str[0..*]</input>
  </paragraph>
  <paragraph role="paragraph" localize="false" id="par_id851623104560857">
    <input>svc.Forms(formdocument: str, form: str = ''): svc</input>
  </paragraph>
  <paragraph role="paragraph" localize="false" id="par_id851623104562213">
    <input>svc.Forms(formdocument: str, form: int): svc</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id861619037838260"><emph>formdocument:</emph> The name of a valid form document as a case-sensitive string.</paragraph>
  <paragraph role="paragraph" id="par_id281619037857187"><emph>form:</emph> The name or index number of the form stored in the form document. If this argument is absent, the method will return a list with the names of all forms available in the form document.</paragraph>
  <note id="par_id921619437863617">Although it is possible to use index numbers to refer to forms, this is only recommended when there is just one form in the form document. If there are two or more forms, it is preferable to use the form name instead.</note>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <paragraph role="paragraph" id="par_id21623104676805">The first line of the example below returns a list of all forms in the form document "myFormDocument". The second line returns an instance of the Form service representing the form "myForm".</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id741619200190900">Dim formsList as Object : formsList = oDoc.Forms("myFormDocument")</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id491619200288742">Dim oForm as Object : oForm = oDoc.Forms("myFormDocument", "myForm")</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id431623104770698">formsList = doc.Forms("myFormDocument")</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id271623104770978">form = doc.Forms("myFormDocument", "myForm")</paragraph>
  </pycode>
</section>

<section id="GetDatabase">
  <comment> GetDatabase ----------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id301619035470065" localize="false">
    <bookmark_value>Base service;GetDatabase</bookmark_value>
  </bookmark>
  <h2 id="hd_id111619035612996" localize="false">GetDatabase</h2>
  <paragraph role="paragraph" id="par_id371619098340303">Returns an instance of the <link href="text/sbasic/shared/03/sf_database.xhp"><literal>Database</literal> service</link> that allows the execution of SQL commands on the database defined and/or stored in the current Base document</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id431623105245851">
    <input>svc.GetDatabase(user: str = '', password: str = ''): svc</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id731619098073221"><emph>user, password:</emph> Optional login parameters as strings. The default value for both parameters is an empty string "".</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id1001599408773502">Dim myDoc As Object, myDatabase As Object, ui As Object</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id631599408779968">Set ui = CreateScriptService("UI")</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id801599408784337">Set myDoc = ui.OpenBaseDocument("C:\Documents\myDb.odb")</paragraph>
    <paragraph role="bascode" id="bas_id631615147843278">' User and password are supplied below, if needed</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id741599408788321">Set myDatabase = myDoc.GetDatabase()</paragraph>
    <paragraph role="bascode" id="bas_id921599408791887">'   ... Run queries, SQL statements, ...</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id...">myDatabase.CloseDatabase()</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id251599408799447">myDoc.CloseDocument()</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id851623104860711">ui = CreateScriptService("UI")</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id391623104860891">myDoc = ui.OpenBaseDocument(r"C:\Documents\myDb.odb")</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id871623104861054">myDatabase = myDoc.GetDatabase()</paragraph>
    <paragraph role="pycode" id="pyc_id351623104861223">#   ... Run queries, SQL statements, ...</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id581623104861438">myDatabase.CloseDatabase()</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id751623104861711">myDoc.CloseDocument()</paragraph>
  </pycode>
</section>

<section id="IsLoaded">
  <comment> IsLoaded -------------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id351619035498660" localize="false">
    <bookmark_value>Base service;IsLoaded</bookmark_value>
  </bookmark>
  <h2 id="hd_id621619035622085" localize="false">IsLoaded</h2>
  <paragraph role="paragraph" id="par_id871619098478513">Returns <literal>True</literal> if the specified <literal>FormDocument</literal> is  currently open.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id831623105309694">
    <input>svc.IsLoaded(formdocument: str): bool</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id981619098545701"><emph>formdocument:</emph> The name of a <literal>FormDocument</literal> to be checked, as a case-sensitive string.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id271619098642739">If Not oDoc.IsLoaded("myFormDocument") Then</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id271619099499790">    oDoc.OpenFormDocument("myFormDocument")</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id301619099500376">End If</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id871623105432127">if not doc.IsLoaded("myFormDocument"):</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id401623105432534">    doc.OpenFormDocument("myFormDocument")</paragraph>
  </pycode>
</section>

<section id="OpenFormDocument">
  <comment> OpenFormDocument ------------------------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" branch="index" id="bm_id341619035528912" localize="false">
    <bookmark_value>Base service;OpenFormDocument</bookmark_value>
  </bookmark>
  <h2 id="hd_id611619035632927" localize="false">OpenFormDocument</h2>
  <paragraph role="paragraph" id="par_id801619099743199">Opens the specified <literal>FormDocument</literal> either in normal or in design mode.</paragraph>
  <paragraph role="paragraph" id="par_id451619100075330">If the form document is already open, it is activated without changing its mode. The method returns <literal>True</literal> if the form document could be opened.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id71623105516650">
    <input>svc.OpenFormDocument(formdocument: str, designmode: bool = False): bool</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id941619099797810"><emph>formDocument:</emph> The name of the <literal>FormDocument</literal> to be opened, as a case-sensitive string.</paragraph>
  <paragraph role="paragraph" id="par_id981619099816849"><emph>designmode:</emph> If this argument is <literal>True</literal> the <literal>FormDocument</literal> will be opened in design mode.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <paragraph role="paragraph" id="par_id251619100191992">Most form documents are stored in the root of the Base document and they can be opened simply using their names, as in the example below:</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id461619100283210">oDoc.OpenFormDocument("myFormDocument")</paragraph>
  </bascode>
  <paragraph role="paragraph" id="par_id351619100327505">If form documents are organized in folders, it becomes necessary to include the folder name to specify the form document to be opened, as illustrated in the following example:</paragraph>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id461619100283712">oDoc.OpenFormDocument("myFolder/myFormDocument")</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id361623105659717">doc.OpenFormDocument("myFormDocument")</paragraph>
  </pycode>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id361623105659616">doc.OpenFormDocument("myFolder/myFormDocument")</paragraph>
  </pycode>
</section>

<section id="PrintOut">
  <comment> PrintOut ---------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id721985200121249">
    <bookmark_value>Base service;PrintOut</bookmark_value>
  </bookmark>
  <h2 id="hd_id261589202101415" localize="false">PrintOut</h2>
  <paragraph role="paragraph" id="par_id156589200121138">This method sends the content of the given form document to a default printer or a printer defined by the <literal>SetPrinter()</literal> method.</paragraph>
  <paragraph role="paragraph" id="par_id981611169416934">Returns <literal>True</literal> if the document was successfully printed.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id1001622827822169">
    <input>svc.PrintOut(opt formdocument: str, pages: str = "", copies: num = 1): bool</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id368519200121646"><emph>formdocument</emph>: A valid document form name as a case-sensitive string. The form document must be open. It is activated by the method.</paragraph>
  <paragraph role="paragraph" id="par_id211635436910093"><emph>pages</emph>: The pages to print as a string, like in the user interface. Example: &quot;1-4;10;15-18&quot;. Default is all pages.</paragraph>
  <paragraph role="paragraph" id="par_id141635436912146"><emph>copies</emph>: The number of copies. Default is 1.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id891589200121516">If oDoc.PrintOut("myForm", "1-4;10;15-18", Copies := 2) Then</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id515892500606125">    ' ...</paragraph>
    <paragraph role="bascode" localize="false" id="bas_id751682227903730">End If</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id731622728946898">if doc.PrintOut('myForm', copies=3, pages='45-88'):</paragraph>
    <paragraph role="pycode" localize="false" id="pyc_id221628227947414">    # ...</paragraph>
  </pycode>
</section>

<section id="SetPrinter">
  <comment> SetPrinter ------------------------------------------------------------------- </comment>
  <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id71158921504765">
    <bookmark_value>Base service;SetPrinter</bookmark_value>
  </bookmark>
  <h2 id="hd_id811589502147824" localize="false">SetPrinter</h2>
  <paragraph role="paragraph" id="par_id911298505147502">Define the printer options for a form document. The form document must be open.</paragraph>
  <paragraph role="paragraph" id="par_id381651114800685">Returns <literal>True</literal> when successful.</paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
  <paragraph role="paragraph" localize="false" id="par_id261652828596855">
    <input>svc.SetPrinter(opt formdocument: str, opt printer: str, opt orientation: str, paperformat: str): bool</input>
  </paragraph>
  <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
  <paragraph role="paragraph" id="par_id961635950394507"><emph>formdocument</emph>: A valid document form name as a case-sensitive string.</paragraph>
  <embed href="text/sbasic/shared/03/sf_document.xhp#setPrinterArgs"/>
  <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
  <embed href="text/sbasic/shared/00000003.xhp#In_Basic"/>
  <bascode>
    <paragraph role="bascode" localize="false" id="bas_id431589204157164">oDoc.SetPrinter("myForm", Orientation := "PORTRAIT")</paragraph>
  </bascode>
  <embed href="text/sbasic/shared/00000003.xhp#In_Python"/>
  <pycode>
    <paragraph role="pycode" localize="false" id="pyc_id941628229095519">doc.SetPrinter('myForm', paperformat='TABLOID')</paragraph>
  </pycode>
</section>

  <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
  <section id="relatedtopics">
    <embed href="text/sbasic/shared/03/sf_database.xhp#DatabaseService"/>
    <embed href="text/sbasic/shared/03/sf_document.xhp#DocumentService"/>
    <embed href="text/sbasic/shared/03/sf_form.xhp#FormService"/>
    <embed href="text/sbasic/shared/03/sf_ui.xhp#UIService"/>
   </section>

  </body>
</helpdocument>