Create subreport dynamical on runtime

W

W1Fini

Hi,

I have been looking through many posts here but i couldn't find the
solution to my special problem so perhaps someone can help me.

Situation:
I have got a table with a parent/child relationchip. Now i want to
create a report that shows the hierachy of this relationship.
Through this is recursive and the number of levels within the
relationship are unknown at buildtime, i planed to create subreports on
runtime. As so far I have got a recursive function in visual basic
which gets me the structure of the relationtree. Now every time I find
one or more Children with this function, I would like to create a
subreport containing only the Children(after that looking if the
children have their own children and repeat the procedure of creating
subreports)

My question: How can i create a subreport within a report using visual
basic commands. (something like CreateReport but within an existing
report)?
 
M

Marshall Barton

W1Fini said:
I have been looking through many posts here but i couldn't find the
solution to my special problem so perhaps someone can help me.

Situation:
I have got a table with a parent/child relationchip. Now i want to
create a report that shows the hierachy of this relationship.
Through this is recursive and the number of levels within the
relationship are unknown at buildtime, i planed to create subreports on
runtime. As so far I have got a recursive function in visual basic
which gets me the structure of the relationtree. Now every time I find
one or more Children with this function, I would like to create a
subreport containing only the Children(after that looking if the
children have their own children and repeat the procedure of creating
subreports)

My question: How can i create a subreport within a report using visual
basic commands. (something like CreateReport but within an existing
report)?


You can not add controls (subreports or otherwise) to report
(or form) at runtime. You'll have to approach the problem
from a different direction. One way is to use your
recursive procedure to write data to a temporary table (in a
temporary database). Include a field with a generation
value so the report can indent the child/grandchild/...
data.
 
W

W1Fini

Thank you very much,

thought i can handle it without touching to much visual basic code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top