ReportDocument won't Export / vbnet
-
I'm using the following code. I want to send a populated CrystalReport to a location as a PDF when the Totals button is clicked. When I keep what is between the *'s, nothing gets exported, there are no errors either. When I comment out what is between the *'s, the unpopulated .rpt file gets sent to the destination as a PDF. Please Help! Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Not Page.IsPostBack Then Dim tDay As Integer Dim tCall As Integer Dim DD As DateTime Dim CallActivity As DateTime tDay = Integer.Parse(txtPast.Text) tCall = Integer.Parse(txtCall.Text) DD = Today.AddDays(-tDay) CallActivity = Today.AddDays(-tCall) Dim UD As DateTime UD = lblUpDOB.Text.Trim Dim LD As DateTime LD = lblLowDOB.Text.Trim SetReportParam(txtGender.Text, txtRace.Text, UD, LD, ddlSite.SelectedItem.Value, DD, CallActivity) End If End Sub Private Sub SetReportParam(ByVal SexID As String, ByVal RaceID As String, ByVal UpDOB As DateTime, ByVal LowDOB As DateTime, ByVal SiteID As String, ByVal DD As DateTime, ByVal CallActivity As DateTime) rDoc1.Load("path to .rpt") Dim logonInfo As New TableLogOnInfo() Dim i As Integer For i = 0 To rDoc1.Database.Tables.Count - 1 logonInfo.ConnectionInfo.ServerName = "servername" logonInfo.ConnectionInfo.DatabaseName = "dbname" logonInfo.ConnectionInfo.UserID = "uid" logonInfo.ConnectionInfo.Password = "pwd" rDoc1.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo) Next Dim paramFields As New ParameterFields() Dim paramField As New ParameterField() Dim discreteValue As New ParameterDiscreteValue() Dim rangeValue As New ParameterRangeValue() paramField.ParameterFieldName = "SexID" discreteValue.Value = SexID paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterFieldName = "RaceID" discreteValue.Value = RaceID paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterFieldName = "LBirth" discreteValue.Value = UpDOB paramField.CurrentValues.Add(discreteValue) paramFields.Add(paramField) paramField.ParameterF