Another question came up in the forums yesterday on how to place the images for Image Prompts. As you would know, there are 2 types of prompts in Answers. One is the Column Prompts and the other is the Image Prompts. In column prompts, one has the capability to select a value of the column and then pass that value as a filter to that report. In Image prompts, instead of showing the actual values there would be images for users to identify easily. Based on the image clicked it would filter the report accordingly. So, i thought of blogging about it since the documentation is a bit hazy on this subject. Lets look at how to go about creating an Image Prompt.
1. Lets start with creating a sample report with just 2 columns. Year and Dollars from the Paint Subject Area.
2. Then go to the prompts section and click on Create Image Prompt.
3. As you would see there are 4 options. Caption and Description point to the name of the prompt. The Image URL and the HTML Image Map are the important part of the image prompt. First lets consider a sample image like the one shown below.
The idea is to let users click on the year image (say 2000, 2001 etc) and then based on the image that they clicked, filter the report accordingly.
4. Place the above image under {OracleBI}\oc4j_bi\j2ee\home\applications\analytics\analytics\Images (create a new folder Images). Restart the OC4J.
5. Check whether you are able to access the image using the URL http://localhost:9704/analytics/Images/YearPrompt.jpg.
6. Put the above image URL in the Image URL of the Image Prompt. Then under the HTML map put the following code.
<map id =”YearPrompt”
name=”YearPrompt”>
<area shape =”rect” coords =”120,7,173,28″ alt=”Year2000″/>
<area shape =”rect” coords =”119,65,172,89″ alt=”Year2001″/>
<area shape =”rect” coords =”118,124,174,145″ alt=”Year2002″ />
</map>
As you see what this Image Map code does is it splits the entire the image into 3 parts with each part pointing to the years 2000, 2001, 2002. Click ok and then you should see the following Image.
In the Column and Value sections put the values as shown above. The column would have the column Names and the value would have the value of the year.
7. Then save this and test the prompt.