T
Tom Ellison
I have the concept of a dynamic report in mind. I have done some of this in
the past, and have what I believe to be a "proof of concept" at this point.
The Problem
You can design a report to have no problems. Years ago in mono-spaced fonts
(10, 12, or 16 characters to the inch, no matter which characters, all the
same with) you could place columns across a page fearlessly. But the
true-type font has changed all this.
Don't get me wrong. As a rule, it works very well. It looks great.
But, if you're going to represent a 20 character wide column of data on a
piece of paper (where you can't scroll to see the rest of the column if it
doesn't fit) and you're going to guarantee it will always fit by making the
column wide enough, you're in for a problem.
In a text column, place the test data to see this work. For our
hypothetical 20 character column, put in the character W 20 times. Now just
make the control for the column wide enought to hold all of that.
In order to get a pretty good report on across single sheet of paper, you
may end up with a font size of 3 or 4. With a microscope, and given a very
high resolution printer, someone may actuall read this.
The next thing is that, given more usual data, you're going to have a
situation where the printed page has tiny letters and columns of print that
fill only about 1/4 of the width of the columns. I've had users tell me I
leave too much space and use too small a font, and I've never come close to
making things wide enough for 20 W's.
One of my design tools has been a dll function that gives you the width of
any text, given font and font size (plus whether italic, bold, etc.). I
have used this in queries to find the maximum width of the existing data.
Leave an additional 10, 20, or 25% just in case, and you have a fairly happy
medium, with room for even longer text values that may come later.
Now, we commonly prorate our screens so everything will fit no matter what
screen resolution the user picks. This makes the same application run on
many computers at many resolutions and still look good. I can't live
without that one!
Why not apply the same thing to reports. Here's what I propose, and have
partly accomplished:
Find the maximum width to display each column (this is a query using the dll
function giving width). Add up all the columns, adding space between the
columns as desired. Prorate the font size up or down so it will fit across
the page. At this new font size, find the width to display each column at
the newly calculated font size. Size and relocate each column, spacing them
as required. Set the font for these controls.
I have to do the same with column headings (wouldn't look any good if you
don't, eh?). I associate column headings with the controls with the data by
tags. I also use tags to identify the horixontal lines to draw across the
page - these must be located correctly as well. This can be a double tag,
keying the line to the position of the left edge of the left most data
column under which it is drawn, and the data column to the right edge of
which determines where it ends.
I've pretty much got this working. If you have totals, you will need a bit
of extra room on those columns. You can use the factor of 10, 20, or 30% I
suggested to allow for that. It could also be done by setting up a database
in which, for each report, additional parameters are assigned. Say, for
column tagged "XY" add an extra 10%. Indeed, a database of such report
design parameters seems exactly what is needed.
Now, I know you would get bloat changing a report all the time like this.
That is, you would if you saved the design changes. But they don't need to
be saved! You can override saving design changes when the report closes,
and there's no change, and no bloat.
I post this to be open for comments.
My own comment is that this would best be done page by page, rather than the
whole report. The columns on one page would not then line up with the
columns on the next page, because the data in different columns is different
on one page from the next. Each page would have its own font size, for that
matter. Pretty neat! And, while you're at it, dream on! But some time,
somewhere, this is going to become the standard for database tools! (My
prediction.) When it does, everything else is obsolete!
Tom Ellison
the past, and have what I believe to be a "proof of concept" at this point.
The Problem
You can design a report to have no problems. Years ago in mono-spaced fonts
(10, 12, or 16 characters to the inch, no matter which characters, all the
same with) you could place columns across a page fearlessly. But the
true-type font has changed all this.
Don't get me wrong. As a rule, it works very well. It looks great.
But, if you're going to represent a 20 character wide column of data on a
piece of paper (where you can't scroll to see the rest of the column if it
doesn't fit) and you're going to guarantee it will always fit by making the
column wide enough, you're in for a problem.
In a text column, place the test data to see this work. For our
hypothetical 20 character column, put in the character W 20 times. Now just
make the control for the column wide enought to hold all of that.
In order to get a pretty good report on across single sheet of paper, you
may end up with a font size of 3 or 4. With a microscope, and given a very
high resolution printer, someone may actuall read this.
The next thing is that, given more usual data, you're going to have a
situation where the printed page has tiny letters and columns of print that
fill only about 1/4 of the width of the columns. I've had users tell me I
leave too much space and use too small a font, and I've never come close to
making things wide enough for 20 W's.
One of my design tools has been a dll function that gives you the width of
any text, given font and font size (plus whether italic, bold, etc.). I
have used this in queries to find the maximum width of the existing data.
Leave an additional 10, 20, or 25% just in case, and you have a fairly happy
medium, with room for even longer text values that may come later.
Now, we commonly prorate our screens so everything will fit no matter what
screen resolution the user picks. This makes the same application run on
many computers at many resolutions and still look good. I can't live
without that one!
Why not apply the same thing to reports. Here's what I propose, and have
partly accomplished:
Find the maximum width to display each column (this is a query using the dll
function giving width). Add up all the columns, adding space between the
columns as desired. Prorate the font size up or down so it will fit across
the page. At this new font size, find the width to display each column at
the newly calculated font size. Size and relocate each column, spacing them
as required. Set the font for these controls.
I have to do the same with column headings (wouldn't look any good if you
don't, eh?). I associate column headings with the controls with the data by
tags. I also use tags to identify the horixontal lines to draw across the
page - these must be located correctly as well. This can be a double tag,
keying the line to the position of the left edge of the left most data
column under which it is drawn, and the data column to the right edge of
which determines where it ends.
I've pretty much got this working. If you have totals, you will need a bit
of extra room on those columns. You can use the factor of 10, 20, or 30% I
suggested to allow for that. It could also be done by setting up a database
in which, for each report, additional parameters are assigned. Say, for
column tagged "XY" add an extra 10%. Indeed, a database of such report
design parameters seems exactly what is needed.
Now, I know you would get bloat changing a report all the time like this.
That is, you would if you saved the design changes. But they don't need to
be saved! You can override saving design changes when the report closes,
and there's no change, and no bloat.
I post this to be open for comments.
My own comment is that this would best be done page by page, rather than the
whole report. The columns on one page would not then line up with the
columns on the next page, because the data in different columns is different
on one page from the next. Each page would have its own font size, for that
matter. Pretty neat! And, while you're at it, dream on! But some time,
somewhere, this is going to become the standard for database tools! (My
prediction.) When it does, everything else is obsolete!
Tom Ellison