これは面白いです。パラメータを渡した後、新しいウィンドウを開きます。この新しいウィンドウには、レポート ビューアー コントロールがあります。[次のページを表示] ボタンをクリックするまで、コントロールとすべての表示が正常に読み込まれます。レポートが再読み込みされ、1 ページ目から再び開始されます。
何か案は????
コード:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim strTitle As String
Dim strReportName As String
Dim tstr As String
tstr = "-o-"
strReportName = ""
strTitle = "Praxima CENTAURI Report Viewer : REPORT : "
'If Not IsPostBack Then
If Not String.IsNullOrEmpty(Request.QueryString("prm")) Then
tstr = Request.QueryString("prm").ToString()
End If
'End If
'tstr = Request.QueryString("prm").ToString()
Me.Title = tstr 'strTitle + strReportName
SetReportProperties(tstr)
End Sub
Private Sub SetReportProperties(ByVal CSVString As String)
Dim paramList As Generic.List(Of ReportParameter) = New Generic.List(Of ReportParameter)()
With ReportViewer1
.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
With .ServerReport
Dim PParm(0) As String
Dim PValue(0) As String
Dim cnt As Integer = 1
Dim AType As String = "P"
Dim Marker As Integer = 1
Dim Pcnt As Integer = 0
Dim Vcnt As Integer = 0
Dim iLoop as Integer
For cnt = 1 To Len(CSVString)
If Mid(CSVString, cnt, 1) = "," And AType = "P" Then
ReDim Preserve PParm(Pcnt)
PParm(Pcnt) = Mid(CSVString, Marker, cnt - Marker)
'CSVString = Mid(CSVString, cnt + 1, Len(CSVString) - cnt)
cnt = cnt + 1
AType = "V"
Marker = cnt
Pcnt = Pcnt + 1
End If
If Mid(CSVString, cnt, 1) = "," And AType = "V" Or cnt = Len(CSVString) Then
ReDim Preserve PValue(Vcnt)
If cnt = Len(CSVString) Then
PValue(Vcnt) = Mid(CSVString, Marker, (cnt - Marker) + 1)
Else
PValue(Vcnt) = Mid(CSVString, Marker, cnt - Marker)
End If
'CSVString = Mid(CSVString, cnt + 1, Len(CSVString) - cnt)
cnt = cnt + 1
AType = "P"
Marker = cnt
Vcnt = Vcnt + 1
End If
' Dim pUri As New Uri(PValue(0))
Next
.ReportServerUrl = New Uri("http://localhost/reportserver") 'New Uri(PValue(0).ToString)
.ReportPath = "/praxima/rptZZ-FullPayDetails" 'PValue(1)
Dim pinfo As ReportParameterInfoCollection = .GetParameters()
Dim Parray As Integer = 1
For Each p As ReportParameterInfo In pinfo
Parray = Parray + 1
If Parray > 1 And Parray < pinfo.Count Then
paramList.Add(New ReportParameter(PParm(Parray).ToString, PValue(Parray).ToString))
End If
Next
If paramList.Count > 0 Then
'MsgBox(paramList.Item(2).Values.Item(1).ToString, vbOKOnly, )
.SetParameters(paramList)
End If
End With
.ShowParameterPrompts = False
End With
End Sub