2001 JI Open Discussion Posted August 22, 2006 Share Posted August 22, 2006 By: stan letarte - sletarte Crosstab limitations ... Feature Request? 2005-12-28 08:34Hi, Thanks for the Crosstab support! I am wondering if there are software roadmap discussions for new Crosstab features including: 1) Better page-number support -- crosstabs do not seem to render the PageFooter until after the complete crosstab is rendered. 2) Multiple side-by-side columns (*NOT* nested) under one column ... this is useful when displaying multiple cols of data under one parent column, for example, Actuals vs Forecast side-by-side cross-tabbed under the Fiscal Quarter. I have simulated this with a "value_type" col in my database data and conditional expression for the header and a <measure> per column, plus one (with calculation="Nothing") to give an expression to test which <measure> to use for a cell. Trouble is that I can't get multiple sum cols at the end of the row, one sum per "pseudo-col", such as a "total forecast" and "total actuals" sum column. <columnGroup name="ValueColumn" height="30" totalPosition="None"> <bucket> <bucketExpression class="java.lang.String">$F{VALUE_TYPE}</bucketExpression> </bucket> <crosstabColumnHeader> <cellContents backcolor="#F0F0F0"> <box borderColor="#E0E0E0" border="Thin"/> <textField> <reportElement x="0" y="0" width="70" height="30"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font isBold="true"/> </textElement> <textFieldExpression><![CDATA[new java.lang.String($V{ValueColumn}.startsWith("ACTUALS")?"Actuals":"Forecast")]]></textFieldExpression> </textField> </cellContents> </crosstabColumnHeader> </columnGroup> By: Lucian Chirita - lucianc RE: Crosstab limitations ... Feature Request? 2006-01-04 02:03Hi 1. I'm not sure what you mean. Crosstabs are elements placed on report bands, they do not render page footers or other bands. Does your crosstab lie on the report summary? This would explain the missing page footer. 2. Another way to accomplish your requirement is to split the crosstab cells and headers in two using a line and to display both the values in the same cell. We are considering improving the crosstab functionality, but it's not yet clear what and when will be done. Regards, Lucian By: stan letarte - sletarte RE: Crosstab limitations ... Feature Request? 2006-01-04 07:22Thanks for the reply, Lucian. RE: 1) I have placed my crosstab in the summary band. The troube with placing it in the detail band is that it appears to produce an exception in which JasperReports claims that the data for the Crosstab has already been processed (see first two lines of the exception): [java] net.sf.jasperreports.engine.JRException: Crosstab data has already been processed. [java] at net.sf.jasperreports.crosstabs.fill.calculation.BucketingService.addData(BucketingService.java:210) Is there a solution to this? Should I be using a crosstab dataset and crosstab params to solve this? RE: 2) I have done used the technique that you describe and, while it works for the on-screen and printed versions of the report, exports to Excel are useless as the data is not placed into separate cells, but is merged in a single cell of type "text". Thanks again for all of your work on Crosstab! /Stan By: Lucian Chirita - lucianc RE: Crosstab limitations ... Feature Request? 2006-01-05 00:21See this discussion regarding the "already processed" exception: https://sourceforge.net/forum/forum.php?thread_id=1379985&forum_id=113530 You could place the crosstab on a fake "summary" band, see http://jasperreports.sourceforge.net/tips.tricks.html#fake Regarding the xls export, I'm not sure how that could happen. Do you have two text fields that get merged into one cell? I don't think that's possible. What am I missing? By: stan letarte - sletarte RE: Crosstab limitations ... Feature Request? 2006-01-05 04:59I'm hoping it's not me missing the point, but neither of your suggestions solve my two problems. Restating problem 1: A crosstab report placed in the summary band, but spanning many pages will produce a report that Jasper renders with a page footer only on the first page of the report. All pages following this will not have a page footer shown at all. I've tried: Placing the crosstab in the detail section, but really don't want this as it's not something I want rendered more than once, and it produces the JRException "Crosstab data has already been processed". My feature request is that the crosstab engine work better with the main Jasper engine and, when crosstabs span pages, allow printing of the page footer. Restating problem 2: I have a crosstab report that requires a column header for Quarter. Below the Quarter, I need two columns: forecast sales and actuals for that quarter. If I merge the two columns by displaying two values in one cell, it is visually appealing but produces other problems, such as Excel exports in which the column with two values is now not useable as it will contain data that Excel interets as text, not as two numbers in one cell. Restating the feature request - I wish Crosstab could support multiple, side-by-side ColumnGroups under a single ColumnGroup. Thanks, /Stan By: Lucian Chirita - lucianc RE: Crosstab limitations ... Feature Request? 2006-01-05 07:181. When the summary section overflows (because of a crosstab, subreport, long text field or something else) it does not render the page header and footer. If you need the page header and footer, you should create a fake summary band and place the crosstab on that band. The solution is described here http://jasperreports.sourceforge.net/tips.tricks.html#fake (JR tips&tricks). 2. I'm not sure what you mean by displaying two values in one cell. What I was suggesting was putting two text fields in the cell (are you including the two values in a single text field?). When you have two text fields, the Excel exporter will not merge them into one cell. HTH, Lucian By: stan letarte - sletarte RE: Crosstab limitations ... Feature Request? 2006-01-16 07:36<sound of hand smacking forehead> Oh man, thanks! I continued on the train of thought from the examples in which the two pieces of data were concatenated into a single textField ... Didn't even think of using two textFields - That solves it! </sound of hand smacking forehead> As for the fake summary band ... that also looks to be the solution - I am still getting the "JRException : Crosstab data has already been processed", but will work on using a CrosstabDataset and see if that solves my problem. Thanks again, your help has been much appreciated. /Stan Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now