locked
asp.net application passing parameter for existing report? RRS feed

  • Question

  • User-1827300673 posted

    Good Morning (or insert your time zone here),

     

    Crystal and VS Studio 2010... sigh its a pandora's box of issues for me.  I fix one thing and find another.  Here is my current issue maybe someone can shed some insight...

    Currently we have several reports that I thought would be easier to serve up to the users as a web page instead of me having to go around installing crystal or someeone sitting around running reports of people all day, so naturally I assumed asp.net would be the best solution.  Ok so I got the reports to run finally however the report requires a paramater, ok no problem asp.net allows for it to prompt for the parameter.  So I enter the parameter and poof get an error "Failed to open the connection. Failed to open the connection."  after some searching the internet with no luck, I decide to pass the parameter via a text box like so...

    Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnsubmit.Click
            Dim report As New ReportDocument()
            Dim path = Server.MapPath("../reporting/report name.rpt")
            report.Load(path)
            report.SetDatabaseLogon("reportacccount", "reportpassword", "servername", "databasename")
            report.SetParameterValue("team", parametertxt.Text)
    
    
            CrystalReportViewer1.ReportSource = report
            CrystalReportViewer1.ReuseParameterValuesOnRefresh = True
    
        End Sub

    Except now it only excepts the parameter that the report was initially saved with, i.e. team number 16 for instance.  If I try to use 11 it tells me parameter is missing which makes me think its not getting one at all???  Anyone have a way to pass in a parameter to an existing report?

    Tuesday, January 10, 2012 8:54 AM

All replies

  • User-1827300673 posted

    Hmm Zero Replies.. Does this mean that Crystal and VS don't really live together very well?  Does anyone have it working?  Has to be someone right?

    Monday, January 16, 2012 1:55 PM