We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

New line and new page in template using Linq

Hi,

i’m using linq reporting engine to build reports.
How can i add a new line or new page based on a condition using the template ?
I’d like to do something like this (using template):

<<if [condition]>>
new line or new page
<>

Thanks

Hi Simone,

Thanks for your inquiry. You can use ControlChar.PAGE_BREAK or ControlChar.LINE_BREAK for field's value to insert page break or line break. Please check following code example for your kind reference. Hope this helps you.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.writeln("<><><>");

Sender sender = new Sender(ControlChar.PAGE_BREAK);

ReportingEngine engine = new ReportingEngine();

engine.buildReport(doc, sender, "s");

doc.save(MyDir + "Out.docx");

public class Sender {

public Sender(String value) {

_value = value;

}

public String getValue() {

return _value;

}

private String _value;

}

Thank you very much !
Simone

Hi Simone,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.