PDA

Click to See Complete Forum and Search --> : [RESOLVED] Removing Parameter prompt from VB.Net app?


blakemckenna
Jul 11th, 2008, 09:29 AM
I have a VB.Net running a Crystal Report 11 report. This report takes 2 parameters. I have this already set up in my app and in the report. However, I keep getting prompted to enter parameters. How do I get rid of these prompts? Also, I get the below error when I set both of these parameter values to NULL. Here is my code below:


Public Function AccessGASR(ByVal strUserID As String, _
ByVal intGroupID As Integer, _
ByVal strInputType As String, _
ByVal strReportPath As String)
Try
rptErr.clsModule = "GroupActivitySummaryReportDLL"

Dim crDoc As New rptGroupActivitySummary

With crConnectionInfo
.ServerName = "HERCULES"
.DatabaseName = "Drip"
.UserID = "CRVBNETSQL"
.Password = "SC1800fuels"
.IntegratedSecurity = True
End With

crDoc.SetParameterValue("@userID", strUserID)
crDoc.SetParameterValue("@groupID", intGroupID)

If strInputType = "O" Then
PrintGASR(crDoc)
ElseIf strInputType = "B" Then
CreatePDFReport(crDoc)
End If

Catch ex As Exception
rptErr.clsProcedure = "AccessGASR()"
rptErr.clsMsg = ex.Message
rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
End Try
End Function


Thanks,

Besoup
Jul 11th, 2008, 09:31 AM
Do you have a subreport that is expecting parameters? I seem to remember you dealing with them before... that could cause this.

blakemckenna
Jul 11th, 2008, 09:34 AM
Besoup,

This is actually the same problem you were helping me with before. I don't understand how I fixed it, but whenever I make a change (small change) to the report...I run into this problem again and again. I don't understand what could be causing this. But to answer your question...yes, I have 3 subreports, all of which take the same 2 parameters.

Thanks,

Besoup
Jul 11th, 2008, 09:45 AM
yeah I would double check all of the links and refresh each subreport individually and see if that helps... what exactly did you change? just a field or something in the database?

blakemckenna
Jul 11th, 2008, 09:46 AM
Yeah, all I did was add a new field from the database. It's really weird and very frustrating!

Besoup
Jul 11th, 2008, 09:50 AM
yeah try opening up all of the sup reports and hitting F5 to refresh them. Then go through all of the sub report parameter links. Maybe even remove them and re link them.

blakemckenna
Jul 11th, 2008, 10:32 AM
Well I did what you suggested in your previous post and that seemed to work. Don't ask me what it did exactly but it worked.

Thanks for your help!

Besoup
Jul 11th, 2008, 12:12 PM
yeah whenever you change the structure of a datasource it screws up crystal... it's annoying but we live with it. :cool: