Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506

    Unanswered: Running Crystal Reports in VS 2008

    Hi All,
    I am facing a peculiar problem.I am trying to run my crystal reports in aspnet (vs 2008).I am passing the parameters at runtime.
    Whenever I am running the page , it is going into endless execution ...and my report is also not showing up . I can't able to stop my VS.I am using ctrl+alt+del to stop the VS 2008.

    I am using this code

    Code:
    ParameterFields paramFields = new ParameterFields(); 
    ParameterField pfAgencyCode = new ParameterField(); 
    ParameterField pfReceiptID = new ParameterField(); 
    
    ParameterDiscreteValue discreateAgency=new ParameterDiscreteValue(); 
    ParameterDiscreteValue discreateReceipt=new ParameterDiscreteValue(); 
    
    discreateAgency.Value = 
    "39001"; 
    discreateReceipt.Value = 
    "1"; 
    pfAgencyCode.CurrentValues.Add(discreateReceipt);
    paramFields.Add(pfAgencyCode);
    
    pfReceiptID.CurrentValues.Add(discreateReceipt);
    paramFields.Add(pfReceiptID);
    CrystalReportViewer1.ParameterFieldInfo.Add(paramFields);
     
    
    CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.ServerName = 
    "VMSQL1\\SQL2005"; 
    CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.UserID = 
    "XX"; 
    CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.Password = 
    "XXXX"; 
    CrystalReportViewer1.LogOnInfo[0].ConnectionInfo.DatabaseName = 
    "XXXX"; 
    CrystalReportSource1.Report.FileName = 
    "~\\Reports\\ABC.rpt"; 
    CrystalReportViewer1.DataBind();
    CrystalReportViewer1.RefreshReport();


    If anybody have any clue about the problem, please help me ...
    Thanks !!
    Last edited by rudra; 05-23-08 at 16:07.
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Thanks anyways, I solved it myself.
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  3. #3
    Join Date
    Sep 2003
    Posts
    156
    What was the solution?
    rgs,

    Ghostman

  4. #4
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    If you are passing database infos and parameters through code behind file in c#,and using the VS 2008 crystal report ,it will not support the postback scenarios.I mean ,while postback the parameters will not work.
    Solution: Use the licence version (full version) of cyrstal report and use the crystal report library 12.0.0.It will work smoothly and your life will be fine.
    You need to modify the above code a bit to run it smoothly.
    I think that can be done very easily.....if you people face any problem let me know ...I wil share my code...
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

  5. #5
    Join Date
    Nov 2008
    Posts
    8

    C# crystal reports parameters

    try this

    ParameterFieldDefinitions crParameterFieldDefinitions ;
    ParameterFieldDefinition crParameterFieldDefinition ;
    ParameterValues crParameterValues = new ParameterValues();
    ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

    crParameterDiscreteValue.Value = paramValue;
    crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
    crParameterFieldDefinition = crParameterFieldDefinitions["paramField"];
    crParameterValues = crParameterFieldDefinition.CurrentValues;

    full source code

    C# Crystal Reports String parameter

    yang.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •