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

Create Dynamic Columns

edited May 2009 in Subreports

Hello ..

Sorry for my English, and if someone responds to Brazil at the end keep
the original text in Portuguese.

English:
=======

I wonder how I can do to create dynamic columns in a subrelatório,
based on records from a table.

Example:
Activities have a table with the following records: Write Article,
Review Article, Article Forward.

On another table, register the level of assessment, with the following
records:
25%, 50%, 75%

The sub-report I need to print for each line of activity the number of
columns of evaluation, as below

=====================================
| ACTIVITIES | 25% | 50% | 75% |
-------------------------------------
| Write Article | | | |
| Review Article | | | |
| Forward Article | | | |
=====================================

When entering a new level of assessment (90%, for example) to print the
sub-report as below

===========================================
| ACTIVITIES | 25% | 50% | 75% | 90% |
-------------------------------------------
| Write Article | | | | |
| Review Article | | | | |
| Forward Article | | | | |
===========================================


I am evaluating the Enterprise Edition - version 11.03.

Thank you in advance.

Regards,

Fábio L. Gialdi
JB Software
fabiogialdi@jbsoft.com.br
Pinhalzinho/SC
Brasil



Português:
==========

Gostaria de saber como posso fazer para criar colunas dinâmicas em um
subrelatório, com base em registros de uma tabela.

Por Exemplo:
Possuo a tabela Atividades com os seguintes registros: Escrever Artigo,
Revisar Artigo, Encaminhar Artigo.

Em outra tabela, cadastro os níveis de avaliação, com os seguintes
registros:
25%, 50%, 75%

O sub-relatório que preciso deve imprimir para cada linha de atividade
a quantidade de colunas de avaliação, conforme abaixo

===============================================
|ATIVIDADE | 25% | 50% | 75% |
-----------------------------------------------
|Escrever Artigo | | | |
|Revisar Artigo | | | |
|Encaminhar Artigo | | | |
===============================================

Quando inserir um novo nível de avaliação (90%, por exemplo) deve
imprimir o sub-relatório conforme abaixo

=====================================================
|ATIVIDADE | 25% | 50% | 75% | 90% |
-----------------------------------------------------
|Escrever Artigo | | | | |
|Revisar Artigo | | | | |
|Encaminhar Artigo | | | | |
=====================================================


Estou avaliando a Enterprise Edition - versão 11.03.

Agradeço desde já.

Atenciosamente,

Fábio L. Gialdi
JB Software
fabiogialdi@jbsoft.com.br
Pinhalzinho/SC
Brasil

Comments

  • edited May 2009
    Hi Fábio,

    If you are designing reports, you can use the Report Wizard to automatically
    create columns based on the number of fields in your database. Select File
    | New... from the main menu.

    From your example below, it seems you may want to use horizontal columns.
    For instance, if you have three evaluation records, you would want to create
    three columns and set the DetailBand.ColumnTraversal to ctLeftToRight. This
    way the records will print along the top horizontally. If a new record is
    added, you will need to manually add a new column.

    Since you are using multiple tables, I would recommend using multiple
    subreports (one for the activities and one for evaluation). Placing one
    above the other should give you the effect you are after.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    Dear Nico,

    Thank you for your attention on this problem!

    Maybe I expressed how I really need the report, but the number of
    columns must match the number of records from the table "level of
    assessment."

    I tried to set up the DetailBand.ColumnTraversal to ctLeftToRight but
    not resolved.

    If you have something that can help, thank you.
  • edited May 2009
    Hi Fabio,

    Take a look at the following simple example. It shows how to create dynamic
    horizontal columns based on the record count.

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

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2009
    Dear Nico,

    Thanks again for your help ...

    Now it became clear as I proceed.

    Already considered the example and you noticed that the columns of the
    arrow subreports dynamically. I did the same in my report and it was as
    expected.

    Problem solved!

    Regards,

    Fábio L. Gialdi
    JB Software
    fabiogialdi@jbsoft.com.br
    Pinhalzinho/SC
    Brazil
This discussion has been closed.