Using an Image Path Specified In Your Data Source

Top Previous Topic Next Topic  Print this topic

To begin, we need to have an attribute or text value in our data source that possesses the Image Path. In this example, we will have an attribute name "logo-image" in our data source containing the file path to use ".\logos\Ecrion.png". This means that with each data source, a different image can be declared within, and at run time the image will be retrieved appropriately.

 

For your purposes, you can have your data field possess an external url, a relative file path, or point to a network location. Remember that the image needs to be present in the location specified, and of course, the path needs to be correct.

 

insert_image_dynamic1

Figure 1: The logo-image attribute contains the file path to the image needed.

 

Data Field Selection

1. You will first need to select the Image button from the Insert Tab in the Ribbon.

 

2. From the Insert Image Dialog select the Dynamic Value button.

 

3. In the Default Value field section select the Dynamic Value button.

 

insert_image_datasource

Figure 2: The Dynamic Value button is highlighted in the Dynamic Source Dialog.

 

4. In the Edit Dynamic Value Dialog navigate through your data tree to find the attribute with the path to the image you want to have inserted and select save.

 

5. You will now notice in the Dynamic Property Dialog that the value for the Default image has changed to represent that a dynamic field has been selected.

 

Inster_image_dynamic_path4

Figure 3: The value for the default now reflects the XML path of the field.

 

6. Select Apply in the Dynamic Property Dialog. Select Insert from the Insert Image Dialog.

 

Results and Testing

At this point, the image will be inserted into the design surface.

 

Notice in the Design Surface that your image is marked with a placeholder. This is because the Publisher does not yet know what image is to be used until the document is generated and the XML Data Source is evaluated to obtain the image. It is recommended at this point that you test the configuration of this dynamically driven image by previewing your output. If the path in your data is correct and the configuration was successful, your image should be present in your output.

 

insert_image_dynamic_placeholder

Figure 4: The image placeholder is displayed as the image is dynamic.

insert_image_dynamic_pdf

Figure 5: The output reveals that the image configuration was successful.