在excel中显示评论 [英] Showing comments in excel
问题描述
我正在使用C#处理excel评论。
if(Fcount> 0)
{
comment = string.Join(Environment.NewLine,dtModified.AsEnumerable()。Where(p => p.Field< string>(Constants.FuncName)== FunName1& &(string)p [Constants.Date] == date&&(string)p [Constants.PF] ==F)。选择(a => a.Field< string>(Constants.Time) )))+LL:+ LowLevel +,+Value:+ Value +,+HL:+ HighLevel;
}
如果Fcount是6那么
我应该得到输出为(评论变量)
1:06:42 AM,LL:3,价值:0.699428437325653,HL:10
1:06:42 AM,LL:3,价值:0.699428437325653,HL:10
1:06:42 AM,LL:3,价值:0.699428437325653,HL: 10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653, HL:10
1:06:42 AM,LL:3,价值:0.699428437325653,HL:10
但是
我得到了出来作为
1:06:42 AM
1:08:19 AM
1:09:57 AM
1:11:35 AM
1:13:13 AM
1:14:51 AMLL:3
3
3 >
3
3
3,价值:0.699428437325653
0.718108917040355
0.718004332154577
0.717611501159894
0.716311910658491
0.716757724249684,HL:10
10
10
10
10
10
请帮助这个
我尝试了什么:
我正在使用C#处理excel评论。
在努力推广评论时,excel无法逐行追加数据
Hi,
I am working on excel comments using C#.
if (Fcount > 0)
{
comment = string.Join(Environment.NewLine, dtModified.AsEnumerable().Where(p => p.Field<string>(Constants.FuncName) == FunName1 && (string)p[Constants.Date] == date && (string)p[Constants.PF] == "F").Select(a => a.Field<string>(Constants.Time))) + "LL:" + LowLevel + "," + "Value:" + Value + "," + "HL:" + HighLevel;
}
If Fcount is 6 then
I should get the output as(comment variable )
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
1:06:42 AM,LL:3,Value:0.699428437325653,HL:10
But
I am getting the out put as
1:06:42 AM
1:08:19 AM
1:09:57 AM
1:11:35 AM
1:13:13 AM
1:14:51 AMLL:3
3
3
3
3
3,Value:0.699428437325653
0.718108917040355
0.718004332154577
0.717611501159894
0.716311910658491
0.716757724249684,HL:10
10
10
10
10
10
Please help on this
What I have tried:
I am working on excel comments using C#.
While working on populatimg the comments to excel not able to append the data line by line
推荐答案
你的括号在错误的地方:
Your parentheses are in the wrong place:
comment = string.Join(Environment.NewLine,
dtModified.AsEnumerable()
.Where(p => ...)
.Select(a => a.Field(Constants.Time))
) + "LL:" + LowLevel + "," + "Value:" + Value + "," + "HL:" + HighLevel;
在选择
投影中移动附加信息:
Move the additional information inside the Select
projection:
comment = string.Join(Environment.NewLine,
dtModified.AsEnumerable()
.Where(p => ...)
.Select(a => a.Field(Constants.Time) + "LL:" + LowLevel + "," + "Value:" + Value + "," + "HL:" + HighLevel)
);
这篇关于在excel中显示评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!