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

spera

Members
  • Posts

    20
  • Joined

  • Last visited

spera's Achievements

Apprentice

Apprentice (3/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Hi, Is there a way to sort the groups in a report, by a group dependent variable? (a way other than presorting the records using subqueries) A group variable like the number of record in that group, or the sum of a certain field for that group, or the minimum value of a field for that group etc. I know it's been asked before http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=48308 and there didn't seem to be a solution at the time, but that was over a year ago, so I thought that ... maybe. Thanks in advance for any hints.
  2. You can create a variable that is the Sum of whatever you have to add, print it in the Title section and set the evaluation Time to Report. See: http://jasperforge.org/uploads/publish/jasperreportswebsite/trunk/faq.html#FAQ7
  3. Read this: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=139 It might help.
  4. I think your problem is: the detail band is not displayed at all. It's not that the parameters are not passed. Your report has no query, also you don't seem to be passing any database connection (not sure how that works). Since there is no query, no records are returned and the detail band is not displayed. Try running it with an empty data source. Or just move the fields displaying the parameters into the title band. What you are trying to do is pass the data directly to the report, instead of passing a database connection from which it can retrieve its own data (which is the common approach). For this you need a custom datasource. Check out this link. http://www.jasperassistant.com/docs/guide/ch03s02.html Scroll down at the end for an example of a JRBeanCollectionDataSource datasource. So what you need is populate the collection with Student beans. In order to properly display this data in the report you need to have fields with the name of the properties and in the detail band display those fields, not parameters.
  5. You can call a function from JasperReports. For instance: select pkg_test.my_function(3), name from employees; (Oracle style) So you can write a function that calls your procedure and returns a random value. But it will probably be called once for every record in the resulting result set. If this is a problem for you, than you can have a main dummy report with a query like "select pkg_test.my_function(3) from dual" that only returns one row and your initial report, can be a subreport in this dummy report.
  6. Could you be more specific about your problem? Why can't you use subreports? Why do all three queries have to be in the same report?
  7. It may be that we have different Word versions. Our versions are: Microsot Office Word2007 (12.0.4518.1014) installed on the same machine with Office 2003 (don't know if it's relevant) Microsoft Office Word 2003 (11.6359.6360) SP1 which can also view docx.We've managed to find a workaround this problem, although we don't know what was causing it. In an attempt to pin point the cause of this stretching business, my colleague has rebuilt the troublesome subreport with a different structure which involved removing some background pictures and rearraging the fields. As a result it does not stretch anymore, so I guess all's well that ends well. Thankyou
  8. Hi Teodor, Thankyou for looking into this. The problem is that the docx document stretches and it does not fit into an A4 page anymore. (Use the Print Layout view) I've attached some print screens of the open FullReport document from the archive. One of the Pdf document and two of the Docx document (opened with Word2007 and a patched Word2003). On the Pdf print screen I've circled the area that does not appear on the Docx document. Off Topic: When you say Overlapping Elements do not appear does this mean we won't be able to show the picture from the background Band? Thanks
  9. I can't think of a way to achieve this just by setting a parameter, but you can do this from your application, before compiling your report. If you really do not want to compile your reports at runtime, you can just duplicate the *.jasper file and use either one or the other (but this can get messy when you have to make changes). Code: JasperDesign jDesign = JRXmlLoader.load("YourReport.jrxml");; JRGroup[] groups = jDesign.getGroups(); JRGroup group = groups[1]; group.setReprintHeaderOnEachPage(reprintHeader); JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
  10. The Web Application is looking for the ResourceBundle in it's CLASSPATH; The CLASSPATH of a WebApplication is relative to the WEB-INF folder. So you may try to place your properties file(s) in the WEB-INF folder. Or you could pass a custom classloader to the JasperFillManager. You can do this from any Java Application (not necessarily a web application).This way it doesn't matter where you keep your properties files as long as you let the fill manager know where to look for them on disk. Hope that helps Code: URL[] url = {new File("D:/propertiesFolder/").toURL()}; URLClassLoader loader = new URLClassLoader(url); params.put("REPORT_CLASS_LOADER",loader); JasperPrint print = JasperFillManager.fillReport(is,params,connection);
  11. Hi, I have a report that looks ok when exported to Pdf and Rtf, but when exported to Docx it stretches right to the point where part of the data is no longer visible. This report has 6 subreports. If I remove the first subreport(the one at the top of the detail band), than the Docx document does not stretch anymore (at all). If I leave the first subreport, but remove one or more of the other subreports, the stretching decreases, to the point where it's barely noticeable (if I leave only the first subreport and remove all the others). So I'm guessing, it's the first subreport that triggers the stretching and the others just increase it (sounds silly, I know). Has anybody experienced anything simililar and has figured out a workaround? I've attached an archive containing: - the sources of the main report (Test_MBA_Invoice_PB) and all it's 6 subreports(I've changed all queries to select dummy data from dual so they can be tested on any Oracle database connection); - the compiled reports; - the required properties files; - 3 versions of the report (generated in both pdf and docx): one with all subreports, one without the first sr, and one only with the first sr; I'm guessing this is not intended behaviour, so it's probably a bug of the Docx exporter. If anybody has a workaround for this, or if someone with a more inquisitive nature looks into this issue and figures out the cause, I would deeply appreciate it. PS. I'm using JasperReports/IReport 3.6.1 and also tried it with iReport 3.6.2 and got the same behaviour. Thanks
  12. Here's a thought: Create a dummy table with just one column: DAY_COUNT (day_no number). This table should contain 366 records (day_no = 1,2,3,4,...366). For simplicity's sake we'll assume you'll only want to generate these reports for at most a year. Then, let's say you want to generate the report from: 1 jan 2009 (initial_date) - 1 march 2009 (initial_date + 59). You join the DAY_COUNT table with YOUR_TABLE(product_id, amount, start_date, period) and select the following: initial_date + day_no, --> date for which you compute the amount sum((amount/period)) price_per_day --> the sum for that day where (initial_date + day_no) between start_date and (start_date +period) --> join condition and day_no < 59 --> limited to 59 days from initial_date group by initial_date + day_no ; It's a little rough around the edges, but in theory it seems like it should work. In practice, depending on the amount of data involved, the hardware on your database server, and how many times a day you want to run it, this may crash your application. Or you could use Crosstabs (see the demo sample Crosstabs) instead of Grouping. But I'm guessing you have more products than you could fit on an A4 page, so this probably won't do. Hope that helps
  13. Luckily for me, my problem is not as complex as that of Parthurs. I need to have either a footer on each page, or no footer at all. So I was able to successfully use Nmn's solution (just set the pageFooter to null, before compiling the report). Thankyou both for your help. Post Edited by spera at 12/02/2009 12:47 Post Edited by spera at 12/02/2009 12:47
  14. Hi, I am trying to create a report with optional header and footer based on specified parameters. I'm using the printWhenExpression on the pageHeader / pageFooter band which is resolved to True or False. When the Header flag is set to False, the Header is hidden and all the other bands slide up and save space This is does not seem to work for the Footer. If I set the Footer flag to false, the Footer will not be printed, but the space is left empty on the bottom of the page. The same thing happens for the ColumnFooter (regardless of whether I set it to Float or not). Then, I've tried to create a group based on the PAGE_NUMBER variable and use printWhen Expression on the Group footer, but for some reason the GroupFooter only prints on the last page. Also tried to make the pageFooter band really small and use a negative y for the footer picture, but then when the Footer is actually printed it will print over the records on the bottom of the page. Has anyone been able to hide the footer and use the space under it? Thanks
  15. Hi, As a matter of fact I have. It's issue no 4364 (see Tracker). It's status is still new. Maybe it's because I set the priority to minor. You can go vote for it /tools/fckeditor/editor/images/smiley/msn/regular_smile.gif. It may get more attention if it gets a few votes. I've solved my problem by patching my version (the 3.5 version). I've set the margin to 300 twips in the RtfExporter which seems to work. Your problem may be slightly different though, since you are generating docx files. So you are using a different exporter class which only appeared starting with the 3.6 version (if I'm not mistaking). Docx files are more complex than Rtf, so the margins are probably set differently. Check out the JrDocxExporter class in the net.sf.jasperreports.engine.export.ooxml package; maybe you can make some sense out of it. /tools/fckeditor/editor/images/smiley/msn/wink_smile.gif
×
×
  • Create New...