D
damjanu
Hi All,
INTRO
-----
I have a question for hierarchical report.
I have searched the topic, but found some
ideas, but I am still confused.
I have a table with id | parent_id | name fields
where I store my category hirerarchy.
The hierarchy can be of unlimited depth.
(perheps not more then 8).
I also have product table:
id | category_id | name
I need to show it in report for printing, and it
needs to look like this:
level1_category1
level2_category1
level3_category1
level3_category2
product1
product2
level2_category2
level3_category3
level4_category1
product3
level5_category1
level6_category1
product4
product5
level4_category2
product6
product7
....
So I think this is clear.
How do I accomplish this is not
I do not mind hard code, but I would really appriciate some hints.
QUESTION
--------
FIRST WAY
I read somewhere in a post here that I can have an unbound
report and that with a recursive function which would
go thru my category table depth level by depth level I can get my data
printed like I need.
If someone could go into some detail about this it would really
be of great help. I am not interested in the recursive function
as much as how I would set this up in access. Also I do not know how to
go about how many text fields I need on my report. One for each category
and one for product, and then alter their indentation using
Left property?
SECOND WAY
I can get this data from a query that I already have. It comes
to this:
level_category1 --
level_category1 -- level2_category1
level_category1 -- level2_category1 -- level3_category1
level_category1 -- level2_category1 -- level3_category1
level_category1 -- level2_category1 -- level3_category1 -- product1
level_category1 -- level2_category1 -- level3_category1 -- product2
....
So omitted fields would be null, and number of columns would be equal
to the deepest brench. (so this is more like an approximation of result set)
But although I feel I could use this to easier get my wanted result,
I do not know how to. I do not know if I could do it with 1 category
text field and 1 product text field somehow Left-ified by the depth
level, or if I would need number of category text fields equal
to the deepest brench.....
I know I am asking for a lot, but I really need help.
Thanks so much.
INTRO
-----
I have a question for hierarchical report.
I have searched the topic, but found some
ideas, but I am still confused.
I have a table with id | parent_id | name fields
where I store my category hirerarchy.
The hierarchy can be of unlimited depth.
(perheps not more then 8).
I also have product table:
id | category_id | name
I need to show it in report for printing, and it
needs to look like this:
level1_category1
level2_category1
level3_category1
level3_category2
product1
product2
level2_category2
level3_category3
level4_category1
product3
level5_category1
level6_category1
product4
product5
level4_category2
product6
product7
....
So I think this is clear.
How do I accomplish this is not
I do not mind hard code, but I would really appriciate some hints.
QUESTION
--------
FIRST WAY
I read somewhere in a post here that I can have an unbound
report and that with a recursive function which would
go thru my category table depth level by depth level I can get my data
printed like I need.
If someone could go into some detail about this it would really
be of great help. I am not interested in the recursive function
as much as how I would set this up in access. Also I do not know how to
go about how many text fields I need on my report. One for each category
and one for product, and then alter their indentation using
Left property?
SECOND WAY
I can get this data from a query that I already have. It comes
to this:
level_category1 --
level_category1 -- level2_category1
level_category1 -- level2_category1 -- level3_category1
level_category1 -- level2_category1 -- level3_category1
level_category1 -- level2_category1 -- level3_category1 -- product1
level_category1 -- level2_category1 -- level3_category1 -- product2
....
So omitted fields would be null, and number of columns would be equal
to the deepest brench. (so this is more like an approximation of result set)
But although I feel I could use this to easier get my wanted result,
I do not know how to. I do not know if I could do it with 1 category
text field and 1 product text field somehow Left-ified by the depth
level, or if I would need number of category text fields equal
to the deepest brench.....
I know I am asking for a lot, but I really need help.
Thanks so much.