現在のHTMLファイルを開いてStringBuilderを使用するために必要なものを置き換えるときに、HTMLに問題があります...これを行うために使用しているコードを以下に示します...
'Lets replace the grid information!'
Dim sb As New StringBuilder()
sb.AppendLine(" <table>")
sb.AppendLine("<tr>")
' sb.AppendLine("<th>")
For Each column As DataGridViewColumn In DataGridView1.Columns
sb.AppendLine(" <th>" + column.HeaderText + "</th>")
Next
' sb.AppendLine("</th>")
sb.AppendLine(" </tr>")
sb.AppendLine("</table")
HTML.Replace("%TABLE%", sb.ToString)
これまでのところすべてが機能していますが、私が抱えている問題は、顧客名フィールドの「<」を削除することだけです...これは置換によるものだと思います。そこに余分なものを追加しています。しかし、それを追加行から外すと、グリッドが不安定になります...これはこのスクリーンショットです...
これが私がつかんで必要なものを置き換えるHTMLファイルのソースです...
<!doctype html>
<html>
<head>
<title>Invoice %Invoice%</title>
<link rel="stylesheet" href=%STYLE%>
<style type="text/css">
@import url("style.css");
</style>
</head>
<body>
<header>
<h1>Invoice %Invoice%</h1>
<address>
<p>%Business%</p>
</address>
<img src="file:///%Image%" alt="" align="right">
</header>
<article>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1>Recipient</h1>
<address>
<p>%Company%</p>
<p>%Contact%</p>
<p>%Address%</p>
</address>
<table class="meta">
<tr>
<th><span>Invoice #</span></th>
<td><span>%Invoice%</span></td>
</tr>
<tr>
<th><span>Date</span></th>
<td><span>%Date%</span></td>
</tr>
<tr>
<th><span>Amount Paid</span></th>
<td><span id="prefix">$</span><span>0.00</span></td>
</tr>
<tr>
<th><span>Amount Due</span></th>
<td><span id="prefix">$</span><span>600.00</span></td>
</tr>
</table>
<%TABLE%> THIS IS WHERE I SEND THE TABLE TO!
</article>
<aside>
<h1> </h1>
<h1> </h1>
<h1><span>Additional Notes</span></h1>
<div contenteditable>
<p align ='center'>A finance charge of 1.5% will be made on unpaid balances after 30 days.</p>
</div>
</aside>
</body>
</html>
ありがとう!