View-Controlling Elements

 <  Day Day Up  >  

Several elements are used in the manifest.xsf file to control how views are created and rendered. The relevant child element of the xsf:xDocumentClass element is the xsf:views element. Descendant elements of the xsf:views element contain all the information specifying the views used in the form template.

The <xsf:views> Element and Its Content

The xsf:views element is used to specify all the views present in an InfoPath 2003 form template. An xsf:views element must be present in all manifest files as a child element of the xsf:xDocumentClass element. The xsf:views element has an optional default attribute whose value is the name of the default view in the form template. The child elements of the xsf:views element consist of one or more xsf:view elements.

Thus, in a form template that has a DataView view and a PrintView view, the content of the xsf:views element could look like this:

 <xsf:views default="DataView">  <xsf:view name=""DataView"" caption="Data">  <xsf:mainPane ... />  </xsf:view>  <xsf:view name="PrintView" ...>  <xsf:mainPane ... />  <!-- Content may include an <xsf:printSettings> element -->  </xsf:view> </xsf:views> 

Next we will look at the xsf:view element.

The <xsf:view> Element

An xsf:view element is present for each view in a form template.

It has three attributes:

  • caption ” Specifies the caption to be displayed in the Views task pane.

  • name ” Specifies a name for the view. The value of the name attribute of the default view matches the value of the default attribute of the xsf:views element. The value of the name attribute is used when manipulating views using the InfoPath object model.

  • printView ” If present, specifies the name of a view to be used to print this view.

The permitted child elements of the xsf:view element are as follows :

  • Zero or one xsf:editing element

  • One xsf:mainpane element

  • Zero or more xsf:menu elements

  • Zero or more xsf:menuArea elements

  • Zero or one xsf:printSettings element

  • Zero or more xsf:toolbar elements

The xsf:mainpane and xsf:printSettings elements are described in the sections that follow.

The xsf:menu and xsf:toolbar elements are used when custom menus or toolbars are included in a form template.

The <xsf:printSettings> Element

The xsf:printSettings element, when present, is used to specify the print settings for a particular view.

It can have any of the following as attributes:

  • bottomMargin ” Specifies the size of the page's bottom margin.

  • footer ” Specifies the text to be used in a page footer.

  • header ” Specifies the text to be used in a page header.

  • leftMargin ” Specifies the size of the page's left margin.

  • marginUnitsType ” Specifies the units used for the top, left, right, and bottom margins.

  • orientation ” Specifies the orientation of the paper. Permitted values are portrait and landscape .

  • rightMargin ” Specifies the size of the page's right margin.

  • topMargin ” Specifies the size of the page's top margin.

If present, the value of each of the bottomMargin , leftMargin , rightMargin , and topMargin attributes must be zero or greater.

So, to print a view according to specified margins, the xsf:printSettings element might look like this:

 <xsf:view name="  viewName  ">  <xsf:printSettings  marginunitsType = "in"  header = "This is a test header"  footer = "This is a test footer"  bottomMargin = "1"  leftMargin = "1"  rightMargin = "1"  topMargin = "1"  /> ... </xsf:view> 
The <xsf:mainpane> Element

The xsf:mainpane element specifies what is to be displayed in the form area. I assume that "main pane" was the term used internally for what, before product release, became known as the form area.

The xsf:mainpane element has a single attribute, the transform attribute, which specifies a relative URL to the XSLT stylesheet used to create the view.

 <  Day Day Up  >  


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net