🚀 Welcome to MDriven Learn –  Don’t miss the latest Release Notes.
OCLOperators XHtmlReportAsString

XHtmlReportAsString(nameOfViewModel) works with XHTML content and transforms it using data from the ViewModel, returning a string with XHTML.


Example:

A ViewModel contains:

  • Name = "Sandra"
  • Age = 30

The XHTML template contains placeholders:

<div>
  Name: {Name}
  <br/>
  Age: {Age}
</div>

Run:

self.XHtmlReportAsString(MyViewModel)

Result:

<div>
  Name: Sandra
  <br/>
  Age: 30
</div>

The operator:

  • Finds {Name} and replaces it with "Sandra"
  • Finds {Age} and replaces it with "30"
  • Returns the whole XHTML as a string


See HtmlReport for more information.