Crystal Reports 2008 for Visual Studio 2008

pgkdavefdd
pgkdavefdd used Ask the Experts™
on
I am developing a report that accesses a remote SQL2008 server DB.   In that report I need to pass 2 parameteres that are prompted for.  BillDate and DueDate  When I run the report locally it rund correctly but when I run it from my website, I am prompted for the parameters when I select print to press the next arrow.  How do I correct my newinvoice.asps.vb form to pass and retain the paarameters?  The following is my vb code for that page:

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Partial Class NewInvoice
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim report As New ReportDocument()
        report.Load(Server.MapPath("NewBillInvioceCrystalReport.rpt"))
        SetTableLocation(report.Database.Tables)
        CrystalReportViewer1.ReportSource = report
    End Sub
    Private Sub SetTableLocation(ByVal tables As Tables)
        Dim connectionInfo As New ConnectionInfo()
        connectionInfo.ServerName = "MyServer"
        connectionInfo.DatabaseName = "ICCTowerFund"
        connectionInfo.UserID = "UserID"
        connectionInfo.Password = "Password"
        For Each table As CrystalDecisions.CrystalReports.Engine.Table In tables
            Dim tableLogOnInfo As TableLogOnInfo = table.LogOnInfo
            tableLogOnInfo.ConnectionInfo = connectionInfo
            table.ApplyLogOnInfo(tableLogOnInfo)
        Next

    End Sub

Any Help is greatly appreciated.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
You have to save the logon and parameters in session variables and handle the call back.

mlmcc
Alpesh PatelSolution Architect at TCS (SAFe®Agilist, TOGAF® Foundation, PSM I®, MCP, MCSD)

Commented:
This is part of set the Table source (Name of server other than development). You need to pass parameter. Crystal report. Parameter.Add()

If have subreport then link that parameter of Subreport with main report properly.
Senior Consultant
Most Valuable Expert 2011
Top Expert 2013
Commented:
Parameters have little to do with setting the report source.  While you can use a COMMAND with a parameter and control the report source, that is not normally done.

mlmcc
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Author

Commented:
Do either of you have sample code that shows how to  save the logon and parameters in session variables and handle the call back.
Mike McCrackenSenior Consultant
Most Valuable Expert 2011
Top Expert 2013

Commented:
This tutorial shows how starting on page 101
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc

Author

Commented:
It would have been more help if they would have modified the code I provided to give an example

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial