This content has been marked as final. Show 57 replies
I see that your example worked for you, but I could not get it to work for me.
My result had no scroll bar and my headings were all over the place.
Here's the settings that I have for my report template on my sample page:
Before Column Headings:
<table cellpadding="0" border="0" cellspacing="0" summary="" class="t18Standard"> <tr><td> <div style="border:1px solid silver; padding:0px; margin:0px; background-color:#EFEFEF;"> <table id="reportheadings" class="t18Standard">
Column Heading Template:
(this is blank)
After Column Heading:
<th class="t18ReportHeader" #ALIGNMENT# id="#COLUMN_HEADER_NAME#">#COLUMN_HEADER#</th>
Before Each Row:
</tr></table></div> <div id="reportdiv" style="overflow-y:scroll; border:1px solid silver; padding:0px; margin:0px;"> <table id="reportbody" class="t18Standard">
Column Template 1:
(No conditions set for this template as it is used by all rows)
<td #ALIGNMENT# headers="#COLUMN_HEADER#" class="t18data">#COLUMN_VALUE#</td>
After Each Row:
On my page's region, in the Region Footer:
Adjust the setwidths(....) entry to specify the widths of the columns in your table - in this one, there are 5 columns and column 4 is hidden (width=0). Adjust the setdivheight() value to the height you want for the div that wraps the data part of the table.
ps - for the report, make sure that it displays ALL records in the report on one page. Pagination should not be required, so you can disable this as well.1 person found this helpful
Thanks for your help. I got the report to scroll. I am having problems getting the column headers to the correct width. I was able to get the columns to be the correct widths.
Why do I have to set width?
The setwidths() function will set the widths of both the data and the headings at the same time. The width of each column should be set to be as wide as is needed for both. If you set a width as, say, 100 and the data in the column is wider than that, then the data table's column width will be forced to be wider by the browser. The column heading, however, will stay at 100.
If need be, you can use css to fix the data column width, but I would suggest just increasing the width of the column.
the column width are definitely changing, but the headers are not.
I am confused. I have copied your code, almost verbatim. The only changes are to the theme number itself.
I can't see what you're doing on your page, of course, so it's difficult to see exactly what's happening!
One thing to try...
My report uses:
setwidths(new Array(75, 200, 75, 0, 200));
I don't know how many columns you have, but make sure that the new Array() contains that many. Make each parameter in the Array() function, say, 200 - this will set every column to 200 pixels. Assuming you don't have some very wide columns in your report, then everything should fit ok. Now just start reducing the 200's for each column until you get a column width that you're comfortable with.
The only other thing to note is that, in your report definition, tick Show for all columns - the setwidths() function will hide any column that has a width of 0.
ps - I'm logging out for the day now. If you want, you can sent me screenshots to ..................... of your page and your region and template settings and I'll have another look tomorrow.
Edited by: ATD on Jan 12, 2009 8:18 PM
It seems my text fields with a defined element width are causing me the issue. I eliminated about half of my field by setting them to length 0, and my headers would only go as wide as the column widths. Any suggestions on how I can utilize element width and still have a flexible cell width?
I might be hitting the width limitation of the web page. Any thoughts?
One thing you didn't send in your email was a screenshot of the setwidths() function call. No matter.
As you are using this functionality for a tabular form (you hadn't mentoned that before!!!), you need to take into account more things when determining the column widths. For standard report columns, you only have to worry about the padding style within each cell. For tabular forms, you also have to allow for the margin, border and padding on the input fields.
Additioinally, most of your headings are wider than the input fields due to the amount of text in the heading.
I think, in your case, you should use the headings as the guide to the widths. To try and keep the data entry parts consistent (columns Start Time onwards), I would suggest starting with a width setting of 75 for these fields. Perhaps 50 for Shift and perhaps 150 for both Employee Name and Job Title.
On a web page, there is no maximum width limit (or, if there is, it's so far to the right you'd never find enough data to use it). Obviously, if the data does extend too far the right for a typical screen width, the user will see horizontal scrollbars. I have recently seen a thread that suggests that it is possible to scroll reports horizontally and vertically within a DIV and keep the left/top static. However, for now, I would suggest just getting the headings correct.
It is difficult to see from your page if the headings widths are actually being set - can you set, say, the Employee Name column to be 500 just to prove that the headings are being set.
I have been experimenting with really large widths.
This is my recent attempt. I really think I am hitting a width maximum.