Data Report changes in print time

I want to make a change on detail of report in print time:
like this:

 if field <> '' then  
    Report1.Sections.Item("Section4").Controls.Item("field").Visible = True
 end if

 how I can make something like this?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What sort of report are you using,
If Crystal Reports you can code in a formula for the visibility of the field based on the data.
Éric MoreauSenior .Net ConsultantCommented:
dhnkley: this person is using the Data Report in VB6!

sartorius: Can't you set the value to nothing (or empty string)?
sartoriusAuthor Commented:
I'm using Data Report and I want to control like level record on print detail.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

you can always put empty Labels on your DataReport and fill them before printing with whatever text you want.
That's including reading from DB into Vb CODE and manipulating the text before updating those Labels.
sartoriusAuthor Commented:
But I want manipulate the text when it is printing. Like dbase style :

do while.not.eof()

   if field <> '' then



sorry. i don't understand.
what do you mean in saying "*WHEN* it is printing"
sartoriusAuthor Commented:
Record level.
After print next record maybe I can change the field.
sartoriusAuthor Commented:
I want say before print...
sartoriusAuthor Commented:
I want do in DataReport the same I can in Crystal Reports in formula field.
if...then... etc..

so, my privious connent ENABLES you to do that !
put empty Labels on the Datareport id design time (Label1,Label2,Label3....),
then open the recordset.
loop trought the recordset and check whatever you want, and fill the Labels from your CODE accordingly :

if MyRec.Fields("fldTTT")>2 then DataReport1.SectionX.Label2.Caption=185

after that - print the report.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sartoriusAuthor Commented:
Thank you.

This works well.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.