Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: sort control & passing parameters Post Reply Post New Topic
Author Message
mohamed abdeen
Newbie
Newbie
Avatar

Joined: 06 Aug 2008
Location: Egypt
Online Status: Offline
Posts: 2
Quote mohamed abdeen Replybullet Topic: sort control & passing parameters
    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
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
IP IP Logged
mohamed abdeen
Newbie
Newbie
Avatar

Joined: 06 Aug 2008
Location: Egypt
Online Status: Offline
Posts: 2
Quote mohamed abdeen Replybullet Posted: 10 Aug 2008 at 12:35am
can u send to me the link to download service pack

thanks
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.