1

The code of my servlet:

JasperCompileManager.compileReportToFile(jrxmlSourcePathMain,
                    jrxmlDestPathMain);

InputStream isRef = new FileInputStream(new File(jrxmlDestPathMain));

ServletOutputStream sosRef = response.getOutputStream();
response.setContentType("application/pdf");
JasperRunManager.runReportToPdfStream(isRef, sosRef, new HashMap(),
        new JRBeanCollectionDataSource(buyBookInfoList));
sosRef.flush();
sosRef.close();

The snippet of jrxml file:

<summary>
    <band height="265" splitType="Stretch">
        <pieChart>
            <chart isShowLegend="true" renderType="svg" theme="default">
                <reportElement uuid="c6a09cc9-bd15-4b09-8657-05868a148f18" x="0" y="0" width="554" height="265"/>
                <chartTitle position="Top" color="#FF0000">
                    <font fontName="宋体" size="18" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
                    <titleExpression><![CDATA["报表演示"]]></titleExpression>
                </chartTitle>
                <chartSubtitle color="#0000FF">
                    <font fontName="宋体" size="14" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
                    <subtitleExpression><![CDATA["子标题"]]></subtitleExpression>
                </chartSubtitle>
                <chartLegend textColor="#33FF33" backgroundColor="#6666FF" position="Right">
                    <font size="12" pdfFontName="STSong-Light" pdfEncoding="UniGB-UCS2-H" isPdfEmbedded="true"/>
                </chartLegend>
            </chart>
            <pieDataset>
                <keyExpression><![CDATA[$F{username}]]></keyExpression>
                <valueExpression><![CDATA[$F{buyBookNum}]]></valueExpression>
            </pieDataset>
            <piePlot isShowLabels="true" isCircular="false" labelFormat="姓名为:{0}">
                <plot orientation="Horizontal" labelRotation="180.0"/>
                <itemLabel/>
            </piePlot>
        </pieChart>
    </band>
</summary>

I set Increment Type property for PieChart value with different values: none, report, page. But I did not notice any difference in generated reports.

So my question is how to use the PieChart's Increment Type property?

What is a purpose of this property?

Alex K
  • 22,315
  • 19
  • 108
  • 236
Gaohongyan
  • 293
  • 1
  • 3
  • 9

1 Answers1

0

The increment type allows you to tell the pie chart when to select values to use. For example, if you want to create a pie chart that shows sales in the USA, Canada, and Mexico, you might increment over a "country" group.

Lisa
  • 1,331
  • 1
  • 15
  • 27
  • thank you lisa ! "increment type " value is "group" how use it me know, i don't know how use other value .i use it no effect .please help me thank much! – Gaohongyan Sep 05 '12 at 23:03
  • Hi, Gaohongyan -- next to the "Increment Type" drop-down box, where you selected "Group", you can choose the group on which to increment. If you don't have groups in your report, you won't have any to choose from. To add a group, right-click on the top-level of your report in the Report Inspector and select "Add Report Group". – Lisa Sep 06 '12 at 12:14
  • @Gaohongyan if this answer fixes your problem, please award it the green tick so that your question is removed from the unanswered questions list. If there is still something unresolved, please give feedback to Lisa so that she may edit her answer to address the remaining issue(s). – mickmackusa Mar 23 '17 at 23:34