Display specific picture - InfoPath Dev
in

InfoPath Dev

Display specific picture

Last post 02-22-2006 06:23 PM by Shanthi Reddy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-20-2006 05:04 AM

    Display specific picture

    Hi Everyone!

    I am currently creating a Set of Staff training forms that pick a set of questions from an Access database and then prompt the user for answers. I have managed to create the forms well so far, although I have now been asked if I can incorporate picture questions into the tests.
    At the moment I have used Expression Boxes to display the question and multiple choice answers for a specific questionID. What I would like is to be able to use something similar to an Expression box that will display a picture specific to either the question of the multiple choice answer next to the expression box that asks the question. I have altered my Questions table in Access to include 5 extra OLE-Object fields which I can embed pictures into for each mulitple choice answer or question associated with a questionID. I would like to be able to display the Picture associated with the question of questionID=1 next to question 1 on my form....
    Sorry for the rather long winded explanation! Does anyone think this possible? Or am I indulging myself (and my boss!) in a pipe-dream?

    Thanks in advance of any help offered,
    Dan Allason
  • 02-22-2006 02:50 AM In reply to

    Re: Display specific picture

    Scratch that - I have managed it now! I inserted a linked picture for each question and with the xPath:

    concat("\\pathname\", xdXDocument:GetDOM("Questions")/dfs:myFields/dfs:dataFields/d:QuestionsQuery/@PictureQ_[../@Question_ID_ = xdXDocument:get-DOM()/dfs:myFields/dfs:dataFields/d:Answers/@Q1])

    This requires that all pictures associated with questions and answers are stored in the "\\pathname\" directory with the filename stored in the Questions Table in a field called 'PictureQ'. I then have some conditional formatting that tests to see if the PictureQ field is blank for that specific question and hides the picture icon accordingly.

    If anyone has bothered to read this far - do they know if there is a way to set a column in a table to have an automatic width depending on a field size (e.g. the picture size)? At the moment I have set all the pictures to the same width with an automatic height but would like to have varying picture sizes...

    Cheers,
    Dan Allason
  • 02-22-2006 06:23 PM In reply to

    Re: Display specific picture

    Column width cannot be changed. One solution is maybe to use sections instead of tables, this way you can set height and width to be auto
    Shanthi Reddy
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.