There are various tags dotted about in the Developer Guide → LINQ Reporting Engine, but I’m unable to find an API type documentation which lists all available tags.
e.g backColor, image, doc, cellMerge, restartNum.
I’m looking for a function similar to backColor which replaces text colour rather than background colour.
There is currently no tag to set text color rather than background color. However, your requirement can be achieved if wrapping text with corresponding HTML tags and using an expression tag with an -html switch as follows: <<[wrapped_text] -html>>. Please let us know if this option is acceptable for you?
Secondly, please check the following list of supported template syntax tags from our documentation:
foreach
if
elseif
else
var
image
doc
link
bookmark
cellMerge
backColor
next
restartNum
x
y
size
seriesColor
pointColor
removeif
check
item
@awais.hafeez Thanks for your response, that’s really useful .
The attraction of a textColor for me, as well as it being relatively concise, would be that I could directly plug in a System.Drawing.Color (similar to backColor)
I’ll experiment with the use of HTML expressions and see if that does the trick.
We have logged your requirement in our issue tracking system. Your ticket number is WORDSNET-22882. We will further look into the details of this requirement and will keep you updated here on the status of the linked ticket.
There is no way to add custom tags. However, you can extend functionality of LINQ Reporting Engine in many ways by using members of custom classes within existing tags. Could you please share some details of your scenario, so we could assist you further?
Thanks for quick reply. Appreciate it. I was trying to set value inside content control. Is it possible with built-in mechanism? I read in the docs it’s not possible.
LINQ Reporting Engine supports some operations involving content controls. Please see Working with Content Controls for more information.
If this does not fit your needs, please share more details. For example, content controls of what type do you use and which content control properties do you want to set using the engine?
@VJAI You can use code like this to set text of SDT:
Document doc = new Document();
StructuredDocumentTag tag = new StructuredDocumentTag(doc, SdtType.PlainText, MarkupLevel.Inline);
tag.RemoveAllChildren();
tag.AppendChild(new Run(doc, "This is text of content control"));
doc.FirstSection.Body.FirstParagraph.AppendChild(tag);
doc.Save(@"C:\Temp\out.docx");
Code removes old content tag.RemoveAllChildren() and appends Run node with new content.
In case your question was about setting of text of a simple text content control using LINQ Reporting Engine, you can use the same approach as for regular text. See Outputting Expression Results for more information.
I have attached a template document to show this. Please check TestContentControlText.docx (18.3 KB). You can use the following code to build a report from it:
Document document = new Document("TestContentControlText.docx");
ReportingEngine engine = new ReportingEngine();
engine.BuildReport(document, "Hello", "value");
document.Save("TestContentControlText Out.docx");
@ivan.lyagin Thanks for quick reply. I cannot able to download the attached file. It’s saying “Sorry, this file is private. Only visible to topic owner and staff members.”