- Get XML From dRofus and Assign Data Source
- Basics Usage
- Understanding XPath Expressions
- Common Ways to Create a Report
- Creating a Repeating Section
- Creating a Repeating Table
- Creating a Field
- Style Formatting
- Data Formatting a Field for Dates and Numbers
- Using Building Blocks
- Unloading Building Blocks
- Context of Building Blocks
- Page Layout and Page Set
- Item Information In Header and Footer
- Images From XML and Static Images
- Decimal Symbol
- Encoding and Fonts
Get XML from dRofus and Assign Data Source
When starting to create a report in Publisher, the first thing you have to do is assign a data source. The data source is an XML file with data from dRofus. You can either use one of the sample XML files in the sample pack or generate one from dRofus. If you are making a report for a specific project it will be beneficial to generate it from dRofus since the data in the XML file may be specific to this project. Find the report under Reports and exports in dRofus that is similar or contain the data you want to use in the new report. Make the data selection and options you want. Go to More options → Format and set it to XML:
Note that some of the options will limit what data to get (e.g. what room) and some will also define what XML to export for each room. E.g. the images will not be part of the XML unless the "With pictures" option is checked. Also note that not all the xml attributes will be included unless there exists data about it for the current item. E.g. if you have an extra room core field in your project that attribute will only be included for the rooms that actually have any value for it. Therefore it is recommended that you limit your xml to only a part of the database when you are designing the report and that this has all the data that you want to have in the report. We recommend that at least two items such as rooms should be included in your data to get a correct preview.
Save the file and in Publisher choose Home → Assign Data Source and browse to the XML file under Data Source. The XML data will be shown in the Data Source pane (3) (default to the right) as in the image below. Now you can begin creating the report by dragging and dropping the data from the Data Source (3) to the document/page (1).
Important to Google Chrome users: Because of a bug in chrome version 15 and below, you need to either remove the drofus.xml file from the downloads folder between each time you run this report, or you can go to options () → Under the Bonnet → Downloads and make sure that "Ask where to save each file before downloading" is checked. You don’t need this in version 16 (currently beta).
The XF Designer consists of the following important elements:
1. The document: This shows the design of the document and can be edited directly similar to a word processing tool
2. Navigation bar: Shows the currently selected element/section in the document and lets you navigate to an element in an easier way than using the 1 if the element has a small or no visible space.
3. Data source: You can browse and drag and drop data from the data source on to the document. Here you can also see the page layout and page sets. To see the page sets check the "Pagination" option in View→Show/Hide.
4. Properties pane: Detailed properties for the selected element in 1 or 2
5. Ribbon menu
One of the first things you probably want to do is set up the page layout and create a header and footer. This is done in the Page Layout ribbon. You can also use a building block to create the same header/footer in multiple reports.
A fundamental thing when building a report based on XML data is to understand some basics about XPath. XPath is a syntax used to describe parts of an XML document and you can think of it as a path to the data you want. You can refer to a set of nodes such as all the rooms in the document, a specific attribute like the room name attribute in the room and many other variants.
XF Designer will help you create most of these expressions for you, but it is recommended to get some understanding of this. In some of the more advanced reports/tasks you might also need to edit some expressions manually.
When you refer to multiple nodes you refer to a node set. In the example image to the right the expression
refers to all the room nodes under the room-container node, in this case two rooms. You use this kind of XPath expression when you want to do something for each room in the XML. If you want to get a specific attribute value, such as the value of the project name attribute, you can use
There are also functions that you can use to make tests or other operations, e.g. sum, count etc: The expression
returns the number of rooms in this document, 2. |