Hi,
I'm new to MigraDoc and PdfSharp and from what I've seen it looks very good.
I'm currently facing an issue with the implementation of MigraDoc. I'm developing a web application in ASP.Net/C# that generates PDF reports. Up to now the reports were hard coded in the C# code which is very annoying when the client needs an update (recompile and everything).
Is it possible to create a base document template with markups that a generic C# code could interpret and replace?
I've been trying with MigraDoc's native format (mdddl) and managed to replace markups in the following way :
Code:
\document
[
DefaultPageSetup
[
PageFormat = A4
]
]
{
\section
{
\paragraph
[
Style = "Normal"
]
{
Agent : <%AgentName%>
}
}
}
Then when loaded into the Document object (
DdlReader.DocumentFromFile(_path + "MigraDoc.mdddl");) I can run through the
DocumentObjectCollection and replace the markups using a regex.
Everything works fine when using text or date elements but sometimes I need to add tables. If the table format is static, that is fixed columns and headers, all would be easy as I can use the
"Comment" attribute to give the table's name. But in some cases I don't know which table I'll use because in the case of no data, I'll have a single cell in the table saying "No data found".
How can I get round this?
Did anybody come up with this kind of issue? Does anyone work with MigraDoc this way?
Thanks