LINQ Reporting illegal character in HTML template

Hi

When I try to set a template for having html output containing a \r character (char(13)) the Report builder fail with error:

Illegal usage of a new line character in a string or char literal.

the template is such as <<[" my html "] -html>> where " my html " contains a html content containing the \r character.

I cannot replace the \r since the file is automatically generated from a external source as PDF and then converted to WORD using your PDF library. Here some code

Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(report);
// Save document in docx format
var ms = new MemoryStream();
pdfDocument.Save(ms, Aspose.Pdf.SaveFormat.DocX);
var doc = new Document(ms);
var engine = new ReportingEngine();
engine.BuildReport(doc, this, string.Empty);

How can I solve this issue?

Thank you

Massimo

@usnextit,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document that you are generating using Aspose.PDF.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi

please find uploaded a small project which reproduces the problem

HtmlIssue.zip (28.7 KB)

Best Regards
Massimo

@usnextit,

Thanks for sharing the detail. Please refer to the following article.
Outputting Expression Results

You are facing the shared issue because of incorrect template syntax. It is in multiple paragraphs and each paragraph is in Frame. See the attached screenshot. syntax issue.png (37.1 KB)
Please replace the paragraph break with line break to fix this issue.

Hi

thank you for answering.
The Word file is created by software which converts from a PDF generated by SQL Reporting Services and it’s more complex than the one I gave you for testing. To convert PDF to DOCX I used Aspose.PDF.
I cannot arbitrarily replace paragraph to line break. I have to do that only between the LINQ Placeholders <<["…"] -html>>.
You are saying that in a LINQ directive must not be present paragraphs because you are not able to detect opening and closing directive. Am I true?

Why don’t you skip the paragraph?

Any suggestion?

Thank You

Massimo

@usnextit,

Thanks for your inquiry. In your document, you hard codded the HTML. If you simply want to insert the HTML into document, you can use DocumentBuilder.InsertHtml method. You can also insert HTML into document using LINQ Reporting. You just need to pass the HTML as data source to LINQ Reporting engine. Could you please share some more detail about your use case? We will then provide you more information on it.