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

CharleyDC5

Members
  • Posts

    43
  • Joined

  • Last visited

CharleyDC5's Achievements

Enthusiast

Enthusiast (6/14)

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

Recent Badges

0

Reputation

  1. Hi folks, I am experiencing a problem using multiple detail bands feature. The problem is that what I generate the preview, none of the detail bands are splitting. The report is like 3 pages long in reality, but appears as one page. If I print the report, the printer will print only one portion of the report. I need to adjust the font size in order to see the entire report, resulting in a almost unreadable report because of the smaller font size. Some detail bands have subreports. All detail bands (including the master and the subreports) are set to "Stretch" regarding the "Split Type" property. I have also tried "Immediate" but it doesn't solve the problem. The only workaround I've found is to add some manual page breaks here and there in order to make it really break in the PDF. Othersize, I'm always getting one huge page. My master report needs to be LEGAL US format. Any idea? Thank you Charles iReport 4.1.1
  2. Code:<subreport isUsingCache="true"> <reportElement positionType="Float" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="206" width="572" height="38" isRemoveLineWhenBlank="true"/> <subreportParameter name="intActionTypeId"> <subreportParameterExpression><![CDATA[2]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strHeader"> <subreportParameterExpression><![CDATA[( $P{strLangue}.equals("fr") ? "AUTRES" : "OTHERS" )]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strLangue"> <subreportParameterExpression><![CDATA[$P{strLangue}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="intVisiteBordId"> <subreportParameterExpression><![CDATA[$P{intVisiteBordId}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "visiteBordPrint_Action.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="true"> <reportElement positionType="Float" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="156" width="572" height="38" isRemoveLineWhenBlank="true"/> <subreportParameter name="intActionTypeId"> <subreportParameterExpression><![CDATA[1]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strHeader"> <subreportParameterExpression><![CDATA[( $P{strLangue}.equals("fr") ? "ARRIVÉE" : "DÉPART" )]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strLangue"> <subreportParameterExpression><![CDATA[$P{strLangue}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="intVisiteBordId"> <subreportParameterExpression><![CDATA[$P{intVisiteBordId}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "visiteBordPrint_Action.jasper"]]></subreportExpression> </subreport> <subreport isUsingCache="true"> <reportElement positionType="Float" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="257" width="572" height="38" isRemoveLineWhenBlank="true"/> <subreportParameter name="intActionTypeId"> <subreportParameterExpression><![CDATA[3]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strHeader"> <subreportParameterExpression><![CDATA[( $P{strLangue}.equals("fr") ? "DÉPART" : "DEPARTURE" )]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="strLangue"> <subreportParameterExpression><![CDATA[$P{strLangue}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="intVisiteBordId"> <subreportParameterExpression><![CDATA[$P{intVisiteBordId}]]></subreportParameterExpression> </subreportParameter> <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "visiteBordPrint_Action.jasper"]]></subreportExpression> </subreport>
  3. After review, the problem comes from the third subreport. If I remove it, the report generates in a second or so. I don't understand why it acts like that as this is the same subreport that is called three times with a different parameter. I have also tested the subreport alone and it works perfectly. See new post for the XML code.
  4. Hi folks I have a quite simple report with three subreports in it. When I click the Preview button, it takes FOREVER. The task never ends. I can see the loading animation at the bottom right of the screen saying "Generating report". All reports (JRXML) compiles without any problem. The problem is not my PostgreSQL, it is really iReport that has problem loading the preview. Any idea? Is there any kind of log where I could find additional information regarding that problem? I am using iReport 4.1.1 Thank you Charles
  5. Hi there, Is the a shortcut in iReport that would send an expression to lower case (in XML mode), just like in Word or any kind of text program? I got a ton of reports to modify because of the migration to PostgreSQL (that use lower case for fields expression). Thank you!
  6. Hi folks, I am having a quite strange problem.. My Web application offers three output format for a specific report : PDF, Excel (JRXlsExporter) and RTF(JRRtfExporter). My report has a crosstab in it with 4 row groups and 1 column group. When attempting to export to XLS using the JRXlsExporter, all text fields of the third row group shows as blank. If I export to PDF or RTF, the text fields ARE there. I compared the text field configuration with the other column groups and they are all the same. Any idea? Thanks Charles
  7. Hi folks, I would like to add some specific non-group information in a crosstab but can't find a way to meet my requirements. The first attachment (basic.jpg) shows the basic crosstab created by iReport, based on the following settings : Row group (blue cells): $F{fileNumber} Column group (yellow cells): $F{service Type} Data (gray cells): $F{fileId} (function is SUM) The second attachment (before.jpg) shows what I see when trying to display the information I want using measure, variable or fields. It just always return null. Finally, the third one (expected.jpg) represents what I would like to see. Any idea? Thank you Charles Post Edited by CharleyDC5 at 02/24/2011 17:40
  8. Hi guys, Is it possible to hide the border of labels and legends in iReport without having to create a custom chart theme? If not, I just can't find a way to hide the borders using the chart theme editor. I know this is feasable as the aegean built in theme has no borders. Thanks Charles
  9. Just found the solution myself. I had to play with the Label Format by entering the following {0] ({2}) expression in order to have the following result : Second (45%) Thanks Charles
  10. Hi folks, Is it possible to show the percentages in a pie chart? If yes, how? Thank you Charles
  11. Good morning guys, I would like to know if it is possible to change the rowset orientation in a dataset? By default, the detail band data is printed like that : - Row #1 - Row #2 - Row #3 - Row #4 - Row #5 etc... I would like to change the orientation so the detail band would print like this : - Row #1 Row #2 Row #3 Row #4 Row #5 Is it possible? Any thoughts or advice? Thanks Charles
  12. Thanks for the info! Is it possible to have a Collection inside the CustomBean? How would Jasperreports/iReport deal with it for grouping? For instance : public class AbsenceCustomBean { private String date; private String phonenumber; private String description; private Collection updates; public AbsenceCustomBean(String date, String phonenumber, String description, Collection updates) { date= date; phonenumber = phonenumber; description = description; updates = updates; } Every instance of the AbsenceCustomBean may have 1 or more updates (1-N relationship). So, I would like to print something similar to that : 2010-10-12 888.999.3333 Off sick Updated by USR111 Updated by USR333 Updated by USR222 Updated by USR111 2010-10-13 777.333.2222 Business travel to Toronto Updated by USR999 Updated by USR048 Updated by USR982 etc.. etc.. Other questions : - Did you create the fields manually in iReport or you added the application's JAR file into the iReport classpath? - Would it be possible to use full Java object code in the JRXML report? I mean, instead of creating a manual factory class that represents a row in my report, can I write some pure Java just like in Eclipse? I.E. : Absence.getUpdates().getStrUpdaterLoginName() in order to print USR999. Thank you very much for help Charles
  13. Hi folks, I am actually using IBM DB2 UDFs (User Defined Functions) as a datasource for all my reports. I use iReport as my report designer and JasperReports as my report engine. I would like to stop having to mess with DB2 UDFs for my reporting needs. Reports are getting launched from a J2EE web application. I am looking for a way to pass a Collection of objects to my report so I could re-use some of my listing methods that feeds the Web application itself. For example, I have a Cars Management screen that allows the user to list, add, update, delete and view cars. In the list screen, the user can list the cars by using a filter (let's say : Brand). So, I can list all Honda car by selecting Honda as my Brand filter. All the results are printed dynamically in the web application (DB2 to EJB to Struts to JSP/HTML). Now, let's say I have a button in that list screen that allows the user to generate a PDF report (better presentation). Here is my problem. Right now, the report is getting launched without a problem, but I have to use a UDF in order to get a resultset for my report. I would really like to use the same method that I used in the Cars list screen as it is the same content. Attached is how I actually generate my reports. Can I pass my Collection of Cars value objects to my report? Here is what I use : - Persistence framework : EJB 2.0 - MVC (Model View Controller) framework: Struts 1.2.9 - Report designer : iReport 3.7.1 - Report engine : JasperReports 3.7.1 - Application server : jBoss 4.0.4GA - DBMS (Database Management System) : IBM DB2 UDB 9.5 Workgroup Edition Thank you VERY much for help. Charles Code:public ActionForward showCarsRpt(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ParseException, SQLException { ServletContext context = servlet.getServletConfig().getServletContext(); CarRptFilterForm carRptFilterForm = (CarRptFilterForm) form; reportFile = new File(context.getRealPath("/reports/car/cars.jasper")); if (!reportFile.exists()) { throw new JRRuntimeException("File car.jasper not found. The report design must be compiled first."); } Map parameters = new HashMap(); parameters.put("ReportTitle", "Car Report"); parameters.put("BaseDir", reportFile.getParent() + "\\"); parameters.put("REPORT_LOCALE", request.getSession().getAttribute("org.apache.struts.action.LOCALE")); parameters.put("strLang", getLocale(request).getLanguage()); parameters.put("intBrandId", Integer.valueOf(carRptFilterForm.getStrCentreCoutId())); Connection con = null; try { InitialContext ctx = new InitialContext(); DataSource ds = (DataSource) ctx.lookup("java:/myDataSource"); con = ds.getConnection(); con.setReadOnly(true); } catch (Exception e) { e.printStackTrace(); } try { ReportTools.exportReportToPDF(reportFile, parameters, con, response); } catch (JRException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { con.close(); } return null; }public static void exportReportToPDF(File reportFile, Map parameters, Connection con, HttpServletResponse response) throws JRException, SQLException { File destFile = new File(JasperRunManager.runReportToPdfFile(reportFile.getPath(), parameters, con)); con.close(); response.setContentType("application/pdf"); response.setHeader("Content-Disposition", "attachment; filename=\"" + destFile.getName() + "\";)"); java.io.FileInputStream fileInputStream = null; try { fileInputStream = new java.io.FileInputStream(destFile.getPath()); } catch (FileNotFoundException e) { e.printStackTrace(); } try { ServletOutputStream outputStream; int i; outputStream = response.getOutputStream(); while ((i = fileInputStream.read()) != -1) { outputStream.write(i); } outputStream.flush(); fileInputStream.close(); outputStream.close(); } catch (IOException e) { } }
×
×
  • Create New...