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

lshannon

Members
  • Posts

    182
  • 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 lshannon

  1. Is there anyway you could post a sample of what you mean? PDF perhaps, I am not sure I understand the issue you are describing. It might help to see it.
  2. Here is one idea. I am not sure it is more elegant or effective, but maybe it will further the discussion and get some other ideas coming in. You could prepare the entire resultset the subreport would consume outside of the report. You would create a helper class that would make the DB calls. This helper would be called from the main report and could be passed in the $P{REPORT_CONNECTION} to be used as a JDBC Connection. In the helper you could make all the calls to the procedure for each field. The issue now is how to get all these resultsets into one thing the subreport could consume. One idea is the helper class could maintain a collection of maps. For each call to the procedure you make you could convert the resultset to a map (http://commons.apache.org/dbutils/apidocs/org/apache/commons/dbutils/BasicRowProcessor.html). Each map would be added to the collection. The the subreport could have a data expression like this: new JRMapCollectionDataSource(ReportHelper.getCollectionOfDataMaps()) Like I said, just an idea for now. Lets see if anyone else can come up with another approach. Post edited by: lshannon, at: 2008/05/16 14:55
  3. Hello; I think this is an issue with variable settings (unless I am misunderstanding the problem). I have attached a smalled example where a subreport creates a string value and that value is passed to the main report and displayed in the title. This example can be ran with the empty datasource in iReport. You will need to adjust the SUBREPORT_DIR parameter in the main report to where ever you have your compiled reports being stored. Hope this helps. [file name=subreportExample.zip size=1978]
  4. If you check the docs that ship with JasperServer you will see there is something called a war file install. You basically unpack things and run DB scripts manually (as the installer does). This is for a list of platforms not supported by the installer, but are supported for JS itself to run on. I have not seen in any of the release notes resin as a supported container but it would be worth giving it a try. HTH
  5. I don't know anything about JSF, but can you put a scriptlet into the page that displays the report? If so, as a fast solution you could have the code compile, fill and export in the scriptlet. Example for the compilation: Code: <%@ page import="net.sf.jasperreports.engine.*,net.sf.jasperreports.engine.util.JRProperties" %> <%JasperCompileManager.compileReportToFile(application.getRealPath("/reports/WebappReport.jrxml"«»));%> You could also put all the code in a custom tag and then put that into the page showing the report (a little cleaner in my opinion). Again I don't know JSF, your environment or your requirements so these are just guesses. Good luck!
  6. You said you are sending two parameters. There are three of them in your query. Does the third parameter have a default value defined in the report. If not then your query is not being properly constructed.
  7. Sorry I left out some of the code sample. Code: private static JasperPrint fillReport(String fileName, JRDataSource dataSource, JRFileVirtualizer virtualizer) throws JRException { long start = System.currentTimeMillis(); // Preparing parameters Map parameters = new HashMap(); parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); JasperPrint jasperPrint = JasperFillManager.fillReport(fileName, parameters, dataSource); virtualizer.setReadOnly(true); System.err.println("Filling time : " + (System.currentTimeMillis() - start)); return jasperPrint; } BTW, this was obtained from the demo/samples/virtualizer folder of the JR source. As for the speed, how fast does the query of the report run when you run it outside of the report on the same connection?
  8. Well this works for me, although my JS locally is pretty customized I have a bunch of extra security filters so I may not be the best person to test this for an out of the box perspective.
  9. Silly question but you did put proper credentials in and didn't use the ones in my example right? :) Otherwise I don't think you should need to modify anything, this *should* just work.
  10. You use one of the JR Virtualizers to prevent the heap from running out of memory when the report is filling. http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/fill/JRAbstractLRUVirtualizer.html This will however make your report slower, but at least it will finish when over 30k: Code: // creating the virtualizer JRFileVirtualizer virtualizer = new JRFileVirtualizer(200, "tmp"«»); // filling the report JasperPrint jasperPrint = fillReport(fileName, ds, virtualizer); As for making the report faster if you are using a lot of subreports you might try reducing their usage as they can be expensive. Other than that, how fast does your query run outside of JR? If it is taking a minute on its own I think this is where you need to focus your optimization efforts. HTH
  11. Another thing you could try is to call j_acegi_security_check directly. To get to the main screen by passing the login you can do this: http://localhost:8080/jasperserver-pro/j_acegi_security_check?j_username=name&j_password=jasperadmin I have never tried appending flows to this. HTH
  12. Which band did you put the chart element in? Sounds like it might be in the detail band. If it is, try it in the summary band instead.
  13. Nothing is jumping out at me with your report. Can you post the class definition of the bean?
  14. Ok I see now. I am not sure how this could be done. Perhaps increasing the width of the title text field and then adding some left padding to it to push the text to the right? Most times when I export to Excel clients are looking for more of a spreadsheet style data dump. I usually don't put in titles or page headers. Just the columns headers and the data in most cases. Sorry I am not able to be of more help. Good luck!
  15. What I like to do when I am working with classes in iReport is to jar them up and put them in the lib directory of iReport. Once you add the jar you need to restart iReport for it to pick up the new jar. In the query make sure you reference the class by its full name: com.myclass.ReportData Try this out and see if it help.
  16. Ok, I am not sure if what you are describing can be done, although I am still not 100% sure I understand the requirement. Someone more senior may have more details. On a side note, this blog entry may help a little. It covers some of the JR options when configuring the Excel Exporter. I am not sure if you are aware of these, or if any of them will fix your issue but if you continue using the API and plan to work in Excel you should know about them. http://www.jasperforge.org/index.php?option=com_mamblog&Itemid=109&task=show&action=view&id=523&Itemid=109
  17. I am confused. When you say cell are you talking about in the report design, like a text field? Or do you mean a cell in the exported version of your report (Excel for instance)?
  18. Very interesting. I was just playing with this. I created a TextField with this expression: "Lets make the date bold and red <style forecolor='red'>" + new Date() + "</style>" In the font properties I set the "isStyledText" to true. The date was red in PDF, HTML and and the JRPreviewer. This is sort of weird because I seem to remember you could only do this in a Static Text Field. Prior to 2.0.5 I don't even remember TextFields having a "isStyledText" option. HTH Code: <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="535" height="77" key="textField-1"/> <box></box> <textElement isStyledText="true"> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Lets make the date bold and red <style forecolor='red'>" + new Date() + "</style>"]]></textFieldExpression> </textField>
  19. Looks like a security issue. You should check with IT team to see if you can access this server. A simple test you can try. Ping the DB server from the command line of your machine. If this fails then you can be sure it is a security issue. If it succeeds then perhaps the DB server is not using MySQL's default port of 3309, maybe they are using a different port. Either way I don't think this is a iReport issue.
  20. What is the error? One thing, although I report lists the driver names for most databases, it does not ship with all of them. Oracle for example you will need to download yourself and place the jar in the lib directory of iReport (remember to restart to pick this up). HTH
  21. If you have a JRBeanCollectionDataSource already created you can try the following: In iReport under Data -> Report Query -> JavaBean DataSource put the full name (including package) of the class contained in your collection. Click read attributes and you will get a report field for each public getter in the class. I am guessing at least one of these fields would be of a numeric Java type. This will be the value expression of the chart. Now, in the summary band lets say, you can create a chart and in the Series -> Value expression put one of the numeric type fields. Now if you run the report you will get a chart built with the numeric value your field is referencing for each javabean in the collection. Hopefully this is not confusing and will be of some help to you. Good luck!
  22. I have done something like this. Here is a snippet where I did something similar (I just ripped this out of some other code so not all the variables are defined but I think you can get the picture): Code: File sourceFile = new File(filePath); JasperReport jasperReport = null; try { jasperReport = (JasperReport)JRLoader.loadObject(sourceFile); JRFrame data_frame = (JRFrame)jasperReport.getTitle().getElementByKey("data_frame-2"«»); data_frame.setX(level * 10); } } catch (JRException e) { log.error(e); } return jasperReport; Let me know if you have any questions. HTH Post edited by: lshannon, at: 2008/05/07 19:07
  23. Perhaps you could try putting a page break element before the start of the subreport you want to begin on the new page? Code: <break> <reportElement x="0" y="30" width="535" height="0" key="element-1"/> </break> HTH
  24. Perhaps an issue with evaluation time? Which band is the chart placed in? When in iReport does the report work as expected with the JasperViewer? Maybe you could put up the JRXML? At this point I am just guessing.
×
×
  • Create New...