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

AutoLayout

edited August 2006 in General
ReportBuilder Gurus...

Forgive me if this is a rehash, but I want to create a default layout
showing a column for each field returned in a SQL query. I can't seem
to find a way to do this.
.
The ultimate solution is to do this programatically so I can pass a SQL
query and get the default layout in a new report.
.
Thanks,
Russ



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited August 2006
    Hi Russ,

    If you know the number of fields that will be returned by the query, you can
    simply create and save a report template (.rtm) and load that before you
    connect the dataset. If the query can contain a different amount of fields
    you will need to either create the report in code based on the query, or
    take a look at the Report Wizard. The Report Wizard can be accessed by
    selecting the File | New option from the main designer window. It is also
    possible to extend or enhance the current wizard to meet your needs.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    I would be wanting to "create the report in code based on the query".
    Where would I find sample code for how to do that?

    I would like a layout very similar to what the "Report Wizard" creates,
    so I might be interested in the extension/modification of the existing
    Report Wizard. Is there sample code for how to extend/modify the Report
    Wizard?


    Thanks,
    Russ

    you can
    you
    fields
    or
    also
    SQL



    --- posted by geoForum on http://delphi.newswhat.com
  • edited August 2006

    - check out the code based thread of the tech tips newsgroups for some
    examples of creating layouts in code

    - in ppRptWiz.pas, see TppLayoutFactory. This class contains a set of class
    functions that are used by the report wizard and by the data tree
    drag-and-drop feature. Perform a Delphi Find in Files on gcLayoutFactory -
    this a global variable that provides access to TppLayoutFactory or a custom
    descendant that developers can create.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

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