How to merge documents?

Let's get started

Save the “Step 1” example to your local hard drive. In our case we have used  S:\ disk 

  Step 1 - Folder
Figure 1 

Go to the folder where you have extracted budget in brief application. In our example we have used “C:\Tools\BudgetInBrief”  folder

  Step 1- Start Budget In Brief Application
Figure 2

Launch the Budget In Brief application by clicking on BudgetInBrief.exe file

When application loads, select project folder “S:\Step1”, select budget book file “S:\Step1\Step1.book”. 

Notice that Output Folder is set to: “S:\Step1\Draft”, this is where you will find generated documents.


Figure 3

Click “Create Document” button. 

When process finishes you will see link to a folder where “City of Dallas Texas Budget In Brief.docs” is located. Notice that “S:\Step1\Draft” folder has been created automatically.


Figure 4

Step 1 - Draft Folder has been created
Figure 5

Click on the link and open word document.

  Step 1 - Generated document
Figure 6

Congratulations your first budget book is done! 

Now let's find out what has happened and how it works.

How it works

In Step1 tutorial you saw how to merge three documents “City Manager Letter.docx”, “City of Dallas City Council.docx”, and “Organization of the Total Budget.docx” into one final document: “City of Dallas Texas Budget In Brief.docx”.

“Step1.book” file is the book project file that tells the Budget In Brief application how to assemble the documents together into a final document. Book file consists of two main elements: “Book” and “Section”. You can learn more about format of the "*.book" file in the Budget Book File Format article. 

 
<Book Name="City of Dallas Texas Budget In Brief" Value="" Version="1.0">
  <Section Name="Main Document Section" 
           TopMargin="1" BottomMargin="1" RightMargin="1" LeftMargin="1">
    <Section  Name="City of Dallas City Council"
              NodePath="City of Dallas City Council.docx"
              PageBreakAfter="True"/>
    <Section  Name="City Manager Letter"
              NodePath="City Manager Letter.docx"
              PageBreakAfter="True" />
    <Section  Name="Organization of the Total Budget"
              NodePath="Organization of the Total Budget.docx"
              PageBreakAfter="True"/>
    </Section>
</Book>
 

Let's look at the “Section” element for now. Each book will have a Main document section, this is where you will define the global settings, and many other sections. All of these represent parts of the whole document. 

"NodePath Attribute" specifies what document should be used for a specific section. In the Step 1 example, we have used “City of Dallas City Council.docx” as the first section. 

To change the order of the sections, just rearrange them. For instance if you want “City Manager Letter” to come up before “City Council” just change section order as specified below.

 
    <Section  Name="City Manager Letter"
              NodePath="City Manager Letter.docx"
              PageBreakAfter="True" />
    <Section  Name="City of Dallas City Council"
              NodePath="City of Dallas City Council.docx"
              PageBreakAfter="True"/>
    <Section  Name="Organization of the Total Budget"
              NodePath="Organization of the Total Budget.docx"
              PageBreakAfter="True"/>

To start a section on the new page, make sure that prior section has the PageBreakAfter attribute set to "True". There are also many cases when you would like the document to flow continuously. In this case, remove page breaks as in the example below and sections will flow continuously in the resulting document.

    <Section  Name="City Manager Letter"
              NodePath="City Manager Letter.docx" />
    <Section  Name="City of Dallas City Council"
              NodePath="City of Dallas City Council.docx"/>
    <Section  Name="Organization of the Total Budget"
              NodePath="Organization of the Total Budget.docx" />
 
Please note that sometimes documents themselves will have imbedded page breaks, those page breaks will be included in to the final document.
 

Let's try it 

 

Open MS Word, and create a new document. 

Figure 7

Save it as “Hello World.docx”.

  
Figure 8

Change Step1.book file and add new section that refers to “Hello World.docx” document.

<Book Name="City of Dallas Texas Budget In Brief" Value="" Version="1.0">
  <Section Name="Main Document Section" 
           TopMargin="1" BottomMargin="1" RightMargin="1" LeftMargin="1">
      <Section  Name="Hello World.docx"
                NodePath="Hello World.docx"
                PageBreakAfter="True"/>
      <Section  Name="City of Dallas City Council"
                NodePath="City of Dallas City Council.docx"
                PageBreakAfter="True"/>
      <Section  Name="City Manager Letter"
                NodePath="City Manager Letter.docx"
                PageBreakAfter="True" />
      <Section  Name="Organization of the Total Budget"
                NodePath="Organization of the Total Budget.docx"
                PageBreakAfter="True"/>
      </Section>
</Book>
 

Run the Budget In Brief application. 

  
Figure 4 

Go to Draft folder. 


 Figure 9

In the Draft folder you will find that the latest generated document, "City of Dallas Texas Budget In Brief.docx" will now have a "Hello World" section.

Please note that output folder not only has latest generated document, but that it also has backups of all of the prior document versions.

 

Thank you

Big thank you to the City of Dallas Texas! You will find the original City of Dallas Texas - 2003 Budget In Brief document in the Originals folder, in our case it is “S:\Step 1\Originals”. You may also visit City of Dallas budget page.


Site Map | Printable View | © 2008 - 2017 Budget In Brief | Powered by mojoPortal | HTML 5 | CSS | Design by styleshout