Jump to content
Changes to the Jaspersoft community edition download ×

redwine

Members
  • Posts

    124
  • 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 redwine

  1. Situation: We are using 2.0.4 to render a report that was created with an older version (2.0.2). It is throwing several warnings: "WARNING: The 'leftBorderColor' attribute is deprecated. Use the <pen> tag instead" Question: Is there supposed to be a way for a report created with older versions of iReport to be compiled with the new version 2.0.4? If there is, how is it done or how should iReport be configured? Thanks! redwine Post edited by: redwine, at: 2008/02/05 14:24
  2. Lucian, Thanks for that bit of information. I'm sure it will help me with my task. Regards! Edwin
  3. Datasource with Encapsulated Fields Greetings! I will try to explain my situation briefly but with as much detail as possible before I ask my question. Situation: Up to this time, I have been using collections of plain JavaBeans whose fields are accessible through getters and setters. This has worked well for me with very little need of further manipulation or conversion. Just recently, I was asked if I could create a report using JavaBeans (datasource) whose fields and values (the actual report parameters) are encapsulated within one or more custom classes. Normally I would use a regular bean constructed with its fields accessible through its getter and setter methods. In this setup the report parameter's name would simply be the name of the bean's field and the report parameter's value would be the value of that field accessed through the bean's corresponding getter method. What I am required to use is a bean whose field names and corresponding values are encapsulated (one or more levels) within custom objects like the Field object. Further, several Field objects specific to a particular bean are contained in a Collection of Field objects... Map<String fieldName, Field field> fields. I may also need to work with beans which have additional levels of encapsulation where a bean has a Collection of DataGroup objects each having a Map of Field objects each containing the name and value that will both be used to create a report parameter (passed to a Report's parameters map). class Person - Map<String groupName, DataGroup group> dataGroups class DataGroup - Map<String, Field> fields class Field - String fieldName - Object fieldvalue * fieldName and fieldValue will eventually become a single parameter in the report parameters map - Map<String, Object> parameters. fieldValue will have to be cast into the type used by the corresponding report parameter. * the report would have a parameter $P{fieldName} whose value will be the value of fieldValue I have created an Extractor class to extract the fieldNames and fieldValues that are needed to create each of the report parameters. Some sort of Factory class. Question: Does JasperReports allow the direct use of beans whose fields are encapsulated by (a collection of) other custom classes without the need for a Factory class? If at all possible, what would be the correct way to do it? Thanks! Post edited by: redwine, at: 2008/01/28 19:12
  4. broschb, Thanks for the reply. Your reply has actually sparked several ideas but I also have a couple of questions to ask just to clarify some things about the information passed to the report. Would it be correct to say that if I needed to use information coming from different objects (beans) and have them printed on a single report, I would need to create a Class (ReportBean) whose instance would contain variables corresponding to each of the different parameters/fields indicated in the report template? Would it be necessary to ensure that the type of each corresponding (ReportBean) variable be the same as the type of each corresponding parameter/field in the report template before they are passed to the report? If I correctly understood your previous post, I would have a single bean in the parameters map that I pass to the main report... That bean would, in turn, have all the parameters needed to fill the report. I also need to clarify something regarding parameter maps passed to a subreport. I saw in one of your recent posts that parameter maps are simply parameters passed to the main report. Does this mean that I need to declare a variable of type Map in my ReportBean for each parameter map that I need to pass to different subreports? Sorry if my questions go around in circles. I do hope you could decipher what I am trying to ask you. :) Edwin Post edited by: redwine, at: 2007/08/20 21:11
  5. broschb, I have a question similar the one you replied to recently. It's about using multiple JRBeanDataSource objects to fill a report. You may want to click on the link that follows so you could see my post and maybe shed some light on this matter. http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=29640&catid=8 Thanks in advance! edwin
  6. This is is a question for those who are well versed in using JRBeanCollectionDataSources as my question is related to generating reports using more than one JRBeanCollectionDataSource. I have created two report templates (persons & departments) each getting data from two different bean collections (TestBeanPerson & TestBeanDepartment). I have also written a java app (ReportGenerator.java) that generates a PDF report using the actual .jrxml file and data from specified bean collection (persons or departments). When the reports are generated separately, they both output the information from the corresponding beans correctly. I have also created a third report template which combines the first two reports... a table for persons and a table for departments in a single report. Unlike the other two reports, I have not been able to generate the pdf for the consolidated (third) report. A have previously used JRResultSetDataSources. I'm quite certain that there is something similar to getting data from different tables in a database and mapping their values into their corresponding parameters / fields. I just don't know what the equivalent is when using bean collections. I'm currently stuck with the following questions: How do you fill a SINGLE report using data from more than one bean collection (different Objects)? Is it possible to consolidate different objects into a single JRDataSource? Other alternatives? I have attached the .java & .jrxml files I used. I hope someone would be kind enough to share thier secrets and shed light on this matter. Thanks in advance! PS: Please note that you need to manually modify the ReportGenerator class to generate the first two reports: For generating the person report: On LINE 29 type fileName = "aaa_070808_JRBCDS_sub01" & On LINEs 47 - 48 type JasperPrint jp = JasperFillManager.fillReport(pathJasper, new HashMap(), persons); For generating the department report: On LINE 29 type fileName = "aaa_070808_JRBCDS_sub02" & On LINEs 47 - 48 type JasperPrint jp = JasperFillManager.fillReport(pathJasper, new HashMap(), departments); aaa_070808_JRBCDS_sub03.jrxml is the file containing both person and department tables. Edwin [file name=MultipleBeans.zip size=5898]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/MultipleBeans.zip[/file] Post edited by: redwine, at: 2007/08/14 22:58
  7. There are three things that you can try: Option 1: The simplest option. Just use an image editor to combine your top and bottom images and merge them into a single image. This way you would only have a single image and it would not add to the slices in your report. The more slices (non-corresponding element edges create additional slices), the slower your report. Option 2: The better option. Place both images on the same band. I assume that's what you are doing. Just make sure that: a) Your image stacking order is how you need it to be. Top image in front, bottom image at the back. Stacking order almost always matters. b) You also have to make sure that your top (front) image is transparent where it needs to be. gif images are recommended if you need to set an image to a certain opacity/transparency. You can't set this in iReports so you need to set transparency before you import the image. This would be the most flexible option to use although you may have to use an image editor to adjust alpha/transparency. Option 3: Nice to know option. Use the background band for images that you need to display in a fixed position on the page like watermarks or maybe images on your letterhead that don't need to move (float)... ABSOLUTE position images. You could then place the image that needs to be on top on the band that you choose. NOTE the following when going for this step: a) The images placed in the background band will display on all pages, b) Images on the background band are in a fixed (ABSOLUTE) position. They will not adjust their position or do not float. c) If elements in any of your upper bands stretch, remember that you will not be able to position an image which is placed on a lower band relative to an image placed in the background band and expect it to display with exactly the same relative positions to each other. :) Simply put... there is no guarantee that your upper image will align properly with an image in the background. A note on reports generated in HTML: You can scale text generated in your report. However (since I last tried) the images in reports generated in HTML do not scale. I have come across a suggestion to just generate the reports in PDF and have them display as a PDF link or image in HTML. You may also want to explore the use of frames with reports that are to be generated in HTML. hth! edwin Post edited by: redwine, at: 2007/08/07 16:41 Post edited by: redwine, at: 2007/08/07 16:48
  8. Santoshi, As far as I know, there is no feature (at least not yet) that allows you to create check boxes. I actually have to create my own check boxes. First create a rectangle element (10 X 10 pixels would be small enough). Create an Image element (8 X 8 pixels if you want to fit the image nicely inside a 10 X 10 Box) This will be the image element that will actually be your check mark or whatever mark you will use. Link the image element to an actual image file in your directory. Do this by right clicking the image element and clicking the Image Tab. Here, type in the path to the image you will be using inside the Image Expression box. You could use an absolute or relative path, whatever works for you. You now have your basic elements for your check box. You now have to align the centers of both your checkbox and your checkmark. It would also be a good idea to make sure the stacking order of your elements are correct, meaning the checkmark must be in fromt of your check box. For your checkbox to work you will have to type in the apropriate Boolean expression. To do this, right click on your check mark image. Select properties and click on the Common tab. At the bottom where it says Print when Expression, type in the Boolean expression that will determine when your checkmark image will be displayed/printed. hth! edwin ** attached is a checkmark image you might want to use :) [file name=checkBlack.gif size=370]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/checkBlack.gif[/file] Post edited by: redwine, at: 2007/08/06 17:43
  9. Badrish Your Date field must be a Text Field (not Static Text) for this to work. In case you have a static field, just do this: Right click on the date field and select Transform in Text Field (F3). This will convert your static text element into a text field element. Now, right click your date text field. Select properties and click on the Text Field tab. In the Text Field Expression Class select java.util.Date. I am assuming that you are passing a date parameter as you have mentioned. In the Evaluation Time, select Now. In the Pattern type in "MM/dd/yyyy" or whatever pattern you need. Lastly, in the text field expression indicate the parameter that you are using like $P{importantDate}. hth! edwin
  10. Unexpected Page Breaking iReport Developers/Users I would like to kindly request feedback from those who have encountered the following issue or something similar? I have a master report with 5 subreports all contained in the detail band. For some reason, a page break is introduced unexpectedly after some of the subreport sections when the report is generated. Please see the attached sample files which include 1 master and 3 subreport files (subreports 2 & 3 are just repeated in the master report to show what is actually happening). I have tried adjusting the band and report heights but those did not resolve the issue. I have also looked into the XML code of each file and did not find any attribute/property which would force a break (or so I think). Could this be connected / related to extra spaces (blank lines) appearing in generated PDF reports? Other reports I have prepared and layed out in a similar way (master with multiple subreports) did not have this unexpected page break. Any feedback would be appreciated. Thanks! edwin [file name=Unexpected_Break.zip size=6678]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/Unexpected_Break.zip[/file]
  11. richard_07 Try doing this: 1) Right click on the text field (the one which you don't want repeating values). 2) Select properties & select the Common tab. 3) Uncheck the Print Repeated Values attribute. This will suppress the printing of repeating values on your generated report. edwin
  12. Kurgane, In version 2.0: Right click the Break element and select Properties. In the properties dialog box click on the All (tab). Scroll down to the bottom. You will see the break property. Select the break type from the dropdown list. Currently there are only 2 selections Page & Column. hth :) Edwin Post edited by: redwine, at: 2007/07/30 18:34
  13. Surendra, Check out the following links to my previous posts. They may help you. http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=9&id=25381#25381 http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=&func=view&catid=9&id=23990#23990 hth :) Edwin
  14. umutdogan You could (1) set the left and right borders of your text element to Thin or 1-Point, (2) set the left and right padding to at least 2 (so your text will not be too close to your borders), and (3) set the Stretch Type of yout text element to Relative to Band Height. All these will be set from the element properties window. hth :) Edwin Post edited by: redwine, at: 2007/07/30 17:48
  15. likchin STEP 1: You must first set the external programs that you will be using. On your menu bar click Options > External Programs (tab). You will be using the path to the .exe (executable) file of the program you will be using. Example: You will be needing a PDF Viewer if you need to view how your generated reports look in pdf. You could enter C:Program FilesAdobeAdobe Acrobat 7.0AcrobatAcrobat.exe or browse to the directory where your PDF Viewer executable file is located. You will have to assign the paths to the different viewers if you need them. You may leave them blank if you don't. STEP 2: After that, also make sure that your compilation settings are correct. On your menu bar click Options > Compiler (tab). Set your Default Compilation Directory. This is where your .jasper and .pdf. files will be saved when you compile your report template. Remember where this directory is. Also set the Directory where the paged out data is stored. STEP 3 Lastly, on your menu bar click Build. Select the type of preview you want. This will usually be in PDF. Remember that if you want to preview your report in a specific format, you should have previously done STEPs 1 & 2 for the appropriate file format. hth :) Edwin
  16. Aloisio I am quite positive that this feature may be included in a future version of iReport. However, I'm sure that creating a parameter for the filename or inserting the name during the report filling time can be done programmatically using Java. Conversely, if you are pulling data directly from a database, you may be able to do this using your SQL queries. I hope this will help you come up with some ideas that will be able to help you resolve this issue. Do post your solution if you do come up with your own workaround. Edwin
  17. Badrish, Is your data organized into more than one column: Edit > Report Properties > Columns (tab) - the break may be acting as a page break if you have only one (1) column. Try to split your detail band into several columns by assigning an appropriate number in your Report Properties. This may resolve the page break issue. If this works, you may also want to place your header fields into the column header bands so your data will be organized under the appropriate headers. hth. :) Edwin
  18. Discovered the problem that was causing issue #1: Elements deleted when reordering. (Please refer to the attached file in the original post: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&id=28445&catid=9 ) Here's the workaround: Reordering Elements in Grouped Frames iReport v 2.0 ** Elements are deleted when they are reordered/rearranged using the Document structure controls (Move Up or Move Down) if the enclosing frame is grouped with other frames. This does not occur when using the Formatting functions, Bring to Front or Send to Back. ** If elements need to be reordered using the finer controls of the Document Structure pane, do the following: 1. First ungroup the frame enclosing the elements that need to be reordered such that this frame will not be frouped with any other frame 2. Reorder the elements using the Move-Up or Move Down controls. 3. Regroup the frames after you have finished reordering the elements. ** Grouping frames may be necessary for forcing two or more frames to resize to the height of the tallest frame i.e. their stretch types are set to relative to tallest object. Hth. edwin ;) Post edited by: redwine, at: 2007/07/25 15:55
  19. Greetings to all! I just wanted to post some observations I have made about frames that some of you may be interested to know about. I am also hoping that someone has some kind of a workaround for some of the issues that follow. iReport v 2.0 Issue #1: Rearranging the order of elements within a frame (from the Document Structure pane) causes other elements to be deleted. ACTIONS: Enclosed various elements within a frame. Created several groups of elements (some nested) within the frame. Tried to reorder the elements within a group using the move up or move down in the Document Structure pane. OBSERVATION: All, of the elements within the frames (except for the ones that were selected) disappear. Trying to undo the action will not bring back the elements. ** Try selecting an element in the attached file (aaa_070724.jrxml) and reorder it. Notice that the other elements, including the ones in the other frame, will be deleted and there will be no way of getting them back unless you immediately do a Revert to Last Saved. For some reason Send to Back and Send to Front work fine. Issue #2: Frames have a Stretch Type property but Relative To Tallest Object does not seem to work. ACTIONS: Grouped 2 frames with several stretching text field elements inside each of them. Set the Stretch Type to Relative To Tallest Object so that both frames will be of the same height. OBSERVATION: Both frames stretch to accommodate their respective contents but the two frames DON'T have equal heights. Issue #3: Frame contents don't appear in a generated PDF file if ordered in a certain way ACTIONS: Enclosed several elements within a frame. Reordered top level elements: frame element Sent to Back OBSERVATION: Elements are visible in iReports editor but do not appear in the generated PDF file. Position Type for the frame and its enclosed elements have also been set to Float. I will try to recreate the issues and post the file in this forum for more clarity. Thanks for any inputs you may have. Have a great day! edwin ;) Post edited by: redwine, at: 2007/07/24 20:19 [file name=aaa_070724-9dca67b0e5da0050d7399eb307f2157a.jrxml size=43627]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/aaa_070724-9dca67b0e5da0050d7399eb307f2157a.jrxml[/file] Post edited by: redwine, at: 2007/07/24 22:46
  20. for some reason while, i was editing this post, the system would not let me attach a file. Please click on this link to go to my revised post: http://www.jasperforge.org/index.php?option=com_joomlaboard&Itemid=215&func=view&catid=9&id=28445#28445 Post edited by: redwine, at: 2007/07/24 22:45 Post edited by: redwine, at: 2007/07/24 22:48
  21. aamir, sorry i was not able to reply sooner... i was on vacation. regarding your question about the invalid character error, the error may be caused by an unescaped separator character in the file path. i used two backslashes in my path. it has something to do with java regular expressions requiring double backslashes in the file path... the first one used as an escape character and the second one as the actual separator character. also note that linux (unix) and windows use different path separator characters. linux uses the forward slash character while windows uses the backslash character. hope this helps if you have not already found the answer to your question. edwin Post edited by: redwine, at: 2007/07/02 15:01
  22. Hi again! I need to know if anyone has been able to make the following style tag attributes function when styling individual text segments inside text elements: isBold='true' and isItalic='true' e.g. <style isBold='true' isItalic='true'>Enclosed text segment</style> ... where the expected outcome would be for the text "Enclosed text" to be both boldfaced and italicized when printed in PDF. Thanks to anyone who could give a bit of an insight on this issue. :) Edwin Post edited by: redwine, at: 2007/06/20 22:55
  23. Hi All! I have a question about element positioning. I need to find a way to position several rows of stretchable text fields (isStretchWithOverflow='true') to the bottom of the last page, just above the last page footer. I have tried placing these elements in both the page footer and the last page footer but the elements won't stretch if they are in either page footer. I have also tried setting positionType='fixRelativeToBottom' but it didn't work. Honestly, I don't yet know or for what that property is used for. ;) Will eventually need info on that too. One workaround I thought would work was to use static text elements. However, I need the elements to stretch. That didn't work either. There may be a way to accomplish this. I just need the help of anyone who has an idea on how to do this. Thanks! Edwin Post edited by: redwine, at: 2007/06/20 22:54
  24. if i understand correctly, i think that what you actually need to do is to ... construct the right query that will ... create a new table that will ... have columns representing the unique values from your ANAYSIS column which is in the table that you are currently getting data from. in short - reorginize data from your table. if this is what you want, i'm thinking that you may need to use subqueries (nested select statements) in your report query... that is if your data is being taken directly from a database using a report query. not the easiest thing to do (at least for me) but it's worth understanding how it works and learning how to do it. i haven't done this yet but i've seen this kind of sql query before... this means that your challenge has a solution. from what i remember, the query (similar to the one that you will need in your report template) produced several views or tables (possibly temporary) created from existing tables in some database. it would be great if someone who has more experience in creating complex sql queries would be kind enough to give us a walkthrough on how to go about this. at any rate, see if you could find out more about this... subqueries and all. :) edwin
  25. i just wanted to take this opportunity on my 100th post to thank the developers of both JasperReports and iReport for having created and for continuing to improve very useful tools for creating forms and reports. i, for one, understand that these are all works in progress and that a lot of features (requested) still need to be added. however, as with most software applications... "nothing is ever really finished and nothing is ever truly perfect... they, however, can be improved and made to accomplish more over time." with the hard work put in by committed developers and the cooperation and help of people who are willing to share their knowledge (and ask questions) through forums like this one, Jasper tools will most definitely continue to improve and accomplish more. more power to all!!! edwin B) Post edited by: redwine, at: 2007/06/19 16:07
×
×
  • Create New...