سؤال

I am generating a html report in Java using renderSnake. I am quite new using renderSnake so I still have doubts about some of the basics. My report contains a list of Object which may vary in size.

I want everyone of these objects to generate the same html code but I do not know how to iteratively modify or add content to HtmlCanvas.

I am imagine something like this:

 HtmlCanvas html = new HtmlCanvas();
 html
    .head()
           some code here
    ._head()
    .body()
           some code here
    ._body
 ._html();

  for(oject e : inList){
       generatedCode=generate some html code
       html.add(generatedCode)
  }

Does anyone know how to accomplish this?

هل كانت مفيدة؟

المحلول

I got a solution by myself.

It is just necesary to reopen the htmlcanvas and it will concatenate them instead of overwritting it.

html
    .html()
         .body()
            ... some code here
         ._body()
     ._html();

some code
for(object e:inlist){
html
    .html()
         .body()
            ... some more code here
         ._body()
     ._html();
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top