Skip to Content
0
Former Member
Dec 11, 2008 at 06:58 PM

drilldown parameters not changing..

13 Views

I have a report with drilldown in the detail.

When I initially select the parameters the report displays and the drill down works.

If I change a parameter and re-run the report, the drill down still shows the previous parameter selection.

What would be cuasing this?

Here is my code... using vs2008 asp.net

Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Partial Public Class CRStatusExceptions

Inherits System.Web.UI.Page

Dim oTable As CrystalDecisions.CrystalReports.Engine.Table

Dim oLogon As CrystalDecisions.Shared.TableLogOnInfo

Dim oDB As CrystalDecisions.CrystalReports.Engine.Database

Dim oConnInfo As CrystalDecisions.Shared.ConnectionInfo

Dim rptdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument

Private Sub CRStatusExceptions_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

WebDateEnd.Value = Now()

WebDateStart.Value = DateAdd(DateInterval.Day, -7, Now())

bindreport()

CRV1.Visible = True

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then

End If

End Sub

Private Sub bindreport()

Dim sReportName As String = Nothing

'Get report and write it out to the stream...

sReportName = GetReport(SCLSession.SearchString)

rptdoc.Load(sReportName)

oConnInfo = New CrystalDecisions.Shared.ConnectionInfo()

oConnInfo.DatabaseName = My.Settings.crDB

oConnInfo.ServerName = My.Settings.crDBS

oConnInfo.UserID = My.Settings.crUID

oConnInfo.Password = My.Settings.crPW

For Each Me.oTable In rptdoc.Database.Tables

oLogon = oTable.LogOnInfo

oLogon.ConnectionInfo = oConnInfo

oTable.ApplyLogOnInfo(oLogon)

Next

rptdoc.SetParameterValue("profileid", SCLSession.ProfileID)

rptdoc.SetParameterValue("startDate", WebDateStart.Value)

rptdoc.SetParameterValue("endDate", WebDateEnd.Value)

rptdoc.SetParameterValue("FirstStatus", DropDownList1.SelectedValue.ToString)

rptdoc.SetParameterValue("SecondExceptionStatus", IIf(txtStatus2.Text.Length = 0, "", txtStatus2.Text.ToString))

rptdoc.SetParameterValue("ThirdExceptionStatus", IIf(txtStatus3.Text.Length = 0, "", txtStatus3.Text.ToString))

Me.CRV1.ReportSource = rptdoc

Me.CRV1.DataBind()

End Sub

Private Function GetReport(ByVal sReportName As String) As String

Dim websvc As New SCLIntraWebService.SCLIntraService

Dim b As Byte()

Dim oFilestream As System.IO.FileStream

If System.IO.File.Exists(Server.MapPath(SCLSession.UserName & "tempReport.rpt")) = True Then

System.IO.File.Delete(Server.MapPath(SCLSession.UserName & "tempReport.rpt"))

End If

b = websvc.GetReportbyName(sReportName)

oFilestream = New System.IO.FileStream(Server.MapPath(SCLSession.UserName & "tempReport.rpt"), System.IO.FileMode.Create, IO.FileAccess.Write)

oFilestream.Write(b, 0, b.Length)

oFilestream.Close()

Return Server.MapPath(SCLSession.UserName & "tempReport.rpt")

End Function

Protected Sub btnItemSearch_Click(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ButtonEventArgs) Handles btnItemSearch.Click

bindreport()

CRV1.Visible = True

End Sub

Private Sub CRStatusExceptions_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload

rptdoc.Close()

End Sub

End Class