Package net.sf.jasperreports.engine

Examples of net.sf.jasperreports.engine.JRQueryChunk


      {
        Map parametersMap = dataset.getParametersMap();

        for(int j = 0; j < chunks.length; j++)
        {
          JRQueryChunk queryChunk = chunks[j];
          switch (queryChunk.getType())
          {
            case JRQueryChunk.TYPE_PARAMETER :
            {
              JRParameter parameter = (JRParameter)parametersMap.get(queryChunk.getText());
              if ( parameter == null )
              {
                addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
              }
              else if (queryExecuterFactory != null)
              {
                String parameterType = null;
                try
                {
                  parameterType = parameter.getValueClassName();
                }
                catch (JRRuntimeException e)
                {
                  // ignore, already added when the parameter got verified
                }
                if (parameterType != null && !queryExecuterFactory.supportsQueryParameterType(parameterType))
                {
                  addBrokenRule("Parameter type not supported in query : " + queryChunk.getText() + " class " + parameterType, query);
                }
              }

              break;
            }
            case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
            {
              if (!parametersMap.containsKey(queryChunk.getText()))
              {
                addBrokenRule("Query parameter not found : " + queryChunk.getText(), query);
              }
              break;
            }
            case JRQueryChunk.TYPE_TEXT :
            default :
View Full Code Here


      if (chunks != null && chunks.length > 0)
      {
        StringBuffer sbuffer = new StringBuffer();
        for(int i = 0; i < chunks.length; i++)
        {
          JRQueryChunk chunk = chunks[i];
          appendQueryChunk(sbuffer, chunk);
        }

        queryString = sbuffer.toString();
      }
View Full Code Here

    {
      StringBuffer sbuffer = new StringBuffer();

      for(int i = 0; i < chunks.length; i++)
      {
        JRQueryChunk queryChunk = chunks[i];
        switch(queryChunk.getType())
        {
          case JRQueryChunk.TYPE_PARAMETER :
          {
            sbuffer.append("$P{");
            sbuffer.append( queryChunk.getText() );
            sbuffer.append("}");
            break;
          }
          case JRQueryChunk.TYPE_PARAMETER_CLAUSE :
          {
            sbuffer.append("$P!{");
            sbuffer.append( queryChunk.getText() );
            sbuffer.append("}");
            break;
          }
          case JRQueryChunk.TYPE_CLAUSE_TOKENS :
          {
            sbuffer.append("$X{");
            sbuffer.append(queryChunk.getText());
            sbuffer.append("}");
            break;
          }
          case JRQueryChunk.TYPE_TEXT :
          default :
          {
            sbuffer.append( queryChunk.getText() );
            break;
          }
        }
      }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.engine.JRQueryChunk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.