1
I have a question regarding replace, I am populating values in word but some values I will not have available but if not fill in the word will be shown @@Variablename, so I was wondering if you have any general replace to put in the values I don’t have in @@variavelxpto the value "0,00"
if (row["id_evento"].ToString() == "8")
{
sbConteudo.Replace("@@fdfgertyer", row["VALOR"].ToString());
}
else if (row["id_evento"].ToString() == "10")
{
sbConteudo.Replace("@@zz", row["VALOR"].ToString());
}
else if (row["id_evento"].ToString() == "22")
{
sbConteudo.Replace("@@xsa", row["VALOR"].ToString());
}
else if (row["id_evento"].ToString() == "24")
{
sbConteudo.Replace("@@teste", row["VALOR"].ToString());
}
else if (row["id_evento"].ToString() == "98")
{
sbConteudo.Replace("@@VALOR_IDES_2", row["VALOR"].ToString());
}
else if (row["id_evento"].ToString() == "99")
{
sbConteudo.Replace("@@VALOR_IDES_1", row["VALOR"].ToString());
}
In the example I used let’s say I have the event 24,10 and 99 then will be kept the variable @@valor_ides_2 and @test, but I need to put 0 there. In some cases the variable that will not be filled will be other so I do not have a pattern.
Why not go through the variables instead of looking for the ids ?
– Rovann Linhalis
@Rovannlinhalis thanks for the comment, I did not understand well your proposal, as would be?
– Voltz
I put the answer to how I would do it, see if it helps you
– Rovann Linhalis