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

upanshuvaid

Members
  • Posts

    4
  • Joined

  • Last visited

upanshuvaid's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi The fields are not decided at report template creation time below is the requirment that is to be acomplished 1- if report has 2 fields than it should print like field1 field2 2-if report has 3 fields than it should print like field1 field2 field3 3- if n number of fields than it should print like field1 field2 field3 field4 fieldn that to in horizontal direction. Thanks
  2. Hi , I have a below scenario 1- I have a main report where i have multiple subreports say 4 which are defined in individual detail band . 2- Each subreport is itself might repeat . 3- for example if i have subreport 1 ,subreport 2,subreport 3 ,subreport 4 4- if subreport 1 have 5 page than page number should print from 1-5 and than subreport 3 have 6 page than page numbers should print from 6-11 . 5- if subreport 2 have 4 pages than page numbers should print from 1-4 and than subreport 3 have 10 pages than page number should print from 5-14. 6- each subreport is having title band where i have to show page numbers. kindly help on this to achive this.
  3. Hi Swood_1, Thanks for your revert but the section is getting repeated after making the changes you suggested. i have highlighted the section that is getting repeated.kindly help on this.
  4. Hi , i have the below scenario for generating reports 1- i have a main report in which multiple subreports say 4 are there in which sub reports might also repeat. 2- i have subreport 1 for which jasper print object is getting added to main jasper print object beacuse i have many fields,subreport parmeters which i have declared in main report and using and passing subreport. 3- when subreport 2 jasper print object is created it is also adding subreport 1 jasper print object due to which subreport 1 is getting printed in subreport 2 . 3- suppose i have 3 subreport 2 jasper print object than subreport 1 jasper print object is also getting printed in all 3 jasper print objects of subreport 2 . 4- kindly help on this.a JRXML <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Jaspersoft Studio version 6.4.3.final using JasperReports Library version 6.4.3 --> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RR9JP" pageWidth="1650" pageHeight="1600" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="99cc5eb4-f46a-4184-ab53-bce2e823f28f"> <parameter name="subReportPath" class="java.lang.String"/> <parameter name="addMbr" class="java.lang.String"/> <parameter name="trmMbr" class="java.lang.String"/> <parameter name="updMbr" class="java.lang.String"/> <parameter name="mierpfMbrCount" class="java.lang.String"/> <parameter name="trmMbrCount" class="java.lang.String"/> <parameter name="addMbrCount" class="java.lang.String"/> <parameter name="updMbrCount" class="java.lang.String"/> <parameter name="rr9JPMierpf" class="java.lang.String"/> <parameter name="pagNumb" class="java.lang.Integer"/> <queryString> <![CDATA[]]> </queryString> <field name="addMbrList" class="java.util.List"/> <field name="mierpfList" class="java.util.List"/> <field name="trmMbrList" class="java.util.List"/> <field name="updMbrList" class="java.util.List"/> <background> <band splitType="Stretch"/> </background> <detail> <band height="80" splitType="Stretch"> <printWhenExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()==1)]]></printWhenExpression> <subreport isUsingCache="false" runToBottom="false"> <reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="10" width="1600" height="60" isRemoveLineWhenBlank="true" uuid="f24ce61b-0bc8-4441-a8b2-0a997cb58b0d"> <printWhenExpression><![CDATA[$P{addMbr}.equals( "addMbr")]]></printWhenExpression> </reportElement> <subreportParameter name="addMbrCount"> <subreportParameterExpression><![CDATA[$P{addMbrCount}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="pageNumber"> <subreportParameterExpression><![CDATA[$P{pagNumb}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{addMbrList})]]></dataSourceExpression> <subreportExpression><![CDATA[$P{subReportPath} + "RR9JPAddMbr.jasper"]]></subreportExpression> </subreport> </band> <band height="80" splitType="Stretch"> <printWhenExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()==1)]]></printWhenExpression> <subreport isUsingCache="false" runToBottom="false"> <reportElement positionType="Float" isPrintRepeatedValues="false" x="0" y="10" width="1600" height="60" isRemoveLineWhenBlank="true" uuid="ea728c97-c131-4c62-b9e1-9dacc9d27059"> <printWhenExpression><![CDATA[$P{trmMbr}.equals( "trmMbr" )]]></printWhenExpression> </reportElement> <subreportParameter name="trmMbrCount"> <subreportParameterExpression><![CDATA[$P{trmMbrCount}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="pageNumber"> <subreportParameterExpression><![CDATA[$P{pagNumb}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{trmMbrList})]]></dataSourceExpression> <subreportExpression><![CDATA[$P{subReportPath} + "RR9JPTrmMbr.jasper"]]></subreportExpression> </subreport> </band> <band height="80" splitType="Stretch"> <printWhenExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()==1)]]></printWhenExpression> <subreport isUsingCache="false" runToBottom="false"> <reportElement positionType="Float" isPrintRepeatedValues="false" x="5" y="10" width="1600" height="60" isRemoveLineWhenBlank="true" uuid="b974e1ac-44cc-46ab-845f-12d44fc948dd"> <printWhenExpression><![CDATA[$P{updMbr}.equals( "updMbr" )]]></printWhenExpression> </reportElement> <subreportParameter name="updMbrCount"> <subreportParameterExpression><![CDATA[$P{updMbrCount}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="pageNumber"> <subreportParameterExpression><![CDATA[$P{pagNumb}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{updMbrList})]]></dataSourceExpression> <subreportExpression><![CDATA[$P{subReportPath} + "RR9JPUpdMbr.jasper"]]></subreportExpression> </subreport> </band> <band height="80" splitType="Stretch"> <printWhenExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()==1)]]></printWhenExpression> <subreport isUsingCache="false" runToBottom="false" overflowType="Stretch"> <reportElement positionType="Float" isPrintRepeatedValues="false" x="10" y="10" width="1600" height="60" isRemoveLineWhenBlank="true" uuid="b974e1ac-44cc-46ab-845f-12d44fc948dd"> <printWhenExpression><![CDATA[$P{rr9JPMierpf}.equals( "ermbr" )]]></printWhenExpression> </reportElement> <subreportParameter name="mierpfMbrCount"> <subreportParameterExpression><![CDATA[$P{mierpfMbrCount}]]></subreportParameterExpression> </subreportParameter> <subreportParameter name="pageNumber"> <subreportParameterExpression><![CDATA[$P{pagNumb}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{mierpfList})]]></dataSourceExpression> <subreportExpression><![CDATA[$P{subReportPath} + "RR9JPErrorSubReport.jasper"]]></subreportExpression> </subreport> </band> </detail> </jasperReport> Java file code exporter.setExporterInput(SimpleExporterInput.getInstance(jasperPrintList)); exporter.setExporterOutput(new SimpleOutputStreamExporterOutput(IntegralSbReportConfig.getReportOutputPath() + reportOutputName + ".pdf")); configuration.setCreatingBatchModeBookmarks(true); exporter.setConfiguration(configuration); exporter.exportReport(); private static void rr9JPError(Map<String, Object> dataMap, List<RR9JPMierpf> mierpfList, String reportTempleteName, List<JasperPrint> jasperPrintList, List<RR9JPProcessDetail> addMbrProcessDetailList, RR9JPProcessDetail rr9JPPD, Integer pageNumber) throws JRException { Map<Object, List<RR9JPMierpf>> grouped = mierpfList.stream() .collect(Collectors.groupingBy( s -> s.getPolicyNum())); Collection<List<RR9JPMierpf>> sublists = grouped.values(); List<List<RR9JPMierpf>> errorSubLists = new ArrayList<List<RR9JPMierpf>>(grouped.values()); errorSubLists.sort((l1,l2)->l1.get(0).getPolicyNum().compareTo(l2.get(0).getPolicyNum())); for(int i=0;i<sublists.size();i++) { rr9JPPD.setMierpfList(new ArrayList<RR9JPMierpf>()); for(RR9JPMierpf mierpf:errorSubLists.get(i)) { rr9JPPD.getMierpfList().add(mierpf); } if(rr9JPPD.getMierpfList().size()>0) { addMbrProcessDetailList.add(rr9JPPD); String mierpfMbrCount =String.format("%06d", rr9JPPD.getMierpfList().size()); ++pageNumber; dataMap.put("mierpfMbrCount",mierpfMbrCount); dataMap.put(PAGE_NUMBER,pageNumber); JRBeanCollectionDataSource erorMbrDataSource = new JRBeanCollectionDataSource(addMbrProcessDetailList); JasperFillManager.fillReportToFile(IntegralSbReportConfig.getReporTemplatePath() + reportTempleteName + EXTN, dataMap,erorMbrDataSource); jasperPrintList.add((JasperPrint)JRLoader.loadObjectFromFile(IntegralSbReportConfig.getReporTemplatePath()+ reportTempleteName+".jrprint")); } } }
×
×
  • Create New...