Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: if condition from datasource  (Read 2949 times)

ann

  • Newbie
  • *
  • Posts: 16
    • View Profile
if condition from datasource
« on: December 20, 2017, 06:06:27 am »
Hi.
I would like to make condition from tablewidget from datasource.
I tried this coding but it did not work
$S{if($D{tablewidget.InStatus}=="2" {$D{tablewidget.In}}}

Besides that, can I change the color of table column in the condition too?

Thanks in advance.

Subst

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Re: if condition from datasource
« Reply #1 on: December 20, 2017, 08:46:43 am »
You try to use widget.

You can't use widget, must use the datasource that is needed to identify in limereport

ann

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: if condition from datasource
« Reply #2 on: December 21, 2017, 06:30:48 am »
Thanks for the reply, but I don't think the name(tablewidget) is an issue.
However, my problem solve. not sure what is the issue. but the following code works.

$D{tablewidget.In}
$D{detail.nextLine}
$S{
if($D{tablewidget.In} == "") {
THIS.fontColor=QColor('white')
setVariable("colourFlag","1");
}
else{
setVariable("colourFlag","0")
}
}

$S{if($D{tablewidget.InStatus}==2 && getVariable("colourFlag") == 0)
THIS.fontColor=QColor('green')
else if($D{tablewidget.InStatus}==3 && getVariable("colourFlag") == 0)
THIS.fontColor=QColor('red')
else if(getVariable("colourFlag") == 0)
THIS.fontColor=QColor('black')
}