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

augarte

Members
  • Posts

    270
  • 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 augarte

  1. Hi, I post and example. Maybe it would help you. In this case I load a number of JasperPrint objects, I create a list and then I export the list to pdf format. Hope this helps. Regards. Code: JRPdfExporter PdfExporter = new JRPdfExporter (); List jasperPrintList = new ArrayList (); for (int Inx = 0; Inx < NumJasperObjects; Inx ++) { jasperPrintList.add (JRLoader.loadObject ("Jasper"+Inx+".jasper")); } PdfExporter.setParameter (JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList); PdfExporter.setParameter (JRExporterParameter.OUTPUT_FILE_NAME, "MyReport.pdf"); PdfExporter.exportReport ();
  2. Hi, What do you want to do exactly? With your question I think you have two options. 1.- Use subreports to generate a jrxml file containing all the reports you want 2.- Having different jrxml files, create a JasperPrint object for each one and then create an output (pdf, xls, rtf...) including all the jasperPrint objects. Regards.
  3. Hi, I have a strange problem when printing some reports. The problem is that I can't reproduce it because it only happens sometimes to one of the users. The escenario is the following one: The user selects to print a report from our application. This action prints the jasperPrint object and generates the report in pdf format. The generated pdf is ok and the jasperPrint object too, but when sending it to the printer only a part of the jasperPrint object is printed. For example, I have a JasperPrint object with two pages, the first page is printed correctly but in the second one some content is missing. The method I use to print my object is the following one: JasperPrintManager.printReport (MyJasperPrint, false); It is really strange because I save my jasperPrint object and I view it with the JasperViewer and it is ok. I use the following method: JRSaver.saveObject (MyJasperPrint, FilNam); I know that the JasperPrintManager class has other methods to print my jasper objects but don't know if any of this methods will solve my problems. Another option is that the problem is with the machine/printer of this user because nobody else has reported me the same problem. Does anybody have a similar problem previously? Any idea of what could be happening? I'm a bit lost so any help will be really appreciated. Thanks in advance. Regards.
  4. Hi, I have modified your xml file cause the xml heading and "ReportBody" end tag were missing (maybe you forgot to copy them). So the xml will be like the one I have attached. I don't know which problem do you have with xPath expressions, but I think you need to create each field manually in iReport and then edit the description of each field. For example, for getting the expression of the column with the "deviceid" id, you will need to set the following description: ReportBody/BodyRow/BodyColumn[@id=deviceid]/text() And so on with the rest of the columns. You can use an xPath evaluator to test your expressions with any xml file before adding them to your report. I recommend you the following one: www.whitebeam.org/library/guide/TechNotes/xpathtestbed.rhtm Hope this helps. Regards.
  5. Hi sanbuddy, I don't know what you mean with "But dont know how to compile the jrxml to jasper in a easy way.. " If you want to compile your .jrxml file, you just have to do this: JasperReport Rep = JasperCompileManager.compileReport ("YouFile.jrxml"); Regards.
  6. Hi, I think your expression should be one of the followings: (($V{PeriodGroup_COUNT}.intValue() % 2 == 0) ? Boolean.TRUE : Boolean.FALSE) or ((Integer.valueOf($V{PeriodGroup_COUNT}) % 2 == 0) ? Boolean.TRUE : Boolean.FALSE) Hope this helps, Regards.
  7. Hi camilos, For achieving what you want, set the width and height of 1 pixel to your textfield and the check "Stretch With Overflow". This way, if your textfield is not printed, the blank space will be only 1 pixel. If any value has to be printed, the textfield will be resized depending on the content of your textfield. Hope this helps. Regards.
  8. Hi, After checking the jrxml file I see that the problem is that the parameter is not defined in your SubDataSet. If you define a new MyMainParameter in your subdataset you won't get this error any more. The problem you may have is that maybe it won't get the value it has in the Main dataset. I'm sure you need to define the parameter in the subdataset but I actually don't know how can you do it to take the same value it has in the main subdataset. Regards.
  9. Hi digifrancois, If you want to use parameters in your queries the notaton is the following: $P!{parameterName} So your query should be this one: select * from myTable where field1=$P!{MyMainParam} Depending on the data type of 'field1' you may need to use quotes: select * from myTable where field1='$P!{MyMainParam}' Hope this helps. Regards.
  10. Hi, Maybe it is not the best or 'cleanest' way for achieving what you want but I'l try the following. Edit the Default Value of your parameter and put: (' ') or 1 = 1 This will return all the records of your table. If you only want the ones that match with response you just have to put the next expression: ("Response") This way, if you don't set any value for your parameter in the prompt it will take the default value. Hope this helps, Regards.
  11. Hi, In my case, when I use a JRBeanCollection dataSource I have the following expression: new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{bfList}) Where the field bfList is an ArrayList of another class which is included in my Bean. I don't know exactly what does this mean: new ArrayList(Arrays.asList(new com.RangeObject("jj",8),new com.RangeObject("ll",8))) But I think you should pass the ArrayList in your main bean, then get this ArrayList as a field in your main report and finally set the datasource expression as I tell you in the beginning of this post. Hope this helps. Regards.
  12. Hi! For using the driver in iReport you need to go to "Tools-->Options-->Classpath" and add the correponding JAR file. Hope this helps. Regards.
  13. Hi Denis, In your iReport installation directory go to "etc" folder and in iReport.conf file you can increase the heap size. Hope this helps. Regards.
  14. Ok, Now I understand what you want to do but if you followed all the steps you mentioned in the first post it should work. I have tried exactly the same in the attached jrxml and works ok. The first field that I'm displaying is Cmp and if this field does not have a value or it is empty it does not occupy any space and the following field (Ide) is displayed below the static text. Check you have configured it correctly. Hope this helps. Regards, Aitor
  15. Hi, Not sure if I understood your problem well. What I understand is that you need to show your three fields in one line, but if some of the fields does not have any value you want to print the other two fields. Suposing that you have the following fields: $F{vat}, $F{net}, $F{total} I would add a TextField to the report and edit the Textfield expression to put it as follows: $F{vat} + ' ' + $F{net} + ' ' $F{total} This textfield will have the options 'Blank When Null' and 'Remove Line When Blank' checked. This way, the line will only be removed if the values of the three fields are null/empty. If I misunderstood your problem maybe you could attach your jrxml file to see what do you want to achieve. Hope this helps, Regards.
  16. Hi, I think the problem is that the maximum heap size is smaller than the size you need to launch your report. Check this out: http://stackoverflow.com/questions/37335/how-to-deal-with-java-lang-outofmemoryerror-java-heap-space-error-64mb-heap The error you have mentioned is previewing from iReport of launching the report from an external application? For iReport, this configuration is made in ireport.conf file, which is inside 'etc' directory in your iReport installation. In my case I have the following: default_options="--branding ireport -J-Xms256m -J-Xmx512m -J-Dorg.netbeans.ProxyClassLoader.level=1000 -J-XX:MaxPermSize=512m" In this case -Xms sets the initial size and -Xmx sets the maximum size: http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html#nonstandard If it doesn't work previewing it from iReport try to edit this file and setting a bigger heap space. If the problem is with an external applicaiton, just get the configuration of your iReport and try setting the same configuration for your application. Hope this helps, Regards.
  17. Hi, From the error I guess the problem is with your Xml Data Source. Why do you use a .tmp file? Shouldn't it be an xml file? It seems that the loaded document is null: The supplied org.w3c.dom.Document object is null: If you check the javadoc this interface is related to xml files so the problem happens when you try to load the tempfile.tmp file. Don't know if JRXmlDataSource supports another kind of file but I think it should be an xml file. Hope this helps. Regards.
  18. When you try to preview the report from iReport the message shows it as warning, but it is an error. When you compile the report (previewing it from iReport compiles the .jrxml file), if everything goes ok and without errors should create a .jasper file but as you can see this file is not created so basically is an error and not a warning. Maybe the message could be clearer, showing it as an error and not as a warning.
  19. Hi, The error says clearly what is happening in this case. You have an element in a band. The height of the element is 126, and the starting point is in the position y=85. So the end point of your element will be 211 (126+85). The height of your band is smaller so what is happening is that your element is outside the band. You have two options: 1) Change the initial position to be "y" smaller than 107 2) Modify the height of the band to be bigger than 211 If you don't understand it, just attach your jrxml file and I'll help you. Regards.
  20. If I understood well the only thing you have to do is to add the fields 3 times to your jrxml file the fields you want to be repeated in the report. I attach an example. Here you can see 5 different fields in the first line and other two fields that are repeated 3 times. Hope this helps. Regards.
  21. In my case the datasource expression is similar to yours. Here is the definition of the subreport: <subreport> <reportElement x="0" y="0" width="169" height="14" isPrintWhenDetailOverflows="true"/> <subreportParameter name="SUBREPORT_DIR"/> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{bfList})]]> </dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "RelNotBf.jasper"]]></subreportExpression> </subreport> I attach the jrxml file if you want to check something else. Hope this helps,Regards.
  22. Hi, I've added subreports to my main report using this kind of datasource. One modification I had to do was to put the following in the Data Source Expression, inside the subreport properties: new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{bfList}) In this case bfList is an ArrayList of an object that is defined in my Bean, which at the same time is the datasource from where the data of the subreport is gotten. Don't know if this will be usefull to solve your issue. Regards.
  23. And have you tried setting the pattern manually with quotes? Something like: ##.#0,00 Does this work?
  24. Hi, In the TextField properties you have an option to set the pattern for your number type fields. In this case you need to select the checkbox "Use 1000 separator" and select 2 decimal places as it is shown in the attached image. Hope this helps. Regards.
  25. Hi, I think use should put your parameters between quotes: select * from function_1('year','product','$P!{startdate}','$P!{enddate}') This way you can read the files you get from your query in the 'Report Query' and after add them to your iReport template. Another different thing is to have an option to introduce the values of the parameters when you preview the report. For doing this, you need to check the option 'Use as a prompt' for all your parameteres. Then you click the option 'Preview' and you'll be able to set values to the parameteres. Hope this helps. Regards.
×
×
  • Create New...