Rick Graves wrote:
Hello,

I am wondering whether the report designer can handle
putting colored boxes on the page.  In landscape
orientation, I need to make a step pyramid of colored
boxes, with 4 rows, one box on the top row and 4 boxes
across the bottom row.
On a real report, the color of each box will be data
driven, but for a first trial run, static colors will
do.  Also, on a real report, there would be some text
in each box.
This would be a one page (one pyramid) per table row
type report.
If the report designer can handle this, I would
appreciate some suggestions on getting started steps.

Ok, looks like I didn't have time today. Basic steps would be:

+ New report
+ Resize detail band to usable size (enough to draw your pyramid)
+ Draw pyramid by making several rectangle objects (right-click in detail band, New Object|Rectangle) + For each rectangle you can drag it and size it using the mouse and/or keyboard
+ Set FillColor property for each rectangle
+ Get some test data added to the report. You can do this by going into the XML editor, and adding the following close to the bottom (right above the closing </Report>:

        <TestCursor>
                <record pk="1" name="'Paul'" />
        </TestCursor>

If you don't add the test cursor, nothing will preview because the detail band only prints if there is a record to print.

+ Test your design by previewing it.
+ Rinse and repeat.

To get dynamic fill colors for your boxes based on some flag in your dataset, the easiest way currently is to pre-populate your report cursor with the color information. For example:

        <TestCursor>
                <record pk="1" box_1_color="(0.769, 0.247, 0.247)"/>
                <record pk="2" box_1_color="(0.25, 0, .50)"/>
        </TestCursor>

And then, for FillColor, put: self.Record["box_1_color"]

In the future, I'll have a way for you to define a function to embed in the report to determine the color based on a value in the cursor, although the technique of fabricating a cursor from your code before running the report is a powerful, general, and flexible one.

I also note that when doing these steps in the report designer, I had to restart the designer at least once for property values to stick. IOW, it is still buggy.

I hope this gets you started.

--
pkm ~ http://paulmcnett.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to