-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conditional colors? #50
Comments
use is_integer($F{rowIndex}/2) into printWhen property on band, create a two bands |
I understand is because I don't have this rowIndex in the select, wouldn't it be more interesting to support this conditional no?: |
You can add here Line 30 in c1a338d
|
As you guide requires two bands, I tried something simpler using a rectangle and applying the print condition on it, but it didn't work... are these conditionings also ready for rectangle? |
but mind you, jasper report has style functionality and in a style we can add conditional formatting, where can i be testing and modifying to support conditional formatting of the style? |
I understand now, but i´m sorry, i never use it, where in jasperstudio can be access it ? |
I found styles, i think what a way to support this Line 78 in c1a338d
add a function to read each style and store into a global array, and all objects what you want to use styles, load style property into a object, (all objects are a separate Class) and use styles properties to decore that element, but yet no locate conditional styles, help me about this and i help you to think a way to do this. |
thanks for the support, come on I'll demonstrate what I've achieved so far |
in Report.php on line 68 I added the following debugging:
e o result is:
|
however, for this to be possible, it is necessary to make an adjustment in the initialization of the xml, I see that I modified it, I would have to see if this affects your structure used so far, but this way it displays the conditional expression of the style:
|
as in the definition of objects, for example, in TextField there is the property style with the name of the style, I believe it is possible to search the definition of the style and apply the conditional |
i hope what the best way is it // atribui o conteúdo do labelif(ucfirst($obj)=='Style'){ make this, for example in texfield you get the style property and this line you can get the report object Line 22 in c1a338d
you can get $obj->arrayStyles and use it to decorate a element |
following your idea I created methods and I can apply exactly the style definitions, all the definitions: background, color and etc... this in TextFiel for now... now I need to see how to apply the conditional style... in Report.php add
new methods public function addStyle($style){
in TextField.php ` //print_r( $data["@attributes"]);
|
that is, now when applying the style, you first need to check the conditional expression to choose which definition to apply the default or the conditional style... |
this code help you to load and execute expression, i think it is same as printWhenExpression Line 127 in c1a338d
|
get it here by modifying a little, so it checks and gets the style according to the conditional, it even accepts more than one conditional in the same style... I just can't say if this will affect the generator's performance... at the same here I haven't seen any effect, but everything can be improved. |
modify for
|
great!! |
about adding new variables I added in however to work the replace I had to make a small adjustment in the getValOfVariable method in the last one else //by gamadoleo |
the way I did the application of the style, it performs the conditional check on each TextField object, I don't know if I would be able to reduce this check, you who are more inside can analyze my function and see if you can improve the performance. but in the test here a 71 page report generates in less than 10s, but as I said everything can be improved. |
ok, send a Pull Request with yours updates |
add zebra style to cities sample |
OK, just confirm about adding new variables for replication if I did something wrong? to not need to modify a getValOfVariable function no details I added like this: however, tweak the getValOfVariable function |
I will provide the example and send ignore the aforementioned setting of Variable, actually the REPORT_COUNT works for me |
Is conditional color supported? tried to add directly via html <font color"red">
however without success, I would like to know what is the recommended way to work with conditional colors, for example I wanted to display a zebra listing with conditioned color.
The text was updated successfully, but these errors were encountered: