Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Displaying Crystal Parameter on Report

Status
Not open for further replies.

mjjks

Programmer
Jun 22, 2005
138
US
Hi All,
I created stand alone Crystal report using version XI.
It has an input parameter for data source (stored procedure). Parameter shows on report if I run report by itself, but not when I run from application (C# - Windows app, VS2005,.NET 2.0). Report data changes as parameter changes, but doesn't display parameter.

Code I'm using is below. Anything am I doing wrong here?

Thanks in advance.

Code:
private void ShowMarkersApart(int iParam)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("exec usp_MRKR_RPT " + iParam, this.GetConnection("HWYDB"));
            DataTable dt = new DataTable("MRKR");
            da.Fill(dt);
            
            Markers_Miles_Apart oRpt = new 
            Markers_Miles_Apart(); [COLOR=green]//embedded crystal report[/color green]
            oRpt.SetParameterValue("@MileTolerance",iParam);
            oRpt.SetDataSource(dt.DefaultView);
            crw.ReportSource = oRpt; [COLOR=green]// crystal viewer[/color green]

        }

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top