Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: Passing Parameters from ASP.NET Application to Cry Post Reply Post New Topic
Author Message
cingo
Newbie
Newbie


Joined: 14 Dec 2010
Online Status: Offline
Posts: 1
Quote cingo Replybullet Topic: Passing Parameters from ASP.NET Application to Cry
    Posted: 14 Dec 2010 at 8:20pm
Passing Parameters from ASP.NET Application to Crystal Report Application

Hello,

if i do not bind to a dataset, i get the passed parameters from .cs, correctly in the report without it asking values.
BUT
if i bind report using dataset, then it shows a form to fill parameter values, even if i set the values in .cs
i dont want the form to be displayed..

please help...

code:
   
 CrystalReport1.Class1Crstal.insert_Selected_Doctor_labels_Reports_Temp(uid, session_id);
            OdbcDataAdapter adp = new OdbcDataAdapter();
            adp = Class1Crstal.get_CrystalReports_Doctor_labels_Reports(uid, session_id);
            DS = new DataSet();
            adp.Fill(DS, "Bill_Header_Report_Temp");
            rptDoc.Load(Server.MapPath("~/Reports/51_dr list.rpt"));
            rptDoc.FileName = Server.MapPath("~/Reports/51_dr list.rpt");
           

            CrystalReportViewer1.Visible = true;
         
            //CrystalReportViewer1.ReportSource = rptDoc;
            string categoryID = "SP1";
            rptDoc.SetParameterValue("CategoryID", categoryID);
            string Line1 = "SP2";
            rptDoc.SetParameterValue("Line1", categoryID);
            string Line2 = "SPE2";
            rptDoc.SetParameterValue("Line2", categoryID);
            string Line3 = "SPEC2";
            rptDoc.SetParameterValue("Line3", categoryID);

rptDoc.SetDataSource(DS);
            CrystalReportViewer1.ReportSource = rptDoc;



Regards
cingo
 
IP IP Logged
headache
Newbie
Newbie
Avatar

Joined: 05 Jan 2011
Location: Indonesia
Online Status: Offline
Posts: 3
Quote headache Replybullet Posted: 06 Jan 2011 at 8:12pm
From my Experience
It might happen because
1. there is error when fill the dataset (you can do debug on this, catch the error)
2. you have to check the database fields in report, refresh the data connections. sometimes there is changes that occur (possibly different columns by name or count). So you need to refresh the database fields to ge sync with the dataset.
IP IP Logged
asam
Newbie
Newbie
Avatar

Joined: 08 Jan 2011
Online Status: Offline
Posts: 20
Quote asam Replybullet Posted: 08 Jan 2011 at 8:53am
I do not use the process that you describe for getting the data and setting the report data source to that data - -
but in my humble experience I have found that I have to SetParameterValue AFTER I set the report data source.
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.016 seconds.