2013-07-03 7 views
0

ireport-4.5.0, jasper-reports-4.5.0을 사용 중입니다. 열 머리글에 테두리를 추가하려고합니다. 내가 찾은 인터넷 검색 중 우리는 사각형을 사용하여 테두리를 가져올 수 있습니다. 사각형을 사용했지만 border.Below를 얻지 못했습니다. 사용중인 코드입니다.사각형을 사용하여 내 보고서 열 머리글 테두리를 얻는 방법

<columnHeader> 
     <band height="39" splitType="Stretch"> 
      <rectangle> 
       <reportElement x="131" y="0" width="424" height="39"/> 
      </rectangle> 
      <rectangle> 
       <reportElement x="0" y="1" width="131" height="38"/> 
      </rectangle> 
      <staticText> 
       <reportElement x="11" y="16" width="108" height="14"/> 
       <textElement> 
        <font size="12" isBold="true"/> 
       </textElement> 
       <text><![CDATA[Business Name]]></text> 
      </staticText> 
      <staticText> 
       <reportElement x="154" y="10" width="361" height="20"/> 
       <textElement textAlignment="Center"> 
        <font size="12" isBold="true"/> 
       </textElement> 
       <text><![CDATA[Sales Report]]></text> 
      </staticText> 
     </band> 
    </columnHeader> 

실수를 저지르는 정확한 방향으로 어떤 사람이 나를 가리킬 수 있습니까?

감사의 말 전진.

+1

당신은 [JasperReports를에서 표 테두리 추가]를 볼 수 있습니다 (http://stackoverflow.com/q/10278067/876298) –

+0

안녕 알렉스를 게시, I Padding And Borders를 사용하고 싶지 않습니다. Rectangle 만 사용해야합니다. 원래 질문을 편집했습니다. – NSS

+0

Bcoz 하위 보고서에 테두리를 추가해야합니다. 하위 보고서의 채우기 및 테두리가없는 것 같습니다. 그래서 사각형 만 사용해야합니다. – NSS

답변

2

문제는 직사각형이 필드보다 약간 클 필요가 있다는 것입니다. 레이어를 생각하면 텍스트 상자가 직사각형 위에 오게되어 직사각형을 볼 수없는 것입니다. 테두리를 사용하면 훨씬 효과적입니다. 개체를 마우스 오른쪽 버튼으로 클릭하고 "채우기 및 테두리"로 이동하십시오.

<columnHeader> 
    <band height="20" splitType="Stretch"> 
     <staticText> 
      <box> 
       <pen lineWidth="0.5"/> 
       <topPen lineWidth="0.5"/> 
       <leftPen lineWidth="0.5"/> 
       <bottomPen lineWidth="0.5"/> 
       <rightPen lineWidth="0.5"/> 
      </box> 
      <textElement> 
       <font size="12" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Business Name]]></text> 
     </staticText> 
     <staticText> 
      <box> 
       <pen lineWidth="0.5"/> 
       <topPen lineWidth="0.5"/> 
       <leftPen lineWidth="0.5"/> 
       <bottomPen lineWidth="0.5"/> 
       <rightPen lineWidth="0.5"/> 
      </box> 
      <textElement textAlignment="Center"> 
       <font size="12" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Sales Report]]></text> 
     </staticText> 
    </band> 
</columnHeader> 
+0

안녕 Mnoland.I Padding And Borders를 사용하고 싶지 않습니다. Rectangle Only를 사용해야합니다. 나는 Rectangle 크기보다 큰 필드를 사용하여 시도했습니다.하지만 여전히 경계선을 얻지 못했습니다. 원본을 편집했습니다. 질문을 할 수 있습니다. plz보세요. 고맙습니다. – NSS

0

고정 텍스트 필드마다 두 개의 사각형을 사용하십시오. 이 시도하지만 난 단지 중심 텍스트를 위해 한 -

<columnHeader> 
    <band height="39" splitType="Stretch"> 
     <rectangle> 
      <reportElement x="131" y="0" width="424" height="39" backcolor="#FF6666"/> 
     </rectangle> 
     <rectangle> 
      <reportElement x="134" y="3" width="419" height="31"/> 
     </rectangle> 
     <staticText> 
      <reportElement x="154" y="10" width="361" height="20"/> 
      <textElement textAlignment="Center"> 
       <font size="12" isBold="true"/> 
      </textElement> 
      <text><![CDATA[Sales Report]]></text> 
     </staticText> 
    </band> 
</columnHeader>