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

spera

Members
  • Posts

    20
  • 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 spera

  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
  16. Hi, I have the following problem: We are generating reports in Rtf format. They are A4 format. Even though the printer is set to print A4 format they give the following warning: The margins of section n1are set outside the printable area of the page. Do you want to continue? ( http://support.microsoft.com/kb/314568 ) This is due to the fact that the Unprintable Margins (File --> Page Setup --> Margins) are set to the 0 (even though the Report has it's margins set to 20). I've looked in the JRRtfExporter and found what looks like the cause of this: writer.write("\\marglsxn0\\margrsxn0\\margtsxn0\\margbsxn0"); at line 273 (in the 3.5 version). It looks like the margins will always be 0, no matter what the report's settings are. I've checked out the Rtf specification ( http://www.biblioscape.com/rtf15_spec.htm#Heading26 ) and found that I can replace \\marglsxn0 with ... \\margl400 if I wanted a 20 point left margin. (It's an older version, but the marg... tags are the same all the way to Rtf1.9) So I'm trying to replace that line with smthg like: writer.write("\\margl"); writer.write(String.valueOf(twip(jasperPrint.getLeftMargin()))); writer.write("\\margr"); writer.write(String.valueOf(twip(jasperPrint.getRightMargin()))); ... etc, similar to the way the height and width are set. The only problem is JasperPrint does not have a getLeftMargin method. I tried to look through a few Properties maps, but it got a little confusing... So, does anybody know how I can retrieve the leftMargin, rightMargin, topMargin and bottomMargin from a jasperPrint object? Thankyou
  17. Hi Is there a way to include a link to a picture in a rtf file, from Jasper? In MS Word you have the possibility to insert a link to a picture (e.g c:/catalogus/1.jpg). (Insert --> Picture --> From File --> select a picture and chose Link to file from the Insert drop down next to the file name). This results in the following rtf tag: { INCLUDEPICTURE “c:/catalogus/1.jpg” \* MERGEFORMAT \d} If the file is opened on another computer that has another 1.jpg picture in the c:/catalogus/ folder, the new picture will show in the right spot in the rtf file.(kinda like an html file references pictures) If I insert a Picture in Jasper and it is not found, I only have three options: Blank, Error and Icon. It will not insert an empty frame with a link to the absolute path provided. I tried to insert a Textfield, set the Markup to RTF, and then insert this tag in there, but that did not do the trick. We are switching from SQLWord to JasperReports and have come across this apparent show stopper. For some reason our client wants the rtf file generated on the server, by the webapp we developed, but the pictures to be included in the rtf file are on his laptop. That's because the pictures are taken at the client site (the client's client :) ) and then copied on his laptop afterwards. Then he opens the previously generated rtf Catalog(which will take the pictures from his laptop) and prints it out. We tried to suggest an upload on the server and then Generate the Catalog, but the Internet connection is bad to non-existent at the client site and they just want it the way they want it. Has anybody come across this before (ever)? (If this is not possible in Jasper, I would also appreciate an answer so that I stop trying to find a solution) Thanks Post Edited by spera at 07/30/2009 15:34
  18. forhitesh Wrote: - whether the font type, size and color can be controlled in JasperReports3.5.2 like we do in HTML by using CSS. You can create your own Styles and apply them to your fields. If you are using iReports 3.5.2 you can add Styles from the Styles section of the ReportInspector. You can set a style as default so it is applied to al fields. Note that the fields' individual properties overwrite those of the style. You can also create conditional Styles (if for instance you want the amounts greater than 100$ to be bold and red). You can also reference styles defined outside your jrxml file (I don't know how that works though). Checkout: the styledtext and templates demo samples that come with jasperreports-3.5.2. Hope that helps
×
×
  • Create New...