Images in headers

(4 posts) (2 voices)

Tags:

No tags yet.

  1. loydb, Member

    I have some survey questions based on the participant choosing several items from a single image (in most cases), or choosing between two different images. I've generated a report that has the information grouped like I want it, except that I would like to display the actual images, instead of just the filename. Any suggestions how to incorporate the image into the headers would be appreciated.

    Here's how it currently looks:

    And here's the code:


    BEGIN select 'dbr.hdr', 'Question';
    select 'dbr.hdr', 'Slide 1';
    select 'dbr.hdr', 'Slide 2'; select
    q.LText as 'Question',
    (select s.filename as 'file1' from research.slides s where q.slideID = s.ID) as 'Slide 1',
    (select s2.filename as 'file2' from research.slides s2 where q.slideTwoID = s2.ID) as 'Slide 2',
    c.alias as 'Alias',
    a.response as 'Response'
    from
    research.questions q
    join
    research.answers a on a.questionID = q.ID
    join
    research.customers c on a.customerID = c.ID
    where
    q.slideID IS NOT NULL
    order by
    q.ID; END

  2. loydb, Member

    Sorry about the giant image, the bbcode image resize doesn't seem to work.

  3. myDBR Team, Key Master

    Select the URL to the image instead of just the filename. You can do this with 'dbr.html:'. Also, most likely the question and slides are in same header level, so no need to add header levels by calling dbr.hdr more than once. And lastly, it is more efficient to do the slides join in from-clause than in the select.

    BEGIN
    
    select 'dbr.hdr', 'Question', 'Slide 1', 'Slide 2';
    
    select
    q.LText as 'Question',
    concat( 'dbr.html:slide1') as 'Slide 1',
    concat( 'dbr.html:slide2') as 'Slide 2',
    c.alias as 'Alias',
    a.response as 'Response'
    from research.questions q
    join research.answers a on a.questionID = q.ID
    join research.customers c on a.customerID = c.ID
    left join research.slides s on s.ID = q.slideID
    left join research.slides s2 on s2.ID = q.slideTwoID
    where q.slideID is not null
    order by q.ID; END

    --
    myDBR Team

  4. loydb, Member

    Thanks so much! I keep getting amazed at how powerful this is.


Reply

You must log in to post.