Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Custom shapes?

edited September 2005 in General
Hi,

What is the minimum that one would need to code in order to draw a shape
that TppShape cannot? A triangle, for example.

I need to do some custom bars on a report and I'd rather not have to
generate a bunch of bitmaps or risk one of TeeChart's crashing fits.

Thx,
Teller

Comments

  • edited September 2005
    Hi Teller,

    This can be done by creating a custom report component and registering it
    with ReportBuilder. Your component would be very similar to the Shape
    component only with instructions to draw a triangle for instance rather than
    a rectangle or ellipse. For an example of creating a custom component and
    registering it with RB, see the demo located in the \RBuilder\Demos\6.
    RCL\... directory.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2005
    So...simply drawing on a report's canvas at runtime is out of the question?

  • edited September 2005

    Options:

    1. Create a TmyShape component as has already been discussed.

    2. There is freeware TwPaintBox component on our RCL Download page. It
    provides a canvas that you can draw to.

    http://www.digital-metaphors.com/download/report_component_library.html


    3. Draw to a metafile and use a TppImage component to render the metafile.




    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2005
    Thanks for the info! :)

    Are any of these options better/worse when outputting to PDF?

  • edited September 2005

    I think for a simple shape, I would use the PaintBox or Image. I think those
    both produce a TppImageDrawCommand - which would be supported by the PDF
    export.

    If you are using the native PDF export, then adding a custom component that
    produces a custom draw command will not inherently be supported by the PDF.



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2005
    Thank you...indeed, I am using the native PDF export and so this is valuable
    information!

    Speaking of images, I was thinking images ought to be about 150dpi in order
    to scale cleanly on different printer resolutions...does that sound correct?
    I would go larger, but that would take up a lot of memory...

  • edited September 2005

    We have never performed that type of test. Try creating some simple tests
    and see what produces the best results.



    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.