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

nickw

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nickw's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Nevermind, I found the problem. I shouldn't have specified a dataset run for my crosstabs dataset since it's already my main report dataset. If anybody wants to know how I set it up, just ask. It works!
  2. As the title says, I'm trying to create a crosstabs element for each group value in my main dataset and place it in the group's footer. The crosstabs element uses a subdataset whose datasource is my main report dataset. The crosstabs subdataset is configured to reset on my main report group (resetType="Group" resetGroup="Report Group"). The records from my main datasource are grouped and ordered such that the first column contains the main report group values, and remaining columns contain the values for filling each group's crosstab. The result of this report is strange to me in two ways:First, the resulting document shows the header of the first group, a crosstabs containing only the last record of my datasource in the first group's footer, and only the header of the second group. It didn't even start to create subsequent group footers or headers. Second, when I looked at the sequence of records retrieved from the datasource and group sections initialized for the report, a new group is initialized correctly for the first group but never initializes another group for the other group values until all remaining records have been retrieved. And only then does it initialize the second group, which shows no footer of course because there aren't any records left to retrieve. Given what I'm seeing from my datasource and scriptlet classes, I'm not too surprised at the output of the report. But is there any way for my crosstabs to share my main datasource and still see when a new report group is starting without its dataset run simply consuming all records in the datasource? I'm seeing that the group value is checked from the dataset run in the crosstabs dataset up until a different group value is discovered and then never again. It's almost as if it correctly saw that a new group started, but it just didn't stop consuming records and never gave control back to the main report processes... Any thoughts? Code: Post Edited by Nick Wilson at 12/03/08 18:13 Post Edited by Nick Wilson at 12/03/08 18:14
  3. 1) You could put those static fields you don't want to repeat in the Title band as a sort of subtitle section or in the Column Header band with its printWhenExpression set to Code:$V{PAGE_NUMBER}.intValue() == 1 2) Though I'm not familiar with dummy footers/groups or how you've initialized your expressions, I know that Jasper Reports creates a temporary Java file to compile and validate its reports using a Java compiler, so that Code:[code]$V{REPORT_COUNT} becomes Code:[code](java.lang.Integer)variable_REPORT_COUNT.getValue() Be sure that you're pairing parentheses and brackets in all field/group/variable expressions. The stack trace might point you to exactly the line where a comparable syntax error has occurred. Hope that helps, Nick
  4. I think you're on the right track. Here are two things I can think to check: 1) You're report data should be ordered the same way you want it to be grouped (i.e. ORDER BY Company, Name, Surname). This might explain why your resulting report omitted some records 2) Repeated values (like Company) can be omitted (like in your example) by calling setPrintRepeatedValues(true) on the field holding the Company values[/ul]
  5. Simply setting isRemoveLineWhenBlank to "true" will achieve this provided all elements in the row are blank. Svenn's solution can only work if every field in the detail row evaluates to "null" and you've got isBlankWhenNull set to "true".
  6. You can generate reports based on user selections by building the report programatically with a JasperDesign object instead of defining a static XML template. It's a pretty direct translation from XML code to the methods provided in the JasperDesign class, but let me know if you need help with it.
  7. Also, I could help if you're simply unfamiliar with Java syntax or something...
  8. If this table is main content of the report, you could just use the report's sections to construct your table layout (psuedo-code follows): Code:<Column Header> Header 1 | Header 2 | Header 3 | ... </Column Header> <Detail> Field 1 | Field 2 | Field 3 | ... </Detail> Where column headers would be static text fields and the detail fields would be text fields with appropriate expressions (e.g. $F{field_1}). If you're having further issues with stretching, overflow, or data grouping, I might be able to help, but I need more information.
  9. Not sure about your context, but in an expression: Code:$V{OTHER_VARIABLE}.intValue() + $V{PAGE_NUMBER}.intValue()if OTHER_VARIABLE is an Integer or Code:[code]new Integer(123).intValue() + $V{PAGE_NUMBER}.intValue() HTH, Nick
  10. According to the authors, only an evaluation time of "Now" can (currently) be applied to the PrintWhenExpression because it would be impossible to perform certain visual formatting or report calculations if the expression were allowed to change at some "late" time. For example, if you had some PrintWhenExpression applied to a band or group of elements and the expression's evaluation time was set to "Report," the number of pages and placement of other elements would change when the engine evaluated their expressions, requiring the engine to recalculate and place the remaining elements and variables. This process would quickly become prohibitively recursive, even in the simplest of reports. It might even be possible to send the engine into an endlessly recursive cycle of calculation if expressions and/or variables were mutually dependent on one another and were evaluated in the wrong sequence. Anyway, it doesn't seem to be possible yet. I hope that answers your question.
  11. For those who stumble on this later, setting isPrintWhenDetailOverflows to "true" should work. I believe because overflow is treated as a separate case than natural page breaks.
×
×
  • Create New...