そこにいるコーダーの助けが少し必要です.....
現在、コードはCSVファイルを読み取り、Powershellを使用してhtmlファイルに出力します。そして、Powershell を使用するこのコード (ここには示されていません) には他のビットがあるため、Powershell を使用する必要があります。
セルの値に応じてテーブルの行をどのように色付けしますか?
現在のコードは以下のようになります。
$datagridView1.DataSource | Export-Csv c:\tmp\test.csv
#HTML OUTPUT
$head= @"
<style>
BODY{background-color:white;}
TABLE{border-width: 3px;border-style: solid; border-color:white;border-collapse:
collapse;}
TH{border-width: 3px;padding: 2px;border-style: solid;border-color: white;background- color:yellow}
</style>
<script type="text/javascript">
var allText =[];
var allTextLines = [];
var Lines = [];
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "file://c:/tmp/test.csv", true);
txtFile.onreadystatechange = function()
{
allText = txtFile.responseText;
allTextLines = allText.split(/\r\n|\n/);
};
document.write(allTextLines);<br>
document.write(allText);<br>
document.write(txtFile);<br>
</script>
"@
$datagridView1.DataSource | convertto-html -head $head –body "<H2>Query</H2>" | Out-File C:\tmp\app.html
app.html ファイルは、CSV ファイルにない次の 4 つの列 (RowError、RowState、Table、ItemArray、HasErrors) も作成しているようで、どこから来たのかわかりません。
どんな助けでも大歓迎です