This discussion is archived
3 Replies Latest reply: May 27, 2013 1:12 AM by fac586 RSS

Aligning custom button in a standard report

ryansun Newbie
Currently Being Moderated
4.2.1
Theme 22

Hi There,

I have a standard report, on a sql where I am using a custom image to link to an external application
select
'<a href="'||:URL||sale_number||' "target="_blank">'||'<img src="#WORKSPACE_IMAGES#myimg.png" alt=""  align="center">' ||'</a>' Link,
sale_id
from table
Now, the image displays correctly, however, it shows up on the top left of the report column.

I noticed, even when I use the standard Column Link option with the yellow pencil option, it shows up on the top left. Is there a way to align the image to the center of the column like how the report text is?

Thanks,
Ryan
  • 1. Re: Aligning custom button in a standard report
    fac586 Guru
    Currently Being Moderated
    ryansun wrote:

    I have a standard report, on a sql where I am using a custom image to link to an external application
    select
    '<a href="'||:URL||sale_number||' "target="_blank">'||'<img src="#WORKSPACE_IMAGES#myimg.png" alt=""  align="center">' ||'</a>' Link,
    sale_id
    from table
    Now, the image displays correctly, however, it shows up on the top left of the report column.

    I noticed, even when I use the standard Column Link option with the yellow pencil option, it shows up on the top left. Is there a way to align the image to the center of the column like how the report text is?
    What do you mean by "center"? Vertically? Horizontally? Both? Is there any other content in the cell other than the link? Providing an example on apex.oracle.com makes it so much easier to help with visual formatting and layout problems.

    (Note that the <tt>align</tt> attribute on <tt>img</tt> elements is obsolete</tt> and must not be used.)
  • 2. Re: Aligning custom button in a standard report
    ryansun Newbie
    Currently Being Moderated
    Hi Fac586,

    Both horizontally and vertically.

    This helped with the horizontal alignment, but not the vertical.
    select
    '<center><a href="#" target="_blank">'||'<img src="#WORKSPACE_IMAGES#myimg.png" alt="" > </center>' ||'</a>' Link,
    sale_id,
    sale_name,
    sale_address,
    .
    .
    from table
    1. Yes, there are about 10 other text columns.
    2.Both vertical and horizontal alignment is required in the standard report column. Currently, I was able to align them using the <center> tag but this only fixed the horizonal part. It still aligns on the top of the report column.

    Thanks
  • 3. Re: Aligning custom button in a standard report
    fac586 Guru
    Currently Being Moderated
    ryansun wrote:
    Hi Fac586,

    Both horizontally and vertically.

    This helped with the horizontal alignment, but not the vertical.
    select
    '<center><a href="#" target="_blank">'||'<img src="#WORKSPACE_IMAGES#myimg.png" alt="" > </center>' ||'</a>' Link,
    sale_id,
    sale_name,
    sale_address,
    .
    .
    from table
    1. Yes, there are about 10 other text columns.
    2.Both vertical and horizontal alignment is required in the standard report column. Currently, I was able to align them using the <center> tag but this only fixed the horizonal part. It still aligns on the top of the report column.
    Note that the <tt>center</tt> element is also obsolete and must not be used.

    This must be done using CSS. Add the following style sheet to the Inline CSS page attribute on the report page:
    td[headers="LINK"] {
      text-align: center;
      vertical-align: middle;
    }
    where <tt>LINK</tt> is the alias of the link column.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points