Hello!
Is is possible to pass a variable into a userfunction, when not using Reportparameters that have been setup inside the Design mode?
Right now I am passing parameters from the associated webpage via a sqldatasource all set up programatically on the aspx page, and that part works fine. But now I would like to send variables into userfunctions located inside the code behind page for the report. Still not using the design mode, but all should be via programming.
web aspx page:
Dim sqlDataSource1 As New SqlDataSource()
sqlDataSource1.ProviderName = "System.Data.SqlClient"
sqlDataSource1.ConnectionString = "Data Source= etc"
sqlDataSource1.SelectCommand = strSQL
Dim parFakturaNrStart As New Telerik.Reporting.Parameter()
parFakturaNrStart.Value = "112112"
sqlDataSource1.Parameters.Add("@parFakturaNrStart", DbType.String, parFakturaNrStart.Value)
Dim parFakturaNrEnd As New Telerik.Reporting.Parameter()
parFakturaNrEnd.Value = "112312"
sqlDataSource1.Parameters.Add("@parFakturaNrEnd", DbType.String, parFakturaNrEnd.Value)
Me.ReportViewer1.Report = New basic_report
Dim report As Telerik.Reporting.Report = DirectCast(Me.ReportViewer1.Report, Telerik.Reporting.Report)
report.DataSource = sqlDataSource1
' code here to send to the userfunction
This part takes care of the main report itself and works just fine. That is, the main report renders on the webpage without a problem.
But what do I have to do on the aspx page and/or reports code behind page, in order to send variables or a "parameter" to be picked up by the User function in its Expression?
Inside Edit Expression dialog:
{MyTelerikReportsClassLib.basic_report.getAllInvoicesInSelectionForDisplay(outgoing_variable1, outgoing_variable2)}
Report code behind page:
Function getAllInvoicesInSelectionForDisplay(incoming_variable_here1 as string, incoming_variable_here2 as string )
' further code here
' actually another SQL query to output its result at the end of this function
Return something
End Function
Please advise how to do this.
Best regards
Lars