public void ConvertToHtml(string template) { StringBuilder itemsTable = new StringBuilder(); for (int i = 0; i < _itemName.Count; i++) { itemsTable.Append("<tr><td class=\"itemkey\">"); itemsTable.Append(_itemName[i]); itemsTable.Append("</td><td class=\"itemvalue\">"); itemsTable.Append(_itemValue[i]); itemsTable.Append("</td></tr>"); } itemsTable.Append("<tr id=\"total\"><td class=\"itemkey\" >"); itemsTable.Append(_totalText); itemsTable.Append("</td><td class=\"itemvalue\"><span class=\"totalvalue\">"); itemsTable.Append(_totalValue); itemsTable.Append("</span></td></tr>"); HtmlTemplateEngine htmlEngine = new HtmlTemplateEngine(template); htmlEngine.AddKeyValue("HeadLogoPath", HeadLogoPath); htmlEngine.AddKeyValue("ClientAddress", ClientAddress); htmlEngine.AddKeyValue("ClientInfo", ClientInfo); htmlEngine.AddKeyValue("InvoiceDate", DateTime.Now.ToString("dd.MM.yyyy")); htmlEngine.AddKeyValue("Heading", Heading); htmlEngine.AddKeyValue("Sensorname", Sensorname); htmlEngine.AddKeyValue("GraphPath", GraphPath); htmlEngine.AddKeyValue("ListFooter", ListFooter); htmlEngine.AddKeyValue("Footer", Footer); htmlEngine.AddKeyValue("startdate", StartDate.ToString("dd.MM.yyyy")); htmlEngine.AddKeyValue("enddate", EndDate.ToString("dd.MM.yyyy")); htmlEngine.AddKeyValue("ItemTable", itemsTable.ToString()); htmlEngine.Execute(Path.GetDirectoryName(template) + "\\generated.html"); }