Jump to content

jmurray

Members
  • Posts

    401
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Everything posted by jmurray

  1. At design time you only have one canvas to work with. The canvas is a report layout control and doesn't necessarily relate to the concept of output pages. The A4 size that you specify for the report is only used by iReports to set vertical size limits on the various bands at design time. The canvas allows you to adjust the layout for output pages by using Headers, Footers, Columns, Grouping, Sub-reports, and the Summary band. You can achieve a lot more layout control using these report sections than you can trying to manipulate the contents of the Detail band. There is no way to force a different canvas "page" other than to utilise the Summary or Last Page Footer sections. But if you do, then it may restrict your use of other header and footer sections (as these can limit the vertical size of the Summary and Last Page Footer bands. . Post edited by: jmurray, at: 2007/02/08 00:23
  2. This might help with the basics: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=228&Itemid=109 It's important that you don't size your Text field boxes to the vertical height at design time: let the JasperReports engine do that at fill time. In iReport 1.3.0 they introduced an inline page break element that you can insert between each Text Field to force a new page. If you are using earlier versions of iReport or JasperReport then that element won't be available. You'd have to try to size your text field contents to do that for you.
  3. I'm not following. If you mean that you develop using iReports but with no datasource then that's fine. Just choose the "Execute (empty datasource)" option. You would be better off establishing a connection to a datasource so that you can actually see what your output will really look like though.
  4. Basically no. A report just is a snapshot after all - you have to define all your columns before JasperReports can fill the output. So once the report generation is underway there's no way to change the source query. BUT!!! You can do it in reverse. Make sure your query returns all the columns that you will ever need to display and then selectively remove them from you report. Please note that the layout control is particularly difficult with this option. If you want to avoid leaving gaps where columns are omitted you will need to use some very intelligent Text Field and Print When expressions.
  5. It's not something you can fix in iReport - Excel is apply "General" format rules. The best thing to do is to change the format of the cells in Excel to "Number" after the report is filled.
  6. Maybe grouping could help you. See the tutorial at http://www.jasperforge.org/index.php?option=com_docman&task=doc_download&gid=120&Itemid=248 Unfortunately your problem description isn't clear enough to provide a better solution.
  7. During design time you can simply switch between predefined datasources using the Data - Set Active Connection menu selection. But once you deploy you report to your server environment the report is static, so it's not so straightforward to switch datasources. The easiest way to do it (if you have the resources available) is to have completely separate DEV, TEST, and PROD environments. That way the DEV and TEST schemas can be carbon copies of your production schema(s), even the schema names can stay the same. That means you don't have to change anything in your reports when switching between each environment. If you are resource constrained and only have one database with different schemas (with different names) for each environment then the way to do it would be through the use of one or more String parameters to control which schema to use. An example query might look like this: select * from $P!{SCHEMA}.tablename where ... Make sure you set a default value for the SCHEMA parameter so that you don't generate an exception if no value is passed in.
  8. JasperReports is designed to work with the data that you present it, so the concept of a fixed number of rows per page doesn't exist. But you can force your data source to provide blank rows. Here's how: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=229&Itemid=109 I hope it give's you an idea on how to solve your problem.
  9. It's a known bug. You have to edit you xml source and manual change the "null"s to "none"
  10. Use the Summary band if you want the values to be tight buffered against the last data row, otherwise use the Last Page Footer band which will put the totals at the bottom of the last page.
  11. Take the apostrophe out of the parameter identifier so that the quotes are passed into the query. ie. your parameter identifier should be $P{risk_group_name}, not $P!{risk_group_name} With the apostrophe included there string's quotes are stripped, so the value TESTGROUP2 in your query will be interpreted as a field name. However, the apostrophe can be useful if you are looking for inline text matches like this: where AFIELD = '$P!{myparametername}SOMEOTHERTEXT' or where ANOTHERFIELD like '%$P!{myotherparameter}%' It saves having to use ugly string concatenation in SQL. Post edited by: jmurray, at: 2007/01/30 19:57
  12. It's the same variable, you just place it in a Text Field in the Detail band. It auto-increments with each row in the Detail band until the entire group is filled. Then it resets to zero and starts incrementing again with the first row in the next group
  13. Holy cow, if you mean 5500pixels then that's a 2m high detail section!!! I hope your source data doesn't return to many rows or there'll be a global paper shortage. Anyway, if that really what you want to do then you'll have to set you page height to a larger value under the report settings dialog box.
  14. You could pass back the contents of the subreport's $V{REPORT_COUNT} variable to your own variable in your main report. In version 1.3.0 there is a "Force New Page" element that you might be able to set a Print When expression for base on your variable. I don't have v1.3.0 so I can't say whether this solution is viable or not. In general the "Force New Page" property has only ever been made available for report groups, and it is a static setting within the source (ie. cannot be changed at runtime).
  15. Exponential format? Do you mean scientific notation? If so this will happen because: 1) You haven't set the the desired element output pattern (eg. #,##0.00) in the source. Look under the "Text Field" tab in the element properties dialog box. and/or 2) The element is not wide enough to display the full output, so excel automatically converts to scientific notation so that at least part of the number is readable. Try setting the element's width to a larger value
  16. gombs is on the right track but hasn't explained it clearly... The Remove Line When Blank setting is working properly for you, it's just that the following fields are not shifting up. This is usually caused by their Position Type being set to "FixRelativeToTop". Only the first element in the vertical stack should be set to FixRelativeToTop, the rest of the elements in the band should be set to "Float" so that they can be moved up if any empty element is removed.
  17. You don't need to create variables, it's already done for you. For each group there is a row counter variable called $V{yourgroupname_COUNT} You can use group row counter variables directly in a java.lang.Integer Text Field. Simply set the Text Field Expression to be $V{yourgroupname_COUNT}, set the Calculation Time to Now, and make sure the Textfield Expression Class is java.lang.Integer. Please note that the value of group row counter variables is zero (0) within any header context, so they are only effective within detail and footer sections. The value of a group row counter variable in a group footer will be the same as the last value in the detail section, as shown in your sample. . Post edited by: jmurray, at: 2007/01/30 01:04
  18. You're kidding right? Learn how to use and pass in parameters. It's all in the iReports manual and the JasperReports manual.
  19. Use LIKE instead of = eg. SELECT * FROM products WHERE name LIKE '%$P!{ProductName}%' If parameter Productname is NULL then the resultant query will be SELECT * FROM products WHERE name LIKE '%%' which is the same as selecting all records Please note that using LIKE is also slower than using = as you will definitely invoke a full tablescan where = can take advantage of indexing wherever possible. Post edited by: jmurray, at: 2007/01/21 08:53
  20. You can't call a stored procedure in that fashion, but you can call a stored function that executes a stored procedure. Using a function means that you can even return a result code and take appropriate action if the procedure fails.
  21. You could get data from a different table by using a sub-report
  22. There is no such setting in iReport. You could potentially manipulate the resPerPage via a scriptlet. But you could also achieve this using groups as there is a "Start on a new page" parameter in the group settings. In your source query you would configure a new group field based on rownumber. An Oracle example that limits the number of records per page to (say) 35 would be something like this: select trunc(rownum/35) as myGroup, first_name, last_name from turbine_user MySQL is a little different in that it doesn't have any concept of rownum. It needs something more like this: SELECT floor((@rownum:=@rownum+1)/35) as myGroup, t.* FROM (SELECT @rownum:=0) r , (SELECT AccountName from DigiToll.Account) t
  23. Float is your friend. This might help: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=228&Itemid=109
  24. This might help: http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=221&Itemid=109
  25. I am trying to use java.text.DecimalFormat in a scriptlet so that the string representation of a number does not appear in scientific notation. Unfortunately the compiler always complains as shown in the code sample below: Code:import net.sf.jasperreports.engine.*; import java.text.DecimalFormat; [snip] public String myNumberFormat(Double v1) throws JRScriptletException { /** make a string out of the Double that was passed in **/ java.text.DecimalFormat formatter = java.text.DecimalFormat("#0.#"«»); String p = formatter.format(v1); [snip] C:ReportsDigiTollNETFLOWNF_PORT_TOTALS_SITE_SUBScriptlet.java:20:ÂcannotÂfindÂsymbol  symbolÂÂ:ÂclassÂtext  location:ÂpackageÂjava  java.text.DecimalFormatÂformatterÂ=Âjava.text.DecimalFormat("#0.#"«»);  ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^ Removing the "java.text." class directive simply changes the error to "cannotÂfindÂsymbol DecimalFormat". It's like the scriptlet engine doesn't follow or know about the iReport classpath. Putting rt.jar into the iReport lib directory along with all the other jrs didn't help either. Any ideas? . Post edited by: jmurray, at: 2007/01/18 21:49
×
×
  • Create New...