Sudhakara.T.P. said:
Thanks for your reply and info and it worked great. Well,
what I was looking at was something like settings that
will do that because we are giving the option for the user
to design his own based on the fields that we have in an
table. Now, how do I go about this. Because, if he opens
the report in design mode, I am showing him the customized
toolbar which has the box and the line control, that he
can use to design.
Sorry, but you have a couple of serious roadblocks in your
way. First, as I implied before, the Line control can not
do this, period. You can only change the Height property in
the Format event, but the final height of a CanGrow
control/section is not available until the Print event.
The second problem with your idea is that you should never
make design changes to forms/reports while your application
is running in a user's environment. You are the only one
that can make design changes prior to distributing your app
to your users. There are many very good reasons for this
"rule", extreme bloating, incresed likelyhood of corruption,
and inability to distribute your app in the recommended MDE
file format being some of the most obvious.
To give users this kind of capability, you need to develop
an interface for them to specify what they want and then use
code in the report that implements their choices. For
example, if you have a form where they can specify which
controls they want the lines for, then your code can
conditionally execute the Line methods in the specified
places.