title: Converting Numbers to Local (UTF8) Bengali numbers in JasperReports & MySQL
body: <p>I am trying to convert the English numbers to Bengali numbers before filling the report. The data i am getting from MySQL:</p>
  
  <pre><code>SELECT brand.id,brand.brand,model.model FROM brand INNER JOIN model ON brand.id=model.id AND model.id=$P{ID}
  </code></pre>
  
  <p>For example if model.model columns return a number 322 then it should first convert the number to Bengali version(৩২২) and then it will fill the report.Something like this:</p>
  
  <p>One | two | Three
  ১   |  ২   |   ৩</p>
  
  <p>Here is the 0-9 in Bengali:</p>
  
  <p>০ ১ ২ ৩ ৪ ৫ ৬ ৭ ৮ ৯</p>
  
  <p>I was thinking about replace method as follows:</p>
  
  <pre><code>char[] en ={'0','1','2','3','4','5','6','7','8','9'};
  char[] bn ={'০','১','২','৩','৪','৫','৬','৭','৮','৯'};
  en.replace(bn)
  </code></pre>
  
  <p>Perhaps it won't work!</p>
  
  <p>I am just not sure where to start ! But here is my current Application Codes:</p>
  
  <p>The Java Code:</p>
  
  <pre><code>@FXML
  public TextField one;
  
  public void click(ActionEvent event) throws JRException, SQLException, ClassNotFoundException, IllegalAccessException, UnsupportedLookAndFeelException, InstantiationException {
      String reportSrcFile = "/home/sample/learn.jrxml";
  
      JasperReport jasperReport1 = JasperCompileManager.compileReport(reportSrcFile);
  
      Connection conn = SqliConnect.getMySQLConnection();
      int two = Integer.parseInt(one.getText());
      Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
      parameters.put("ID",one.getText());
  
      JasperPrint print = JasperFillManager.fillReport(jasperReport1,
              parameters, conn);
  
      JasperViewer jv = new JasperViewer(print);
      jv.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      jv.setTitle("Test Report");
  
      jv.setVisible(true);
  }
  </code></pre>
  
  <p>Report's template:</p>
  
  <pre><code>&lt;subDataset name="Dataset1" uuid="2691431f-5c6f-403f-94cc-829c17ef1636"&gt;
      &lt;property name="com.jaspersoft.studio.data.sql.tables" value=""/&gt;
      &lt;property name="com.jaspersoft.studio.data.defaultdataadapter" value="Learn"/&gt;
      &lt;parameter name="ID" class="java.lang.Integer"&gt;
          &lt;parameterDescription&gt;&lt;![CDATA[Get ID]]&gt;&lt;/parameterDescription&gt;
          &lt;defaultValueExpression&gt;&lt;![CDATA[$P{ID}]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;queryString&gt;
          &lt;![CDATA[SELECT brand.id,brand.brand,model.model FROM brand INNER JOIN model ON brand.id=model.id WHERE model.id=$P{ID}]]&gt;
      &lt;/queryString&gt;
      &lt;field name="id" class="java.lang.Integer"/&gt;
      &lt;field name="brand" class="java.lang.String"/&gt;
      &lt;field name="model" class="java.lang.String"/&gt;
  &lt;/subDataset&gt;
  &lt;parameter name="ID" class="java.lang.Integer" isForPrompting="false"&gt;
      &lt;parameterDescription&gt;&lt;![CDATA[]]&gt;&lt;/parameterDescription&gt;
      &lt;defaultValueExpression&gt;&lt;![CDATA[$P{ID}]]&gt;&lt;/defaultValueExpression&gt;
  &lt;/parameter&gt;
  &lt;queryString&gt;
      &lt;![CDATA[SELECT brand.id,brand.brand,model.model FROM brand INNER JOIN model ON brand.id=model.id WHERE model.id=$P{ID}]]&gt;
  &lt;/queryString&gt;
  &lt;field name="id" class="java.lang.Integer"/&gt;
  &lt;field name="brand" class="java.lang.String"/&gt;
  &lt;field name="model" class="java.lang.String"/&gt;
  &lt;title&gt;
      &lt;band height="79" splitType="Stretch"&gt;
          &lt;textField&gt;
              &lt;reportElement x="11" y="16" width="100" height="30" uuid="d1485589-a4cf-4ab9-b896-0ef480beced4"/&gt;
              &lt;textFieldExpression&gt;&lt;![CDATA[$P{ID}]]&gt;&lt;/textFieldExpression&gt;
          &lt;/textField&gt;
      &lt;/band&gt;
  &lt;/title&gt;
  &lt;detail&gt;
      &lt;band height="250" splitType="Stretch"&gt;
          &lt;componentElement&gt;
              &lt;reportElement x="0" y="0" width="555" height="250" uuid="e199bd58-8408-4711-85d5-ba76db9691b7"&gt;
                  &lt;property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/&gt;
                  &lt;property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/&gt;
                  &lt;property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/&gt;
                  &lt;property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/&gt;
                  &lt;property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/&gt;
              &lt;/reportElement&gt;
              &lt;jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"&gt;
                  &lt;datasetRun subDataset="Dataset1" uuid="fbb4dafa-4284-4118-9d2b-46d88c63a31b"&gt;
                      &lt;datasetParameter name="ID"&gt;
                          &lt;datasetParameterExpression&gt;&lt;![CDATA[$P{ID}]]&gt;&lt;/datasetParameterExpression&gt;
                      &lt;/datasetParameter&gt;
                      &lt;connectionExpression&gt;&lt;![CDATA[$P{REPORT_CONNECTION}]]&gt;&lt;/connectionExpression&gt;
                  &lt;/datasetRun&gt;
                  &lt;jr:column width="185" uuid="9a6b765f-b6d4-4753-909e-dd091b296654"&gt;
                      &lt;jr:columnHeader style="Table_CH" height="30"&gt;
                          &lt;staticText&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="7e644d1c-a893-49df-a18a-bf788eb6b92a"/&gt;
                              &lt;text&gt;&lt;![CDATA[id]]&gt;&lt;/text&gt;
                          &lt;/staticText&gt;
                      &lt;/jr:columnHeader&gt;
                      &lt;jr:columnFooter style="Table_CH" height="30"/&gt;
                      &lt;jr:detailCell style="Table_TD" height="30"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="848a53bf-2b2e-46df-a7aa-26fc0b897c85"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$F{id}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/jr:detailCell&gt;
                  &lt;/jr:column&gt;
                  &lt;jr:column width="185" uuid="514580a5-f09c-43d1-952e-d4769c2e4686"&gt;
                      &lt;jr:columnHeader style="Table_CH" height="30"&gt;
                          &lt;staticText&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="c01152e9-1547-472b-946e-92011c02bc94"/&gt;
                              &lt;text&gt;&lt;![CDATA[brand]]&gt;&lt;/text&gt;
                          &lt;/staticText&gt;
                      &lt;/jr:columnHeader&gt;
                      &lt;jr:columnFooter style="Table_CH" height="30"/&gt;
                      &lt;jr:detailCell style="Table_TD" height="30"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="98c84ae5-b289-459a-b34b-a9becf43b9ce"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$F{brand}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/jr:detailCell&gt;
                  &lt;/jr:column&gt;
                  &lt;jr:column width="185" uuid="5c1d2026-45bc-4ec8-8be4-c444e47d093d"&gt;
                      &lt;jr:columnHeader style="Table_CH" height="30"&gt;
                          &lt;staticText&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="81f76de4-a68b-41c3-a2e8-bbaa625b71be"/&gt;
                              &lt;text&gt;&lt;![CDATA[model]]&gt;&lt;/text&gt;
                          &lt;/staticText&gt;
                      &lt;/jr:columnHeader&gt;
                      &lt;jr:columnFooter style="Table_CH" height="30"/&gt;
                      &lt;jr:detailCell style="Table_TD" height="30"&gt;
                          &lt;textField&gt;
                              &lt;reportElement x="0" y="0" width="185" height="30" uuid="d69c690e-05a4-453a-93ea-9061523975ad"/&gt;
                              &lt;textFieldExpression&gt;&lt;![CDATA[$F{model}]]&gt;&lt;/textFieldExpression&gt;
                          &lt;/textField&gt;
                      &lt;/jr:detailCell&gt;
                  &lt;/jr:column&gt;
              &lt;/jr:table&gt;
          &lt;/componentElement&gt;
      &lt;/band&gt;
  &lt;/detail&gt;
  </code></pre>
  
  <p>What is the Right way to do it?</p>