111,119
社区成员
发帖
与我相关
我的任务
分享
ReportDocument ReportDoc = new ReportDocument();
ReportDoc.Load("test.rpt");
ReportDoc.SetParameterValue("lister", "台阶");
ReportDoc.PrintToPrinter(1, true, 0, 0);
ReportDoc = New ReportDocument
ReportDoc.Load("test.rpt")
SetParamValue("@lister", "楼主")
ReportDoc.PrintToPrinter(1, True, 0, 0)
Private Sub SetParamValue(ByVal paramName As String, ByVal paramValue As String)
For i As Integer = 0 To ReportDoc.DataDefinition.FormulaFields.Count - 1
If ReportDoc.DataDefinition.FormulaFields(i).FormulaName = "{" + paramName + "}" Then
ReportDoc.DataDefinition.FormulaFields(i).Text = """" + paramValue + """"
Exit For
End If
Next
End Sub