This discussion is archived
14 Replies Latest reply: Jan 24, 2013 2:39 AM by VC RSS

Setting a Report Column Width?

Howard (... in Training) Pro
Currently Being Moderated
I was half griping about setting column width so it's only fair that I actually try a simple example.

I've got a simple report on a query (Select * from demo_st) based on a report region template. The columns displayed are the primary key (RCD_ID), the ST (state abbreviation) and the ST_NM (state name). State names are sized 4 to n characters and I added an "example" entry AAA AAA AAA AAA AAA AAA AA just so I'd have a long one. I'd want to control the width of the ST_NM column.

Please see: http://apex.oracle.com/pls/apex/f?p=66049:2 Dever / Ima9Dever

First, do I have the example set up correctly? For example, am I doing something that prevents controlling the ST_NM column width?

Second, if the example is set up correctly, is there some limit (say, < 6) below which I can't control the width.

In the ST_NM Column Definition, I have placed 5 in Column Width and in Column Attributes, I have placed 5 in Element Width.

I expected the ST_NM column width to be 5 characters but it renders just as before.

Am I doing something that prevents this column from truncating (or wrapping)?

Thanks in advance,
Howard
  • 1. Re: Setting a Report Column Width?
    Sc0tt Expert
    Currently Being Moderated
    I could be wrong, but I think those are for elements (HTML inputs) - like the width of a text box and length of a text box.

    You'll need to use some CSS if it is text.

    Just a helpful hint too - if you can make your demo pages public it would be nice. It's a pain to have to log in to look at to help you.
  • 2. Re: Setting a Report Column Width?
    Mahmoud_Rabie Journeyer
    Currently Being Moderated
    Dear Howard,

    Please, give us the sample workspace information

    Regards
    Mahmoud
  • 3. Re: Setting a Report Column Width?
    fac586 Guru
    Currently Being Moderated
    Howard (DBA in Training) wrote:
    I was half griping about setting column width so it's only fair that I actually try a simple example.

    I've got a simple report on a query (Select * from demo_st) based on a report region template. The columns displayed are the primary key (RCD_ID), the ST (state abbreviation) and the ST_NM (state name). State names are sized 4 to n characters and I added an "example" entry AAA AAA AAA AAA AAA AAA AA just so I'd have a long one. I'd want to control the width of the ST_NM column.

    Please see: http://apex.oracle.com/pls/apex/f?p=66049:2 Dever / Ima9Dever

    First, do I have the example set up correctly? For example, am I doing something that prevents controlling the ST_NM column width?

    Second, if the example is set up correctly, is there some limit (say, < 6) below which I can't control the width.

    In the ST_NM Column Definition, I have placed 5 in Column Width and in Column Attributes, I have placed 5 in Element Width.

    I expected the ST_NM column width to be 5 characters but it renders just as before.

    Am I doing something that prevents this column from truncating (or wrapping)?
    See post on original thread: +{message:id=10807690}+
  • 4. Re: Setting a Report Column Width?
    dominiquefortin Newbie
    Currently Being Moderated
    When you edit a column, in the "Column Definition" region you'll find "Column Width" field. The dimension for this field is in pixels, so try something like 300.
  • 5. Re: Setting a Report Column Width?
    Howard (... in Training) Pro
    Currently Being Moderated
    Since this is APEX, I'm looking for a nice simple declaritive solution. I'm thinking it ought to be possible with either Column Width or Element Width. And folks do point me to those as a solution. But try as I might, no luck. It shouldn't be that hard,should it? I tried 50, 100, 200 and 300 for Column Width. Then I tried 50 for Element Width. No luck. (The point of my example is to make the column significantly narrower than it is by default.)

    Thoughts on getting Column Width or Element Width to work?

    (If I'm successful at getting the column narrower, then I'll want to work on what the options are for wrapping -- but one thing at a time.)

    Thanks,
    Howard
  • 6. Re: Setting a Report Column Width?
    fac586 Guru
    Currently Being Moderated
    Howard (DBA in Training) wrote:
    Since this is APEX, I'm looking for a nice simple declaritive solution. I'm thinking it ought to be possible with either Column Width or Element Width. And folks do point me to those as a solution. But try as I might, no luck. It shouldn't be that hard,should it? I tried 50, 100, 200 and 300 for Column Width. Then I tried 50 for Element Width. No luck. (The point of my example is to make the column significantly narrower than it is by default.)

    Thoughts on getting Column Width or Element Width to work?
    The Standard report template Column Templates in theme 21 are missing the <tt>#COLUMN_WIDTH#</tt> substitution string, as discussed here: +{message:id=9372903}+.

    I'm not sure why this would be missing from a supposedly "modern" theme (possibly the lack of documentation even affects Oracle's own theme designers), but you can add it to the templates as shown in that thread.

    Personally I prefer the CSS approach using attribute selectors, as described in the thread referenced in my previous post.
  • 7. Re: Setting a Report Column Width?
    Howard (... in Training) Pro
    Currently Being Moderated
    Re: From {message:id=9372903}
    There was no #COLUMN_WIDTH# substitution string in your template. I've now added it and it appears to be working:
    <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#" class="data" #COLUMN_WIDTH#>#COLUMN_VALUE#</td>
    Great. Thanks. But ... where would I do this? If this a mere override, I can do that from the page definition? That would be great. If not, I'll have to make my own copy of the template. Then, where among the code would this addition go?
    <div class="rounded-corner-region" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
      <div class="rc-gray-top"><div class="rc-gray-top-r">
        <div class="rc-title">#TITLE#</div>
        <div class="rc-buttons">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
      </div></div>
      <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main">#BODY#<div class="clear"></div></div></div></div>
      <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div> 
    Surely it goes with the "BODY" but I have no idea how the two go together. (Basically, I'm doing APEX-BY-EXAMPLE. If I've seen an example, then I know one way to do it. Without an example, it's trial and eror and error and error ....)


    [Aside: So it's not APEX's fault that the builder of theme 21 (and 17 which I use elsewhere) didn't choose to include this.  I supose these themes pre-date the version of APEX which included #COLUMN_WIDTH# in the page attributes.]

    Thanks,
    Howard
  • 8. Re: Setting a Report Column Width?
    VC Guru
    Currently Being Moderated
    Howard (DBA in Training) wrote:
    Re: From {message:id=9372903}
    There was no #COLUMN_WIDTH# substitution string in your template. I've now added it and it appears to be working:
    <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#" class="data" #COLUMN_WIDTH#>#COLUMN_VALUE#</td>
    Great. Thanks. But ... where would I do this? If this a mere override, I can do that from the page definition? That would be great. If not, I'll have to make my own copy of the template. Then, where among the code would this addition go?
    <div class="rounded-corner-region" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
    <div class="rc-gray-top"><div class="rc-gray-top-r">
    <div class="rc-title">#TITLE#</div>
    <div class="rc-buttons">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
    </div></div>
    <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main">#BODY#<div class="clear"></div></div></div></div>
    <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div> 
    Surely it goes with the "BODY" but I have no idea how the two go together. (Basically, I'm doing APEX-BY-EXAMPLE. If I've seen an example, then I know one way to do it. Without an example, it's trial and eror and error and error ....)
    Howard,

    You are looking in the region template, look into your report template instead.

    Cheers,
    Vikram
  • 9. Re: Setting a Report Column Width?
    fac586 Guru
    Currently Being Moderated
    Howard (DBA in Training) wrote:
    Re: From {message:id=9372903}
    There was no #COLUMN_WIDTH# substitution string in your template. I've now added it and it appears to be working:
    <td #ALIGNMENT# headers="#COLUMN_HEADER_NAME#" class="data" #COLUMN_WIDTH#>#COLUMN_VALUE#</td>
    Great. Thanks. But ... where would I do this? If this a mere override, I can do that from the page definition?
    No. CSS overrides can be applied using page attributes, template HTML customization can't.
    That would be great. If not, I'll have to make my own copy of the template. Then, where among the code would this addition go?
    <div class="rounded-corner-region" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
    <div class="rc-gray-top"><div class="rc-gray-top-r">
    <div class="rc-title">#TITLE#</div>
    <div class="rc-buttons">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
    </div></div>
    <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main">#BODY#<div class="clear"></div></div></div></div>
    <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div> 
    That's a region template, not a report template. (People keep making that mistake when report templates are mentioned. Why did you end up with that rather than the report template?)

    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet", the Type filter to "Report", and click "Go". Select the "Standard" template. Look for the "Column Templates" section...
    [Aside: So it's not APEX's fault that the builder of theme 21 (and 17 which I use elsewhere) didn't choose to include this.  I supose these themes pre-date the version of APEX which included #COLUMN_WIDTH# in the page attributes.]
    No they don't. That's why I find it odd.
  • 10. Re: Setting a Report Column Width?
    Howard (... in Training) Pro
    Currently Being Moderated
    Re:
    That's a region template, not a report template. (People keep making that mistake when report templates are mentioned. Why did you end up with that rather than the report template?)
    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet", the Type filter to "Report", and click "Go". Select the "Standard" template. Look for the "Column Templates" section...
    >
    "Why?" Well, if I edit the page, the tempate used is "Reports Region". When I created the page, I selected the "Report" icon for the Region Type.
    But, okay, I copied the Standard template to "Standard with Column Width" because I don't want to override Standard. I've modified it. So, now I need to know where Standard is used so I can copy that and change it to reference "Standard with Column Width". How would I do that?

    Thanks,
    Howard
  • 11. Re: Setting a Report Column Width?
    VC Guru
    Currently Being Moderated
    Howard (DBA in Training) wrote:
    Re:
    That's a region template, not a report template. (People keep making that mistake when report templates are mentioned. Why did you end up with that rather than the report template?)
    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet", the Type filter to "Report", and click "Go". Select the "Standard" template. Look for the "Column Templates" section...
    >
    "Why?" Well, if I edit the page, the tempate used is "Reports Region". When I created the page, I selected the "Report" icon for the Region Type.
    That's for the region itself +(container)+ not for displaying the report data. for report data apex uses a report template which can be found under report attributes. See http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldapp_rpt_att.htm#HTMDB25346
    But, okay, I copied the Standard template to "Standard with Column Width" because I don't want to override Standard. I've modified it. So, now I need to know where Standard is used so I can copy that and change it to reference "Standard with Column Width". How would I do that?

    Thanks,
    Howard
    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet" and Type filter to "Report"
    There you should be able to see the list of report templates including your "Standard with Column Width" > under the references column you should see a number which is clickable > click that link to see the detailed information i.e. Page no,region etc

    Thanks,
    Vikram
  • 12. Re: Setting a Report Column Width?
    fac586 Guru
    Currently Being Moderated
    VC wrote:

    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet" and Type filter to "Report"
    There you should be able to see the list of report templates including your "Standard with Column Width" > under the references column you should see a number which is clickable > click that link to see the detailed information i.e. Page no,region etc
    Except he needs to click the references for the "Standard" report to find the reports utilizing it, in order to change them to "Standard with Column Width".
  • 13. Re: Setting a Report Column Width?
    Howard (... in Training) Pro
    Currently Being Moderated
    I think I've found the referring templates correctly. I see Breadcrumb Region, Form Region and Reports Region. So I look in Form Region and Reports Region but I see no "Standard" listed in either. (Oh, that's not where to look. see below.)

    ****** Oh. I've found it. ******

    Hooray! That much works. In the report region, on the Report Attributes tab, in Layout and Pagination, I changed it to use my modified Report Template! Now I've got to go rest before attempting the next step.

    MANY THANKS,
    Howard

    Edited by: Howard (DBA in Training) on Jan 23, 2013 4:35 PM
  • 14. Re: Setting a Report Column Width?
    VC Guru
    Currently Being Moderated
    fac586 wrote:
    VC wrote:

    Go to Shared Components > Templates. Set the Theme filter to "21. Scarlet" and Type filter to "Report"
    There you should be able to see the list of report templates including your "Standard with Column Width" > under the references column you should see a number which is clickable > click that link to see the detailed information i.e. Page no,region etc
    Except he needs to click the references for the "Standard" report to find the reports utilizing it, in order to change them to "Standard with Column Width".
    Agree Paul ! that was a typo and that should be easily understandable. :) I am sure Howard is smart enough to figure it out.

    Cheers,
    Vikram

Legend

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