Using color codes in list component in ireport designer [duplicate] - jasper-reports

This question already has answers here:
Formatting field data color based on condition
(3 answers)
Closed 4 years ago.
I want to display a list of items ordered by their sales amount. I want to use some color code for displaying high, medium and low with actual values. i.e. each item in list will contain the no, item name, color code(in a square) and sales amount. Is this possible in iReport designer? Also I want to apply a vertical scroll bar to my list. How both this can be achieved in iReport designer.
Thank you.

what I understand from above your question, I think you need to display different color based on high, medium, etc. with sales amount.
By applying Conditional Styles, you can able to get your requirement
Formatting field data color based on condition
For example, if salesamount is between X and Y, you can apply a specific style using the color you want.
conditional style reference
Hope this helps you.

Related

How to combine text field and graphic element in jasper report

I have requirement to show data in table column in a way to graphically represent severity of value. Meaning, depending on data value in range 1-10, I should show different color circle together with value, as shown on image.
Any idea what is the best way how to do this in jasper report template. Not sure if it is possible to use ellipse graphic element for this.
Thanks

Custom Colors in Pie Charts (Crystal Reports 2008)

I am using Crystal Reports 2008 (12.4.0.966), and can't seem to force specific colors in a pie chart.
We are analyzing selected measurement topic (MT) scores of elementary and middle school students. The report has five groups, and the chart is going into the Group 3C Footer (where a parameter can cause it to be suppressed if desired). I have a database column Score that can have values from 0.000 to 4.000. To enjoy some sanity for the resulting charts I impose granularity with the #LetterGrade formula:
SELECT {Reporting_CFSD_MT_Scores_A;1.Score}
CASE IS >= 3.5 : "ADV" // Advanced
CASE IS >= 3.1 : "PRO+" // Proficient Plus
CASE IS >= 3.0 : "PRO" // Proficient
CASE IS >= 2.5 : "APP" // Approaching Proficiency
CASE IS >= 2.0 : "BASI" // Basic
DEFAULT : "BLB" // Below Basic
In the Chart Expert >> Data tab, I've got On Change Of #LetterGrade with specified order based on the order in the formula above, and my Show Value is Count of #LetterGrade. The resulting pie chart gives me the break down of grades that I need.
The problem is that I want each of the six pie slices to have a specific color -- from bottom to top: Red, Orange, Yellow, Green, Blue, (Dark) Violet -- rather than accept the default colors. I thought I could go to the Color Highlight tab in the Chart Expert and have six entries (e.g., #LetterGrade = "ADV" sets a custom color of dark violet (and I've tried it with and without the quotes around the string)), but the first pie slice is always blue, the second is always tan, the third is always green, etc., regardless of what value it represents.
Am I misunderstanding the purpose of the Color Highlight tab? Is it not possible to set custom pie slice colors in this version of Crystal Reports (after more hoops than I care to think about I'm finally downloading SP5, but at the rate its coming in I may not have it fully downloaded until tomorrow; God help me if the solution is in one of the six 5.X or 6.X Fix Packs)? Or am I just missing a trick somewhere?
EDIT:
For giggles I changed the sort order on the Data tab from a specified order to ascending order and now the pie slices are exactly the colors I wanted. So it appears that I can either specify the display order of the slices and have to accept the default colors, or I can let it display in an undesirable order and get the colors I want. Sounds like a bug to me, unless someone knows a trick for getting around this.
If I'm not mistaken, in the report editor, preview the report and then click on a pie slice so it is selected. Then right click on that slice and select "Format Pie Sclice". Then you can change the color, pattern, gradient, etc.
Let me know if that works.
Chris
EDIT: If you want to do it conditionally, I think you may need to specify
#LetterGrade => 2.0
which in the editor should be #LetterGrade is greater or equal to 2.0
instead of
#LetterGrade = "BASI"
But you should be getting a choice of values when you create your conditions. I did a quick sample report with a chart that shows me the onhand value of certain items and I was able to "hardcode" the colors using the steps outlined in my original answer and also conditionally by using the Color Highlight wizard and the predefined values.
It turns out that editing the chart in design view doesn't work correctly. In the design view, when I use the Chart Expert I can either specify the order in which the slices are displayed, or I can designate the color for individual slices, but I cannot do both (also, in the Highlight Color tab, the last box in the Item Editor section -- where you choose the value to match -- does not give me a drop-down menu from which to choose, but instead will only let me type in the value to match: thank you #campagnolo_1 for bringing this lack to my attention, which pointed me toward the solution).
If I instead work in the preview view, click on the chart, and pull up the Chart Expert there (and choose Applied to group template), I can both set the sort order and the highlight color.
I'm guessing this is a bug, but since CR2008 isn't supported any more, I'll just have to live with it.

How to apply color dynamically in a header text box on Tablix SSRS

I did a ssrs report using Tablix Matrix control. I am designing that matrix with one column and many rows. That once column will repeat based on the group that i had from SP at run time. It works fine. But now I want to change the background color dynamically for the header text box of the tablix. Is it possible?
I need to do dynamically. Since I dont know how many column will get at run time. It depends upon the data from Stored Procedure.
Can any one help me out this?
You can set the background color for the textbox to an expression, just like any other text box. For example, something like this:
=Iif(Fields!MyHeader.Value = "AlertColumn", "#FF0000", "#FFFFFF")
This is a bit old post. But I can say that yes we can achive alternate row/Column background color on Matrix control.
Please take a look into Matrix row/column background color thred.

Crystal select expert

Is it possible to use the Select Expert to generate a filter so my reports only show results when a certain OLE Image is visible.
we currently have three OLE images (shown below)
I want to generate a filter to create a report that only shows one of any particular OLE Image. (just the results that have a red X against it)
Is there a way of differentiating between OLE Images?
If you require any more information I will try and get it as soon as possible. thank you in advance!
Because the images are completely dependent on {PROD_Product.Traffic_Status}, you can just filter the report according to this field. If you wanted to only display the rows with the red X for example, you could just add {PROD_Product.Traffic_Status}=0 to your record selection formula (basically, the inverse of the conditional suppression formula for the images).
In reality, you'll probably just want to create a numerical parameter that contains the choices 0, 1, or 2 to represent the different traffic statuses/images and filter according to that {PROD_Product.Traffic_Status}={?Traffic Status Parameter}

Want to show legend just once for repeating charts in single page in ssrs

I have 8 charts on a single page for 7 days of a week and one for combined. I want to show legend only once at the end of page.I have made visibility of legends for all 8 charts as Hidden.
I have 3 rows and 3 columns of charts in which i have one space (i.e. 9th box in this 3X3 matrix of charts) free to display the legend.
How could I do that?
Thanks in advance.
Take a look at last tip on this blog post:
http://blog.hoegaerden.be/2009/10/25/pie-chart-techniques/
He overrides the colors from the palette using stored colors in the database.
In Series Properties you select Fill Page and click the Expression. Assuming you store the 6-digit hex value of the color, the expression will be:
="#" & Fields!YourColorCode.Value
This will ensure the colors will be the same across all charts. To create your "legend" just make a table that displays each field with it's color representation.
There is another question here:
SSRS 2008 - Uniform Chart Legends for multi-chart report but the link in the answer no longer works.