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

jmbaker

Members
  • Posts

    27
  • Joined

  • Last visited

jmbaker's Achievements

Explorer

Explorer (4/14)

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

Recent Badges

0

Reputation

  1. Hi, Thanks for giving it a try. Could you try with 50 rows of data? John
  2. Betty, Thanks. I've read the FAQ but am still at a loss to what is wrong. Here's my report - any chance you could take a look? With no page header/footer and cells aligned, there seems to be little else I can do (and the bug remains!). The HTML renderer needs an awful lot of work - I wish I had time to rewrite it! <?xml version="1.0" encoding="UTF-8" ?> <!-- Created with iReport - A designer for JasperReports --> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="inactiveUsers_sub1" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="530" pageHeight="842" columnWidth="530" columnSpacing="0" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenNoDataType="AllSectionsNoDetail" isFloatColumnFooter="true" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <parameter name="APPLICATION" isForPrompting="true" class="java.lang.String"/> <parameter name="DATE_SINCE" isForPrompting="true" class="java.lang.Long"/> <parameter name="DATE_TIME_FORMATTER" isForPrompting="false" class="java.text.DateFormat"> <defaultValueExpression ><![CDATA[DateFormat.getDateTimeInstance()]]></defaultValueExpression> </parameter> <queryString><![CDATA[select u.logintime, u.mail, a.name from Application a, Application_Access au, SSOLDAPUsers u where a.applicationId=au.applicationId and au.accesskey=u.attribute and a.name=$P{APPLICATION} and (u.logintime < $P{DATE_SINCE} or u.logintime is null) group by u.mail, a.name, u.logintime order by u.logintime asc]]></queryString> <field name="LOGINTIME" class="java.math.BigDecimal"/> <field name="MAIL" class="java.lang.String"/> <field name="NAME" class="java.lang.String"/> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="0" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="19" isSplitAllowed="true" > <staticText> <reportElement x="0" y="1" width="120" height="17" forecolor="#000000" key="staticText-1" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[Time (UTC)]]></text> </staticText> <staticText> <reportElement x="120" y="1" width="200" height="17" forecolor="#000000" key="staticText-2" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[user]]></text> </staticText> <staticText> <reportElement x="320" y="1" width="210" height="17" forecolor="#000000" key="staticText-3" isPrintInFirstWholeBand="true"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Top"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" /> </textElement> <text><![CDATA[Application]]></text> </staticText> <line direction="BottomUp"> <reportElement x="0" y="18" width="530" height="0" forecolor="#000000" key="line-1"/> <graphicElement stretchType="NoStretch" pen="Thin"/> </line> </band> </columnHeader> <detail> <band height="19" isSplitAllowed="true" > <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="1" width="120" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date($F{LOGINTIME}.longValue())]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="120" y="1" width="200" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{MAIL}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="320" y="1" width="210" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font fontName="Times-Roman" size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary> </jasperReport>
  3. Hello, I am running a report that does little more than execute a subreport producing a table (the subreport executes an SQL query). When rendered as HTML, some rows in the table are blank - the data is not missing, but the blanks are inserted for no obvious reason. Re-running report produces the same blank rows in the same positions. Yet if I export as CSV, the blank rows disappear. I guess this is a bug in the HTML renderer, but how can it be cured? John
  4. Hello, I am trying to use a subreport and the overall report runs fine (including subreport) when the subreport is in the page or column header section. That's great, however when I place the subrepor component in the column or page footer, it doesn't display! That's the only change I made - I moved it down the report! I would be happy to keep it in the page header but because it has a fixed size, and the output is table (hence variable height), the output is positioned above the output from the detail section. I should add that I'm passing a connection in as a parameter to the report, and that's passed into the subreport. I am not passing the report data source into the subreport. Please help! :) John
  5. Hiya, Is there really no-one on the jasper project who can shed some light on this problem? Is dynamic datasets not possible? John
  6. I've come up against the same kind of problem. Jasper doesn't seem to be very dynamic, i.e. dynamic data sets on graphs, dynamic selection of the type of time chart [hour, day, week, etc.], dynamic table columns, dynamic widths of fields (not interested in height). Are there any plans to add these features? Or are there solutions?
  7. Hello, I have a requirement to produce a bar chart that will have up to five datasets. Does Jasper have any dynamic dataset generation abilities? I guess my result set would look something like this: X Y Name 1 1 Set1 2 13 Set1 3 3 Set1 1 2 Set2 2 11 Set2 3 4 Set2 I'd like to generate a dataset for Set1 and Set2 in this case, however the results for Set3 may be generated and hence how can I configure Jasper to create a dataset for each SetX? John
  8. Hello, I'm taking the "X "+NumberFormat...+" Y" route but it's kind of annoying given I thought there were some internal date/number formatting features driven from parameters (REPORT_TIME_ZONE, for example). Surely what I'm asking for is a really sensible idea? Could this be added to the wish list of features? It seems increasibly obvious for anyone wishing to mix dates/numbers & text. Thanks, John
  9. Hi, I have a question concerning layouts. Consider the following text field expression: "Total: "+$F{MB}+"MB used" If the value of MB is a number then it will be output using toString(). But this behaviour is not ideal because the field looks better formatted, which can be done using the Pattern facility on a text field. However this means I need to create three text fields: "Total: " $F{MB} (with a pattern set} "MB used" and place all three text fields beside each other. And this is where I have a problem. The output looks unprofessional if the text isn't perfectly aligned (horizontally), and given the value of $F{MB} is entirely variable, the gap between the fields can not be pre-determined. Is there a facility to make text fields sit beside each other and automtically increase/decrease in width, ensuring all fields are kept close to each other? Thanks, John
  10. Hello, From a JasperPrint object, is it possible to retrieve the number of results? Given a JRDataSource feeds the Jasper report, it's not always possible to find out the number of results processed by the report via the data source (for example, it may be iterating over a ResultSet). Any thoughts? John Baker
  11. Hi, I've looked into this problem and concluded that images handling requires some work. The current implementation attempts to create a File object with the image name, which assumes the image resides in the current working directory: JRLoader. public static Object loadObjectFromLocation( String location, ClassLoader classLoader, URLStreamHandlerFactory urlHandlerFactory ) throws JRException { // Cut File file = new File(location); if (file.exists() && file.isFile()) { return This isn't really a very useful solution for a web based environment. I've worked around the problem by writing my own renderer that has a static directory in which images will be found, however this is also over kill. The solution is for the default image loader (from files) to make use of a parameter that can be passed into the report. Very much like the subreport parameter, this parameter would state where the images have been stored. I take your point concerning jasper server but the company I am working for wanted their own version, and to be honest, we should probably open source it as it's rather smart! Is there any chance the image directory parameter could be added in a future release? Thanks, John
  12. Hello, In the ImageServlet (within the j2ee.servlets package), the following code exists: public void service( HttpServletRequest request, HttpServletResponse response ) throws IOException, ServletException { byte[] imageData = null; String imageMimeType = null; String imageName = request.getParameter(IMAGE_NAME_REQUEST_PARAMETER); if ("px".equals(imageName)) { This is fine, however some stupid devices (such as the highly broken Blackberry browser) will submit requests with malformed URLs (and hence, no image name request parameter). How about checking to see if imageName is null before using it? This avoids the following: java.lang.NullPointerException at net.sf.jasperreports.engine.export.JRHtmlExporter.getPrintElementIndex(JRHtmlExporter.java:1878) at net.sf.jasperreports.engine.export.JRHtmlExporter.getImage(JRHtmlExporter.java:582) at net.sf.jasperreports.j2ee.servlets.ImageServlet.service(ImageServlet.java:97) If the image name is null then a 200 response with no content should be sent (as I can't think of anymore suitable). Most browsers will display a broken link icon if this occurs. Also, if commons logging is in use, a big warning should be written indicating that something is submitting broken URLs. John
  13. I don't have an example to hand but I don't think it works the way in which you suggest. The exporter exports the JasperPrint object, and it would appear that if the JasperReport had pagination set to true, then the JasperPrint is a paginated report (and this can not be changed). Surely a Jasper report guru can comment on this query? The way in which this currently operates should be obvious to someone who knows the code well. John
  14. Hello, If I have a JasperPrint object, I can export it using the various exporters provided with Jasper Reports. However, formatting (such as multi page output, etc.) is the kind of thing one wishes to change given an output format. For example, paginated output isn't something I generally wish to see if I export to HTML (I'd like to see one big table), however if I output to a PDF then pagination is a must. Saying that, paginated HTML output would be handy if we could output one page at a time (and therefore support 'previous' and 'next' functions in the browser). But we'll park that thought for now. Therefore, using a JasperPrint object, can I output to HTML without pagination and PDF with pagination? If not, would the developers of Jasper consider breaking up the generated report from the view? I appreciate this isn't a five minute task, but could it be kept in mind? Thanks, John
  15. Excellent. Thank you. I do find this concept a little confusing and while parameters are handy, I think set methods would make the API more intuitive. John
×
×
  • Create New...