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

drummer54

Members
  • Posts

    91
  • 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

Posts posted by drummer54

  1. Why is it that I can only upload one file when I ask a question?  It seems to allow me to upload multiple files but when I go back to review there's only one file and I have to edit the question to add another file.  This happened earlier today and I thought I had done something wrong but apparently not.  I had to edit the question twice to get all 3 files uploaded.

  2. The crosstab control is making me feel dumber and dumber and way too old to be doing this ****.  Latest problem - trying to display subtotals by month and year.  When I added the row groups for year and month it placed the page_count_measure1 variable in the footer and when I ran the report the values were identical to those on the last row displayed, which seemed to make the row groups rather useless.  I added a measure to sum the page counts and placed those in the row group footers but I still only get one subtotal row for month (though the report is running for 2 months) and that month total is the same as the year total.  There is no break on month as I'd expected.  Also the text for the row group footers is "total month1" and "total year1".  If I replace the static text fields with variables for month and year I get a null value.  I suppose that makes sense but it also contributes to making the row group rather useless if they can't be identified (assuming I can get the totals correct).

    I'm going to attach the JRXML file and Excel files representing the output from the current production report developed in SQL Server Reporting Services and the output from JasperReports.  I will greatly appreciate it if someone can explain where I've gone wrong.

  3. Interesting - I started deleting items from the crosstab hoping to narrow down the problem until arriving at the minimum to have the crosstab work and got the null pointer exception every time I ran it.  I deleted the crosstab control and didn't get an error but of course didn't get a report either (I don't need the detail band so deleted immediately after creating the report).  I then closed the report without saving, having saved it immediately before deleting items from the crosstab.  I reopened the report and ran it and, lo and behold, it worked.  Why would that be?  I'm used to closing and reopening Microsoft products to get them to work properly but I didn't even close JasperSoft Studio.  I only closed and reopened the report.

  4. Is it just me and the report I'm trying to create or does anyone else have a problem with java.lang.NullPointerException errors in crosstabs?  I've been trying to create what is proving to be a very complex report (simple in SQL Server Reporting Services but not so much in JasperSoft Studio) and for every step forward I end up taking one back when I try to add another feature.  Unfortunately, I've also had serious problems with the undo function, so that when I do foul up something I usually can't get back to the most recent good copy.  I've been overcoming this by not saving my work until I have what I know is an error free version, but this last time it didn't work and I ended up having to re-create everything I had done.  After doing so the java.lang.NullPointerException cropped up again and I've no idea what the source is.  I can't even remember how I resolved it previously (likely dumb luck).  Maybe I'm just getting too old for this ****.

  5. I've created a crosstab using results from a SQL Server stored procedure that list processed page counts by person by day.   Column headings are individual pages and the first row is the date in descending order.  The individual names are to be ordered alphabetically in ascending order.  So far, so good.  But, 2 of the columns have a total count of processed pages by date and a count of unprocessed pages which are to be displayed in the second to last and last columns, respectively.  The way we currently manage this, in a SQL Server Reporting Services crosstab, is by using a column called sort_order.  The individual names have sort_order = 1, the total pages sort_order = 2 and the unprocessed pages sort_order = 3.

    I can't figure out how to have the JasperReports crosstab use the sort_order field to get the columns in the correct order.  The stored procedure is returning the data in the correct order.  I also added sort fields to the dataset to make sure they were being sorted properly in the dataset.  I tried setting the 'Data Pre Sorted' option in the crosstab dataset properties but then the page counts cells ended up all blanks.  I created another crosstab and added sort_order as a column group in addition to individual name and that results in a null pointer exception.

  6. I don't think that's going to help after all.  The Java solution is far outside my comfort zone and the style solution won't work for me.  I had thought that maybe it would work in a Pattern Expression but I can't find any documentation for Pattern Expression and my attempts at coding it compile & run but have no effect.  Thanks, anyway.

  7. I discovered this morning that none of my subtotals is working properly. If I run the report for a single region within a company the totals are correct, but if I run it for multiple regions in a company the simplest grouping becomes accumulative. In other words, for example, the employee head count for region 1 is correct but for region 2 is the accumulation of regions 1 and 2, region 3 is the accumulation of regions 1, 2 and 3 and so on. And the percent column is simply the first region percent and never gets updated. I can't believe how unintuitive and poorly documented this application is.
  8. Is there a way to create a single conditional style to apply to multiple fields and variables?  For example, I have a report being populated from a SQL Server stored procedure that returns 12 fields, one per month, of data represented in percentages.  For each month I need to set the background and foreground colors to one of 3 different combinations based on how the percent for that month falls within a specified range.  I also have variables for each month that calculate these percentages at the region and company level.  That gives me 12 fields and 24 variables to set a conditional style for.  The only way I can figure out to do this is to create 36 different conditional styles, one for each field & variable.  Is there an easier way to do this?  It's quite cumbersome and tedious.  Seems it would be much easier to create 3 styles and in each of the 36 objects set the style based on the value in that object.

  9. I have a table that groups on company and region after printing location detail.  Is it possible to merge cells in the group footers for a more pleasing layout, one which our users are accustomed to seeing with SQL Server Reporting Services?  For example:                                                   

    Company1Region1Locaton1535
      location2447
                                               Selected locations for Region1 total9712
    Selected locations for Company1 total9712

    Is there a way to do this without jumping through hoops?

  10. I've uploaded the latest JRXML file, the latest of several attempts. This one doesn't produce an error but it returns 0 for the calculated percent. The variable mth1_individual is where the percent is being calculated as the result of (mth1_compliant / (mth1_compliant + mth1_noncompliant)) * 100
  11. I'm at my wits' end over this.  I've created a table in JasperSoft Studio with subtotals on region and company.  The detail data from the database contains, by location (the hierarchy is company / region / location), values for number of employees, total number of compliance events for all employees for that location, number of events that are in compliance, number of events not in compliance, and percent in compliance.  For example, the first location has 40 employees, 1793 total events, 1760 events in compliance and 33 events not in compliance.  That results in a compliance percent of 98% after rounding, 1760 / 1793.  All of this data is returned by the database query.  The problem I'm having is in computing region and company percents.  I have to sum the events in compliance and the events not in compliance across region and company levels and then perform the calculation to get the percent in compliance for each region and the company as a whole.  How is this done?  Everything I've tried either results in 0 for the percent or an "Error evaluating expression".

  12. Can anyone tell me what's wrong with the conditional style code below?

    Style definition:
    <style name="Style1" mode="Opaque" forecolor="#000000" backcolor="#FFFFFF">
         <conditionalStyle>
              <conditionExpression><![CDATA[$F{description2} == "Percentage Improvement"]]></conditionExpression>
              <style mode="Opaque" forecolor="#000000" backcolor="#DCE6F1"/>
         </conditionalStyle>
         <conditionalStyle>
              <conditionExpression><![CDATA[$F{description2} != "Percentage Improvement"]]></conditionExpression>
              <style mode="Opaque" forecolor="#000000"/>
         </conditionalStyle>
    </style>

    Text field definition using conditional style defined above:
    <textField pattern="">
        <reportElement style="Style1" mode="Opaque" x="444" y="7" width="69" height="48" uuid="14c428e7-5078-41fc-833e-3868937c596d">
             
    <printWhenExpression><![CDATA[$F{description2} != "Percentage Improvement"]]></printWhenExpression>
        
    </reportElement>
        <textElement textAlignment="Center" verticalAlignment="Bottom" markup="html">
             <font fontName="Arial" size="9" isBold="true"/>
        </textElement>
        <textFieldExpression><![CDATA[$F{description2} + "<br>Individual Requirements"]]></textFieldExpression>
    </textField>

    No matter what the value of $F{description2} the background color is white.

  13. I'm using some existing SQL to create a report in JR 5.5.1 and sorting on 3 fields called company, region and location.  The SQL calculates subtotals and totals and counts on these lines being listed in the correct order by using leading spaces before company name, region name and location name and the report total line being identified by 'Report Total' in the company and region fields with no leading spaces.  This works fine in SQL Server Reporting Services.  However, in Jasper Reports, if the company name starts, for example, with an 'S', the report total line prints ahead of the company detail.  The only explanation for this that I can determine is that the leading spaces are being trimmed before sorting.

    I've attached the jrxml file with the SQL edited to included only the pertinent code and also an Excel spreadsheet with data as returned from the query. 

  14. I'm trying to pass 2 parameters to a SQL Server function in a SQL join:

    join reports.dbo.get_data($P{uid}, $P{rid}

    The first parameter displays this error:  missing 'ON' at '('
    The second parameter displays this error: no viable alternative at input '$P{rid}'

    Also getting "missing EOF at '('" in the order by clause on this line:
    rtrim(e.LastName + ', ' + e.FirstName + ' ' + ISNULL(e.middlename, ''))

    I'm guessing it's something to do with the driver but, as is usually the case, can find no help.

  15. Turns out the problem was my lack of familiarity with Java, which I've used very little and over 10 years ago. Here is how I had the field value defined, which returned true rather than the expected false:

    ($F{license_number} != "" ? $F{license_number} + " / " + $F{issue_state} : " / " + $F{issue_state})

     

    Changing it to the following caused it to work correctly.

    (!"".equals($F{license_number}) ? $F{license_number} + " / " + $F{issue_state} : " / " + $F{issue_state})

     

    After doing this the designer wouldn't allow me to change the Markup back to none - the dropdown was empty. I had to edit the source. One of several bugs I've found with Studio. It would also be nice if I could do a right-click/copy within the expression editor but I guess that's something for another day.

  16. Thanks for the response. I'm viewing the report in the JasperSoft Studio Preview pane. The leading spaces are also trimmed when the report is exported to PDF. I'm new to Jasper Reports and I noticed the Markup HTML option but honestly have grown a little weary of experimenting when it would be nice if these types of things were better documented (and that goes for most of today's software & what passes for documentation; I'm not just picking on this product). I'll give that a try. Thanks.
  17. How can I force leading spaces in a text field?  I have a report with a field for license number & state, displayed in this format:
    123456789 / LA

    If the individual for whom the report is being run for doesn't have this information, we want it to be printed like this:
                       /
    providing room for manual entry of the license number before the slash.

    However, what I get is this:
    /

    The expression I'm using is:
    ($F{license_number} != "" ? $F{license_number} + " / " + $F{issue_state} : "                    /" + $F{issue_state})

    We are using JasperSoft Studio 5.5.1

  18. I'm having the same problem, with a date field in a MySQL database.  I filtered out the null values to determine if that was the problem but am still getting the error.  In MySQLWorkbench an example of a value in the problem field is '1962-06-03'.  Why would that be a problem for JasperReports?

×
×
  • Create New...