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

Print unknown amount of columns/rows (runtime results from custom query)

edited June 2007 in General
Hi all

Is it possible to print the data coming from a datasource without
knowing the field names and amount of columns/rows? If so, please advice
how...

In my app the user can type in custom sql queries and display the
results in a grid which means that at design-time I cannot specify
fields and sizes, not even the server to connect to but I need to be
able to print the results of this custom query (maybe including images).

Any help on this would be greatly appreciated!

Many thanks in advance,
Merrit

Comments

  • edited June 2007
    Hi Merrit,

    1. Take a look at the Report Wizard. This gives your users a simple
    interface to create their own reports based on the data that is connected to
    the report object. The ReportWizard can be used from the designer or as a
    stand-alone feature.

    http://www.digital-metaphors.com/tips/LaunchReportWizardInCode.zip

    2. You could also consider manually taking a look at the data your users
    are trying to query and then create the report components in code based on
    that data. See the Code Based thread in the Tech-Tips newsgroup for how to
    create reports completely in code.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2007
    Thanks for the hints, I'll check it out

    Merrit


  • edited June 2007
    Hi again,

    the wizard works fine but it would be nice to have a custom wizard that
    fits better in my application design - is this possibleto create a
    wizard with my desired look&feel? Are there any Demos for this too?

    Cheers
    Merrit


  • edited June 2007
    Hi Merrit,

    Creating a custom report wizard can be done by simply creating your own
    descendent to the TppCustomReportWizard class. The example below shows how
    this can be done.

    http://www.digital-metaphors.com/tips/ReportWizardTemplate.zip

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2007
    Hi again,

    I was wondering if it is somehow possible to not show the reportwizard
    but manually set all the settings (layout, style, fields) (so i can let
    the user set default print options in my app) and then immediately show
    the report preview. Or is there another way to set a style and layout
    for a report and get all the fields at runtime? Are there maybe any more
    examples? I understand the designtime examples but have difficulties
    getting the things done at runtime (as I mentioned in my first post I
    don't know anything about the data in the datasource I need to print
    because the users can send custom queries at runtime). ReportBuilder is
    just way too complex for me ;)

    Thanks for the help!
    Merrit



  • edited June 2007
    Hi Merrit,

    It is possible to create a report completely in code. The Report Wizard is
    making this process easier however if you take a look at the wizard code,
    this is essentially all that is happening. If you would like to avoid using
    the wizard, I would suggest first creating and loading a template containing
    all the static objects the report will consist of. Then, using the dataset
    the user creates, manually create all the dynamic (dbText, dbCalc, etc.)
    components in code and add them to the report. Take a look at the Code
    Based thread in the Tech-Tips newsgroup for information on creating report
    components in code.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.