Defining classpath for calling java method in jrxml

12 Views Asked by At
package set.arey.com.wel.controller;

public class MaintainRecordReport{

    public static String attendedSessions(String assigned,String sessions)  {
        
        String finalSessions = "";
        String[] attendedSessions = sessions.split(",");
        
        for(String sess:attendedSessions) {
            String trimmedSession = sess.trim();
              if (assigned.contains("," + trimmedSession + ",")) {
                  finalSessions += "✓";
              }
              else {
                  finalSessions += "-";
              }
        }
        return finalSessions;
    }

}

I have the above code inside the package that is inside the /java

And, for the JRXML file, I have this:

<textFieldExpression><![CDATA[set.arey.com.wel.controller.MaintainRecordReport.attendedSessions($F{ASSIGNED_SESSIONS},$F{ATTENDED})]]></textFieldExpression>

But I have this error:

set.arey.com.wel.controller.MaintainRecordReport cannot be resolved to a type value = set.arey.com.wel.controller.MaintainRecordReport.attendedSessions(((java.lang.String)field_ASSIGNED_SESSIONS.getValue()),((java.lang.String)field_ATTENDED.getValue())); //$JR_EXPR_ID=13$

I've search and also asked gpt, and it suggests that it may be a classpath issue, but I don't know.

0

There are 0 best solutions below