on 04-30-2009 2:48 PM
I have a report based on a table:
DayInfo(Date date, name varchar, NeedWork boolean, CanWork boolean)
The report is grouped by months (a date grouping).
X-coordinate is NeedWork.Date
Y-coordinate is NeedWork.Name
Cells have DayInfo.NeedWork
I want to make a cell color depended on CanWork flag.
I do it this way:
<code>if {DayInfo.CanWork} then
(
Color(255,0,0)
)
else
(
Color(0,255,0)
)
</code>
The problem is: CanWork has the same value always, though the table has different values.
Even if I use not a color, but value output instead, the data appeared on report is the same:
02.02.3909 03.02.3909 04.02.3909 05.02.3909
Ivan 02.02.3909 02.02.3909 02.02.3909 02.02.3909
I want to see different dates:
02.02.3909 03.02.3909 04.02.3909 05.02.3909
Ivan 02.02.3909 03.02.3909 04.02.3909 05.02.3909
Question: Why it doesn't work and what to do?
Thanks, it's what I want to know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason, crosstabs to not keep the data record fields available in the body cells (at least as far as I have noticed). I have run into similar situations, and have approached it this way:
Create a formula field, call it {@cellValue} (basic syntax):
formula = iif({NeedWork}, "Y","N") + iif({CanWork}, "Y","N")
Make the table body cells MAX({@cellValue}).
In the Display String format property of the body cell, use:
formula = mid(CurrentFieldValue, 1, 1) ' Pull off first character (NeedWork)
And in either the Font Color or Background Color format property, use:
if mid(CurrentFieldValue, 2, 1) = "Y" then ' If CanWork...
formula = Color(255,0,0)
else
formula = Color(0, 255, 0)
end if
HTH,
Carl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Link for downloading my report http://sql.ru/forum/actualfile.aspx?id=7135107
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.