简体   繁体   English

c#Crystal Reports 13(2010)将参数传递给Report Documents的这些方法之间有什么区别

[英]c# Crystal Reports 13 (2010) Whats the difference between these methods for passing parameters to Report Documents

I have been using this method for passing parameters to Reports (inherited code): 我一直在使用此方法将参数传递给Reports(继承的代码):

ParameterValues param0 = new ParameterValues();
param0.AddValue("1");
report.DataDefinition.ParameterFields[0].ApplyCurrentValues(param0);

But revising code i saw that you can make it like this: 但是修改代码后,我发现您可以这样:

report.SetParameterValue(0, "1");

This way i would save having to define ParameterValues...is there any fallback? 这样我就省去了定义ParameterValues ...是否有任何后备吗? Whats the difference between these two methods? 这两种方法有什么区别?

我们使用第二种方法已经有一段时间了,它似乎并没有影响功能或性能...所以从现在开始我们将使用它,因为它更短...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM