Print Page | Close Window

sort control & passing parameters

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3915
Printed Date: 28 Apr 2024 at 11:54pm


Topic: sort control & passing parameters
Posted By: mohamed abdeen
Subject: sort control & passing parameters
Date Posted: 06 Aug 2008 at 9:29am
i used
*crystal report 2008 to create my report "business object"
*using asp .net 2005 to create web application

*i used passing parameters to pass parameter to the report which has 4 parameters
 EmpID ,, ProID ,, StartDate,, EndDate


and make selection record depend in this parameters

i get the passed values to this parameters from combobox

    private void trythrid()
    {
        //Instantiate variables
        ReportDocument reportDocument = new ReportDocument();
        ParameterFields paramFields = new ParameterFields();

        //Set instances for input parameter 1 -  @ProID
        ParameterField paramField_ProID = new ParameterField();
        paramField_ProID.Name = "ProID";
        ParameterDiscreteValue paramDiscreteValue_ProID = new ParameterDiscreteValue();
        paramDiscreteValue_ProID.Value = ddl_ProName.SelectedItem.Value.ToString();
        paramField_ProID.CurrentValues.Add(paramDiscreteValue_ProID);
        paramFields.Add(paramField_ProID);

        //Set instances for input parameter 2 -  @EmpID
        ParameterField paramField_EmpID = new ParameterField();
        paramField_EmpID.Name = "EmpID";
        ParameterDiscreteValue paramDiscreteValue_EmpID = new ParameterDiscreteValue();
        paramDiscreteValue_EmpID.Value = ddl_Employee.SelectedItem.Value.ToString();
        paramField_EmpID.CurrentValues.Add(paramDiscreteValue_EmpID);
        paramFields.Add(paramField_EmpID);

        //Set instances for input parameter 3 -  @StartDate
        ParameterField paramField_StartDate = new ParameterField();
        paramField_StartDate.Name = "StartDate";
        paramField_StartDate.IsOptionalPrompt = true;
        ParameterDiscreteValue paramDiscreteValue_StartDate = new ParameterDiscreteValue();
        paramDiscreteValue_StartDate.Value = tbx_StartDate.Text;
        paramField_StartDate.CurrentValues.Add(paramDiscreteValue_StartDate);
        paramFields.Add(paramField_StartDate);

        //Set instances for input parameter 4 -  @EndDate
        ParameterField paramField_EndDate = new ParameterField();
        paramField_EndDate.Name = "EndDate";
        paramField_EndDate.IsOptionalPrompt = true;
        ParameterDiscreteValue paramDiscreteValue_EndDate = new ParameterDiscreteValue();
        paramDiscreteValue_EndDate.Value = tbx_EndDate.Text;
        paramField_EndDate.CurrentValues.Add(paramDiscreteValue_EndDate);
        paramFields.Add(paramField_EndDate);


        CrystalReportViewer1.ParameterFieldInfo = paramFields;
        reportDocument.Load(@"D:\MeDo0 Work\Syngnta_TimeSheet2.0\Code\LoggedTime.rpt");


        //set the database loggon information. **Note that the third parameter is the DSN name
        reportDocument.SetDatabaseLogon("sa", "123","mabdeen-xp-4981", "TimeSheetV2", false);
       
        //Load the report by setting the report source
        CrystalReportViewer1.ReportSource = reportDocument;
    }

the file loaded sucessfully with correct data but when i press sort control of crystal report no action happen

i don't know whyyyy and what the problem



Replies:
Posted By: BrianBischof
Date Posted: 09 Aug 2008 at 4:58pm
Do you have the latest service packs installed. I forget all the details, but I think they released service packs to make Visual Studio more compatible with CR 2008. I would try that to see if that helps.

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: mohamed abdeen
Date Posted: 10 Aug 2008 at 12:35am
can u send to me the link to download service pack

thanks



Print Page | Close Window