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

jmbaker

Members
  • Posts

    27
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by jmbaker

  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
  16. No, you didn't. It's entirely my fault for not reading properly. I found jasperReport.setProperty and confused it for setting a parameter - which I am currently unable to do. What's the best way to do this?
  17. Well, that renders my research useless :-) It's very confusing! I'll now try a parameter.
  18. Lucian, It appears to be broken and from inspecting the code, I fail to see how it could have ever worked. This is from JRBaseFiller: private void setIgnorePagination(Map parameterValues) { if (parentFiller == null)//pagination is driven by the master { Boolean isIgnorePaginationParam = (Boolean) parameterValues.get(JRParameter.IS_IGNORE_PAGINATION); if (isIgnorePaginationParam != null) { fillContext.setIgnorePagination(isIgnorePaginationParam.booleanValue()); } else { boolean ignorePagination = jasperReport.isIgnorePagination(); fillContext.setIgnorePagination(ignorePagination); parameterValues.put(JRParameter.IS_IGNORE_PAGINATION, ignorePagination ? Boolean.TRUE : Boolean.FALSE); } } The true clause of the if statement can not possibly be executed as the setProperty method on JasperReport only allows a String key and value pair to be set. Therefore, the false clause is being executed every time (or we'd see a ClassCastException). Further to that, the map contains the report parameters and not the properties! Therefore, calling setProperty sets the property on a completely different map to that passed into the method. I guess the method needs to be given JRBaseFiller.mainDataset.getPropertiesMap(), before being rewritten to take into account the String key/value. But I maintain the properties would be better implemented through get/set methods on the JRBaseReport object - it'll avoid confusion that has led to this bug. Hope that helps! John
  19. Lucian, But the property doesn't seem to work: jasperReport.setProperty(JRParameter.IS_IGNORE_PAGINATION, new Boolean(false)); called before a PDF is generated results in a PDF with one huge page (that incidentally, is blank when there is too many rows, I suspect). The report seems to be respecrting this: <jasperReport .. isIgnorePagination="true"> in the jrxml. On a side note, I see the iReport designer has a bug where by the property can not be set through the GUI (or rather, it can be but it's ignored when the report is saved). John
  20. Lucian, Thank you - I am unsure why I even missed that parameter! In terms of parameters that a user should be allowed to set, I'd imagine that almost all presentational parameters should be configurable at runtime. Colours, size of page, landscape/portrait, etc. I'm also rather puzzled to why we're using a parameter for this and not a set method? Wouldn't set methods on the JasperReport or JRBaseReport object be more intuitive? I have got some other thoughts for features but I'll put them into separate posts. Thank you for the quick response. John
  21. Hello, I've been using Jasper Reports for some time and I've often wondered why some attributes of a report can not be modified at runtime. In particular, I'd like to consider the 'ignorePagination' flag (set in JRBaseReport). This can be set before compilation but can not be set through an instance of JasperReport. Consider the case where by a compiled report (JasperReport) is used to generate table output to a browser. Most of the time, a user would expect to see a table with no page breaks. However, let's assume this report is then used to generate a PDF and in this format a user would expect to see pages. But if one is working with compiled reports then the ignore pagination flag can not be set at runtime, hence I can see no other solution but to use an uncompiled report and compile on the fly. This isn't a great solution. Wouldn't it make sense to expose some of the variables in JRBaseReport through a JasperReport instance. Ideally, we need to do little more than add a few set methods to JRBaseReport. If this is acceptable to those that matter (I have no idea who does as I'm new to this list) then could the set methods be added in the next release of Jasper? Many thanks, John Baker
  22. And the bug exists in 1.3.3 too. "Action aborted by the user.". Come on, are there not any iReport authors reading this forum? :) John
  23. Hello, I've found a bug with iReports 1.3.3 (and I noticed it in version 1.3.2, too). The "Ignore pagination" tick box doesn't get persisted correctly when the report is saved. In fact, it actually writes the wrong value to the XML. If you tick the box and press save, the 'isFloatColumnFooter' set to true. If I untick "Ignore pagination" then the isFloatColumnFooter flag is removed from the XML. I bet it's a 2 minute fix but worth resolving! It would be lovely to set this property at runtime but that's a jasper reports change request, I guess! John
  24. Hello, I am trying to use iReports 1.3.2 and I randomly get an 'Aborted by the user' error when I try to run a report (with or without a datasource). It's clearly a bug given if I restart iReport the problem goes away, sometimes! Sometimes I can run a report a few times before the error appears, and other times a report will not run once. The error appears less frequently on iReports 1.3.1. I note a few people have seen this problem and it renders iReports virtually useless. I'm not even doing anything too complicated (a simple query and a tabular report). I've noticed it aganist Hibernate and a normal JDBC connection. Therefore, how about someone on the iReports team takes note of this and adds lots of useful debug information to this condition so we can find out why it's happening? I'm happy to test a build if someone wishes to send me one. John
  25. Hello, Is it possible to set pagination to true/false on a compiled report? I see it can be done from a non-compiled report, but it would be great to set properties such as pagination on a compiled reoprt. It's the kind of thing you wish to set at runtime! For example, Mr. User may wish to view a large table in a browser, in which case pagination isn't required, however the user then may wish to get a PDF copy and pagination is then definitely required. Thoughts most welcome! John
×
×
  • Create New...