Home General

Dynamic report

edited April 2011 in General

Hi,

The content that I want to present in a report is dynamic.
Some fields are always present in the report, but het names of some other
fields can change.

To give you an example how the report can look:

Date: Name: 100% 110% 120% 135% 150%
01-01-2011 Customer 1 1 0 1 0 0
02-01-2011 Customer 1 0 2 3 0 0


But it could also look like this:

Date: Name: 100% 108% 116% 150%
01-01-2011 Customer 2 1 0 1 0
02-01-2011 Customer 2 0 2 3 0

Is there a way to work with dynamic headings, even when the number of colums
differ?

Comments

  • edited April 2011
    Hi Stef,

    There is no automatic way to control the top headers as you describe in
    your post however it should be possible to manually add or remove each
    header as needed (perhaps when a group breaks). Another option would be
    to toggle the visibility of the header text in the same way.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2011
    Hello Nico,

    Currently I'm looking at a way to set the caption of the headers in the Report's
    OnBeforePrint-event.
    That way I can set the caption if a column is actually used or hide a column
    when it is not needed.
    Of course I have to set a fixed number of columns in the report template,
    but I can dynamically change the position and width of each column too, based
    on the number of columns that are needed.
    Or I could create multiple templates with increasing number of columns. Dependend
    on the number of columns needed, I can use a certain report template.
    Because the max number of columns in the report might exceed the required
    columns, I can check if there is a suiteble report template for it. If not
    I can ask the user to contact support and ask for an additional template.

    It's not perfect but it might get me through this challange.

    Any other suggestions are very welcome.

    Regards,
    Stef
  • edited April 2011
    Hi Stef,

    Both options described below should give you the effect you are after.

    The only other option would be to completely create the "columns" in
    code making them 100% dynamic. This would be the most difficult to
    accomplish but would give you the most flexibility when generating reports.


    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2011
    If you need to generate more columns than can fit on a page, you might be
    able to use the technique shown here...

    http://www.digital-metaphors.com/rbWiki/Delphi_Code/Layouts/How_To...Create_a_Spread_Sheet_Style_Report

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

    Best regards,

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