Jump to content
We've recently updated our Privacy Statement, available here ×

alfie1109

Members
  • Posts

    18
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Downloads

Everything posted by alfie1109

  1. Problem solved! Added another Crosstab in the Last Page footer, based on Regions.
  2. I would like to add a Grand Total at the end of the report (Sum of Total), but not sure how to go about on doing these using Crosstab. Below is an example of what my report looks like right now (minus the Grand Total at the end). Region Florida Beer BtlBeer DraftBeerBeveragesFoodLiqorTotals1 - Tavern Lake207.10268.45333.00172.001666.92649.253296.722 - Tavern Park154.25587.45295.80139.201422.18476.003074.88 Totals:361.35855.90628.80311.203089.101125.258087.36 Region Georgia Beer BtlBeer DraftBeerBeveragesFoodLiqorTotals1 - Tavern Heights142.20135.95196.25182.451603.15463.503217.002 - Tavern Court149.00181.00302.50156.001733.87525.003299.12Totals:291.20316.95498.75338.453337.02988.506516.12 Now, I want to add the Totals of both Regions for each column. How do I go about on adding a new row for Grand Total? Beer BtlBeer DraftBeerBeveragesFoodLiqorTotalsGrand Total: 652.551172.851127.55397.713822.85988.5014603.48 Any help is very much appreciated! Thank you!!!! ~a
  3. Hi- I am testing the Jaspersoft Studio Professional v. 7.1 and I can't seem to find the "Sort" component like the one on iReport Designer v.5.5. Is sort component not available in Professinoal edition? How do you use sorting on the Professional version? Thank you, ~alfie
  4. Created multiple variables to get Highest Totals and then applied the calculation directly to the text field. {Group Highest Total / Report Overall Highest Total} * 100 = [%Rpt]
  5. All my reports are setup the way I mentioned on my last comment. So, when I run the report, the PDF document generated is in Landscape mode and when I print it, it still prints in Landscape mode. I am not sure how it works if you print if from .Net code, maybe the settings in jasper are getting overwritten (not 100% sure).
  6. I'm just curious, did you change/update the Table Datasource? If not, check if your Dataset/Datasource are pointing to the correct Dataset and Connection/Datasource. ~a
  7. I set the following variables in order and set each variable (see below) Name = Discounts_Total Variable Class = java.lang.float Calculation = Sum Reset Type = Group Reset Group = Group ID Increment Type = None Increment Group = Variable Expression = Float.parseFloat($F{Discounts}) Name = Dsct_TotalGrp Variable Class = java.lang.float Calculation = Highest Reset Type = Group Reset Group = Group ID Increment Type = Group Increment Group = Group ID Variable Expression = $V{Discounts_Total} On the text field properties: Text Field Expression: $V{Dsct_TotalGrp} Change Evaluation Time and Group Evaluation Time = Group Evaluation Group = Group ID After I made the following changes, report works!!!!!
  8. Hi All- I am having trouble getting the Total of 'Rpt %' column. The calcuation for 'Rpt %' column is based on two different variables and calculation is done directly on the TextField Expression. Here are the setup/calculation for both Net and Rpt % columns. Net (for each row) Name: SalesQty_Total Variable Class: java.lang.float Calculation: SUM Reset Type: Group Reset Group: ID Group Increment Type: None Increment Group: blank Variable Expression: Float.parseFloat($F{SalesQty}) - Float.parseFloat($F{VoidsQty}) - Float.parseFloat($F{RefundsQty}) Net Totals: Name: SalesQty_TotalGrp Variable Class: java.lang.float Calculation: SUM Reset Type: Group Reset Group: Cat Group Increment Type: None Increment Group: blank Variable Expression: Float.parseFloat($F{SalesQty}) - Float.parseFloat($F{VoidsQty}) - Float.parseFloat($F{RefundsQty}) Rpt % (for each row) Calculation is directly on the "Text Field Expression" ($V{SalesQty_Total}/$V{SalesQty_TotalAll}) * 100 (SalesQty_Total / SalesQty_TotalAll) * 100 (3 / 271 ) * 100 = 1.11 (12 / 271) * 100 = 4.43 (21 / 271) * 100 = 7.75 (235 / 271) * 100 = 86.75 NameNetRpt %Pepsi31.11Dr Pepper124.43Iced Tea217.75Coke23586.75Totals:271[Need Total] So my question is: 1. How do I get the Total of "Rpt %" column? I can't seem to get the correct calculation and I have tried different setup. Any help/suggestion is very much appreciated. Thanks! ~a
  9. @hozawa, the variables are correctly set in placed, and still didn't work.
  10. Hi All- Issue: When I added a table (under Details band) to my Main Report, I don't get prompted anymore to enter values to each parameters I added. I have several parameters that I added to my Main Report (see below): this are all under Column Header on my Main Report Employee$P{Day1}$P{Day2}$P{Day3}$P{Day4}$P{Day5}$P{Day6}$P{Day7} So, when I preview the report, I get prompted to enter Value for each paramenter.....GREAT! everything is working as intended. I get the following results EmployeeSundayMondayTuesdayWednesdayThursdayFridaySaturday Now, I added a Table under Details band, I succesfuly configured the table datasource and datasets and it populates my table. But, the problem I'm having is when I preview the report it DOESN'T PROMPT me to enter values for each parameters anymore, it just compiles and sends me directly to Preview page. I see the table, but now my Column Headers are blank. Did I miss anything? What else do I need to do? All I did was added a table, so how did the prompts stopped working. The result I get after adding the table to my Main Report. The parameters for Day Of Week are blank, I did not get prompted to enter values. Employee Test Test10:00 AM - 2:00 PM(5:00 PM - 9:00 PM)10:00 AM - 2:00 PM 6:00 PM - 10:00 PM 10:00 AM - 2:00 PM10:00 AM - 2:00 PM10:00 AM - 2:00 PM 6:00 PM - 10:00 PM10:00 AM - 2:00 PM Please help!!! Thank you, ~a
  11. Hi All- I have variables that does some calculation First Variable: Adds all Discounts (Discounts Column) Name: Discounts_Total Variable Class: java.lang.float Calculation: SUM Reset Type: Group Reset Group: Group ID Increment Type: None Increment Group: blank Variable Expression: Float.parseFloat($F{Discounts}) Initial Value Expression: 0 Second Variable: Return the Highest Total for each Group ID (Discounts Column) Name: Discount_TotalGrp Variable Class: java.lang.float Calculation: Highest Reset Type: Report Reset Group: blank Imcrement Type: Page Increment Group: blank Variable Expression: $V{Discounts_Total} The Result: First row is blank, it should be $119.95 first and then so on and so on....... IDNAMEDISCOUNTS1FOOD[blank, should be 119.95 here and then so on... so on...]2FOOD SPCL119.953BEVERAGES0.004LIQUOR2.205BEER BTL15.306BEER SPCL2.507WINE0.008BEER DRAFT0.00TOTAL 139.95 Any ideas on why the value returns to the second row instead of first row? Thanks! ~a
  12. Not sure if this will help, but have you done the following: 1. On Main Report, under "Orientation" did you select "Landscape" 2. Are your page width and height set to 792/612, with margin set to 20 Hope this helps!
  13. I used a list component and re-structured my xml file to accomplish what I wanted to do. Ref: https://community.jaspersoft.com/questions/1101621/how-call-attribute-xml-file-and-use-it-condition-expression
  14. No, not yet. But I went different direction and I got it to work. I used list component and restructed my xml file. Thank you for your reply.
  15. Enter the following expression directly to the Text Field Expression (somehow using style doesn't work) $F{ot}.equals("1")?"<style forecolor='red'>"+$F{Shift}+"</style>":"<style forecolor='black'>"+$F{Shift}+"</style>"[/code]
  16. Hi- I have an XML file: <?xml version="1.0" encoding="UTF-8"?><EmpSchedule> <Employee> <Name>Alanna Leaptrot</Name> <Sun/> <Mon/> <Tue/> <Wed> <Shift ot="0">11:00 AM - 3:00 PM</Shift> </Wed> <Thu/> <Fri/> <Sat/> </Employee> <Employee> <Name>Andrew Curren</Name> <Sun/> <Mon/> <Tue/> <Wed> <Shift ot="0">12:00 PM - 4:00 PM</Shift> <Shift ot="1">(12:02 PM - 4:05 PM)</Shift> <Shift ot="0">8:00 PM - 10:00 PM</Shift> <Shift ot="0">(8:02 PM - 10:02 PM)</Shift> </Wed> <Thu/> <Fri/> <Sat/> </Employee></EmpSchedule>[/code]I created my dataset which contains the following fields: Name = Shift, Description = child::text()Name = ot, Description = @ot[/code]I then added a List (Component) to the details section, which contains the following field $F(Shift)$F(ot)[/code]The result is: EMPLOYEEWEDNESDAYALANNA LEAPTROT011:00 AM - 3:00 PMANDREW CURREN012:00 PM - 4:00 PM1(12:02 PM - 4:05 PM)08:00 PM - 10:00 PM0(8:02 PM - 10:02 PM)So, my question are: How do I call the @ot attribute to use in my Conditional Expression (I created a style called "OT_Style")? For example, if @ot is equals to '1', I want to make this text "RED". I tried the following expression, but I don't think this is right (since it's not working) lol..... $F{ot}.equals("1")?"<style forecolor='red'>"+$F{Shift}+"</style>":"<style forecolor='black'>"+$F{Shift}+"</style>"[/code]In List Component. --> Style, I selected "OT_Style", so it will use the style I created. What is the best way to accomplish what I'm trying to do? I want to make the text RED (Shift) if 'ot' equals 1. I am running out of ideas, so any help is very much appreciated. Thank you, ~a
  17. My issue right now is, it's changing ALL the text color of the field. I think it's because it's treating the node as one string (which is true). Not sure how to accomplish this now....... <?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="EmployeeSummary" pageWidth="792" pageHeight="612" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="aa9f89d5-76da-42e6-9387-5eed0e9a269e"> <property name="ireport.scriptlethandling" value="0"/> <property name="ireport.encoding" value="UTF-8"/> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <import value="net.sf.jasperreports.engine.*"/> <import value="java.util.*"/> <import value="net.sf.jasperreports.engine.data.*"/> <style name="Arial_Normal" fontName="Arial" fontSize="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <style name="Areal_Bold" mode="Opaque" fontName="Arial" isItalic="false" isUnderline="false" isStrikeThrough="false"/> <style name="OT_Style" mode="Opaque" forecolor="#FF0000" fill="Solid" isStrikeThrough="false"> <conditionalStyle> <conditionExpression><![CDATA[$F{Wed}.contains( "OT" )]]></conditionExpression> <style mode="Transparent" forecolor="#FF0000"/> </conditionalStyle> </style> <parameter name="ReportTitle" class="java.lang.String"/> <parameter name="DataFile" class="java.lang.String"/> <parameter name="Info" class="java.lang.String"> <parameterDescription><![CDATA[info]]></parameterDescription> </parameter> <parameter name="CurrentDate" class="java.lang.String"> <parameterDescription><![CDATA[CurrentDate]]></parameterDescription> </parameter> <parameter name="User" class="java.lang.String"> <parameterDescription><![CDATA[user]]></parameterDescription> </parameter> <parameter name="Group" class="java.lang.String"> <parameterDescription><![CDATA[Group]]></parameterDescription> </parameter> <parameter name="StartDateReport" class="java.lang.String"> <parameterDescription><![CDATA[startDateReport]]></parameterDescription> </parameter> <parameter name="EndDateReport" class="java.lang.String"> <parameterDescription><![CDATA[EndDateReport]]></parameterDescription> </parameter> <parameter name="Day1" class="java.lang.String"> <parameterDescription><![CDATA[Day1]]></parameterDescription> </parameter> <parameter name="Day2" class="java.lang.String"> <parameterDescription><![CDATA[Day2]]></parameterDescription> </parameter> <parameter name="Day3" class="java.lang.String"> <parameterDescription><![CDATA[Day3]]></parameterDescription> </parameter> <parameter name="Day4" class="java.lang.String"> <parameterDescription><![CDATA[Day4]]></parameterDescription> </parameter> <parameter name="Day5" class="java.lang.String"> <parameterDescription><![CDATA[Day5]]></parameterDescription> </parameter> <parameter name="Day6" class="java.lang.String"> <parameterDescription><![CDATA[Day6]]></parameterDescription> </parameter> <parameter name="Day7" class="java.lang.String"> <parameterDescription><![CDATA[Day7]]></parameterDescription> </parameter> <queryString language="xPath"> <![CDATA[/EmpSchedule/Employee]]> </queryString> <field name="Name" class="java.lang.String"> <fieldDescription><![CDATA[Name]]></fieldDescription> </field> <field name="Sun" class="java.lang.String"> <fieldDescription><![CDATA[sun]]></fieldDescription> </field> <field name="Mon" class="java.lang.String"> <fieldDescription><![CDATA[Mon]]></fieldDescription> </field> <field name="Tue" class="java.lang.String"> <fieldDescription><![CDATA[Tue]]></fieldDescription> </field> <field name="Wed" class="java.lang.String"> <fieldDescription><![CDATA[Wed]]></fieldDescription> </field> <field name="Thu" class="java.lang.String"> <fieldDescription><![CDATA[Thu]]></fieldDescription> </field> <field name="Fri" class="java.lang.String"> <fieldDescription><![CDATA[Fri]]></fieldDescription> </field> <field name="Sat" class="java.lang.String"> <fieldDescription><![CDATA[sat]]></fieldDescription> </field> <field name="PriPayCatg" class="java.lang.String"> <fieldDescription><![CDATA[PriPayCatg]]></fieldDescription> </field> <field name="Shift" class="java.lang.String"> <fieldDescription><![CDATA[shift]]></fieldDescription> </field> <variable name="Desc" class="java.lang.String"> <variableExpression><![CDATA[$F{Name} + "n" + $F{PriPayCatg}]]></variableExpression> </variable> <background> <band splitType="Stretch"/> </background> <title> <band height="20" splitType="Stretch"> <textField isBlankWhenNull="true" bookmarkLevel="1"> <reportElement key="textField" style="Arial_Normal" x="0" y="0" width="250" height="10" uuid="33cdd98f-fb0e-4734-b70e-96ef56a857e6"/> <box leftPadding="1"> <pen lineColor="#888888"/> <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{ReportTitle}]]></textFieldExpression> <anchorNameExpression><![CDATA["Title"]]></anchorNameExpression> </textField> <textField isBlankWhenNull="true"> <reportElement key="textField" style="Arial_Normal" x="250" y="0" width="252" height="20" uuid="805cd85a-23a6-4929-b867-a632888162a5"/> <box> <pen lineColor="#888888"/> <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="13"/> </textElement> <textFieldExpression><![CDATA[$P{DataFile}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true" bookmarkLevel="1"> <reportElement key="textField" style="Arial_Normal" x="0" y="10" width="250" height="10" uuid="912b47c5-8ea1-4151-b06f-75752fe035be"/> <box leftPadding="1"> <pen lineColor="#888888"/> <topPen lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA["User: " + $P{User}]]></textFieldExpression> <anchorNameExpression><![CDATA["Title"]]></anchorNameExpression> </textField> <textField isBlankWhenNull="false"> <reportElement key="textField" x="502" y="0" width="234" height="10" uuid="fdcaf8da-917e-4dae-ba94-e43dda0b6c70"/> <box> <pen lineColor="#888888"/> <topPen lineWidth="0.5" lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA["Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]></textFieldExpression> </textField> <textField evaluationTime="Report" isBlankWhenNull="false"> <reportElement key="textField" x="736" y="0" width="16" height="10" uuid="fb85e1fd-dcc2-4a93-b6e0-3813f9400681"/> <box rightPadding="1"> <topPen lineWidth="0.5" lineColor="#888888"/> <bottomPen lineColor="#888888"/> <rightPen lineWidth="0.5" lineColor="#888888"/> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></textFieldExpression> </textField> <textField> <reportElement x="502" y="10" width="250" height="10" uuid="5137d07f-a23f-45d2-b28d-7eca43fffe2d"/> <box rightPadding="1"> <pen lineColor="#888888"/> <topPen lineColor="#888888"/> <leftPen lineColor="#888888"/> <bottomPen lineWidth="0.5" lineColor="#888888"/> <rightPen lineWidth="0.5" lineColor="#888888"/> </box> <textElement textAlignment="Right" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[$P{CurrentDate}]]></textFieldExpression> </textField> </band> </title> <pageHeader> <band splitType="Stretch"/> </pageHeader> <columnHeader> <band height="42" splitType="Stretch"> <staticText> <reportElement key="staticText" style="Arial_Normal" mode="Opaque" x="0" y="27" width="97" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="0613433d-fc62-450d-b0f8-b637cc2bbac0"/> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="10"/> </textElement> <text><![CDATA[Employee]]></text> </staticText> <textField isBlankWhenNull="false"> <reportElement key="textField" x="652" y="17" width="84" height="10" uuid="82c24f36-c0f7-4a40-9f83-6b8e9c0f5dda"> <printWhenExpression><![CDATA[!$V{PAGE_NUMBER}.toString().equals("1")]]></printWhenExpression> </reportElement> <box> <pen lineColor="#888888"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA["Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]></textFieldExpression> </textField> <textField evaluationTime="Report" isBlankWhenNull="false"> <reportElement key="textField" x="736" y="17" width="16" height="10" uuid="b960e0e2-b4f1-4310-b1df-e8b8baced9b3"> <printWhenExpression><![CDATA[!$V{PAGE_NUMBER}.toString().equals("1")]]></printWhenExpression> </reportElement> <box rightPadding="1"> <topPen lineWidth="0.0" lineColor="#888888"/> <bottomPen lineWidth="0.0" lineColor="#888888"/> <rightPen lineWidth="0.0" lineColor="#888888"/> </box> <textElement textAlignment="Right"> <font size="8"/> </textElement> <textFieldExpression><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement key="textField" style="Arial_Normal" x="0" y="7" width="250" height="20" uuid="68f73211-92b6-4a42-bd5e-b6be56f4507b"/> <box> <pen lineColor="#888888"/> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#888888"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="11"/> </textElement> <textFieldExpression><![CDATA[$P{StartDateReport} + " - " + $P{EndDateReport}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="97" y="27" width="91" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="2b12362e-7299-4a0f-8f02-d61020e709cf"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day1}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="188" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="85986fe4-fc7f-4d2a-aa5b-fe84870d7148"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day2}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="282" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="3eb51fc1-7b81-4402-865b-e510b2c0a99b"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day3}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="376" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="bc398981-64b0-4da2-8375-92032474ad86"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day4}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="470" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="bd6b4808-6655-42c0-b418-875066486974"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day5}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="564" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="9a005139-6044-47b7-8dce-3f9907b641e8"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day6}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement mode="Opaque" x="658" y="27" width="94" height="15" forecolor="#000000" backcolor="#FFFF66" uuid="8d102092-ce9c-48b3-803b-f98c99d77852"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none"> <font fontName="Arial" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$P{Day7}]]></textFieldExpression> </textField> </band> </columnHeader> <detail> <band height="16"> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="282" y="0" width="94" height="16" isPrintWhenDetailOverflows="true" uuid="37ef170c-59ef-4e6f-aa3d-8b84e8ccd7b0"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Tue}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="188" y="0" width="94" height="16" isPrintWhenDetailOverflows="true" uuid="361acb1b-c142-453f-a3ca-05caaae66d67"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6" isItalic="false"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Mon}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="564" y="0" width="94" height="16" isPrintWhenDetailOverflows="true" uuid="3f495eb4-0c62-41f2-80bf-d8dbcd94b895"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Fri}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="97" y="0" width="91" height="16" isPrintWhenDetailOverflows="true" uuid="bce28a62-7f90-4d44-b525-100e15efa1f9"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Sun}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="97" height="16" isPrintWhenDetailOverflows="true" uuid="d7d2b78d-70fd-4f32-98ff-fc0442bc345d"/> <box leftPadding="2" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Left" verticalAlignment="Middle"> <font size="8" isItalic="false"/> </textElement> <textFieldExpression><![CDATA[$F{Name}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToTallestObject" x="658" y="0" width="94" height="16" isPrintWhenDetailOverflows="true" uuid="91600c0a-1c0f-4280-9ba2-667004e3f1ed"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Sat}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="true"> <reportElement key="" positionType="Float" stretchType="RelativeToBandHeight" mode="Transparent" x="470" y="0" width="94" height="16" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="d22b895a-d303-4d66-8e19-1915aa221161"/> <box topPadding="4" leftPadding="2" bottomPadding="4" rightPadding="2"> <pen lineColor="#B6B6B6"/> <topPen lineWidth="0.25" lineColor="#B6B6B6"/> <leftPen lineWidth="0.25" lineColor="#B6B6B6"/> <bottomPen lineWidth="0.25" lineColor="#B6B6B6"/> <rightPen lineWidth="0.25" lineColor="#B6B6B6"/> </box> <textElement textAlignment="Center" verticalAlignment="Middle" markup="none"> <font size="6"/> <paragraph lineSpacing="Single" tabStopWidth="60"/> </textElement> <textFieldExpression><![CDATA[$F{Thu}]]></textFieldExpression> </textField> <textField> <reportElement style="OT_Style" x="376" y="0" width="94" height="16" uuid="b949a9d8-9eb7-434b-be20-d1888da8945b"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="6"/> </textElement> <textFieldExpression><![CDATA[$F{Wed}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="1" splitType="Stretch"> <line> <reportElement key="line" x="0" y="0" width="752" height="1" uuid="1bbf10b6-2364-48eb-9d47-b0f248cfe7f3"/> </line> </band> </columnFooter> <pageFooter> <band splitType="Stretch"/> </pageFooter> <lastPageFooter> <band splitType="Stretch"/> </lastPageFooter> <summary> <band splitType="Stretch"/> </summary></jasperReport>[/code]Datasource (XML) <?xml version="1.0" encoding="UTF-8"?><EmpSchedule> <Employee> <Name>Alanna Black</Name> <Sun/> <Mon/> <Tue/> <Wed>10:00 AM - 2:00 PM7:00 PM - 8:00 PM</Wed> <Thu/> <Fri/> <Sat/> </Employee> <Employee> <Name>Castor Troy</Name> <Sun/> <Mon/> <Tue/> <Wed>11:00 AM - 3:00 PM</Wed> <Thu/> <Fri/> <Sat/> </Employee> <Employee> <Name>Test Curren</Name> <Sun/> <Mon/> <Tue/> <Wed>12:00 PM - 4:00 PMOT(12:02 PM - 4:05 PM)8:00 PM - 10:00 PM(8:02 PM - 10:02 PM) </Wed> <Thu/> <Fri/> <Sat/> </Employee> <Employee> <Name>Andrew Mind</Name> <Sun/> <Mon/> <Tue/> <Wed>1:00 PM - 5:00 PM</Wed> <Thu/> <Fri/> <Sat/> </Employee></EmpSchedule>[/code]
  18. Hi All- I want to change the color of the text to red on a text field if "OT" is found on the string. Ex. This is the column, I want the line "OT(12:02 PM - 4:05 PM)" to change to red Wednesday12:00 PM - 4:00 PM OT(12:02 PM - 4:05 PM) 8:00 PM - 10:00 PM I am using XML as the datasource. Here is an example of my xml file. <?xml version="1.0" encoding="UTF-8"?><EmpSchedule> <Employee> <Name>Andrew Curren</Name> <Sun/> <Mon/> <Tue/> <Wed>12:00 PM - 4:00 PMOT(12:02 PM - 4:05 PM)8:00 PM - 10:00 PM(8:02 PM - 10:02 PM)</Wed> <Thu/> <Fri/> <Sat/> </Employee></EmpSchedule>[/code]So far, what I've done is I created a "Styles" and called "OT_Style" Opaque = CheckedForecolor = Red [255,0,0]Backcolor = nullBold = Checked[/code]Then, I added the "Conditional Style" $F{Wed}.contains( "OT" )[/code]Then, on the text field, I selected "OT_Style" on the Style The line with "OT[Time]" is not changing to Red, is it possilbe to do this? What am I doing wrong? Any help is greatly appreciated. Thank you, Alfie
×
×
  • Create New...