You can create a custom HTML file using the FileWriter class of Java.
You can add everything you want in the report into an array with each step execution.
At the end of the test, you can write all the data gathered within the array into the HTML file using FileWriter.
Here is a sample code:
File resultFile;
Writer fileWriter;
resultFile = new File(Results.html");
// if file doesn't exists, then create it...
if (!resultFile.exists()) {
resultFile.createNewFile();
}
fileWriter = new FileWriter(resultFile.getAbsoluteFile());
fileWriter.write("<html><title>Test result</title><body>");
fileWriter.write("Your text OR your Log4j entries OR <span>HTML with custom result</span> goes here...");
fileWriter.write("Can do more than one writes to single file.");
fileWriter.write("It appends data to file.");
fileWriter.write("</body></html>");
fileWriter.close();