Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Reports Question

Status
Not open for further replies.

WBH1138

Programmer
May 31, 2002
85
0
0
GB
Hi

I'm looking at using VB's Data Reports.

I've previously used Crystal and could use functions to process on each detail line, i.e. check a value and change it's colour to red if -ive, or change a null value to display as "0.00" .

Is there a way of doing this in Data Reports?

Cheers
Wayne
 
You might put something like this in your code:
Code:
If FldVal < 0 Then
   rptMyReport.Sections(1).Controls("txtMyControl").ForeColor = vbRed
Else
   rptMyReport.Sections(1).Controls("txtMyControl").ForeColor = vbBlue
End If


You might want to read this thread as well, lots of different things covered in it:

Kevin
 
Thanks, that thread has a lot in it.

As to your code example...what event would I put it in?


 
Well, for one of my programs that uses a data report, I'm displaying a form so the user can select date ranges, etc. Then I'm issuing the SQL statement to get the relevant data, and performing calculations on it. I would set the properties at that point. Obviously, your program will be different, but I would think that you're issuing an SQL call somewhere, and you could check the data and set properties accordingly then.


Kevin
 
sorry, I still don't understand how I can set individual report field properties at runtime, depending on the value of one field on each record i.e.
i.e.
I have columns of name and age on the report.
Everytime I get an age over 65 I want it highlighted in another colour.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top