-----------------------------------------------------------

New Message on MumbaiUserGroup

-----------------------------------------------------------
From: Joe_mama139
Message 1 in Discussion

Hello,   I am working with and RPT file(crystal report file) and have my report being 
displayed in a web form.  All my parameters are being passed correctly and the HTML 
viewer displays the report correctly.  However when I try and click to goto the next 
page, a report that has multiple pages, all I get is a blank page.  Not sure what is 
happening.  I have created everything in one page is this not possible.  I have 
attached my code.  Code is written in c#.  I know I probably have to use sessions but 
not sure how to use them.  Also, could I do it any other way.    
private void Page_Load(object sender, System.EventArgs e) 
{ 
if (!IsPostBack) 
{  
string connectionString = ConfigurationSettings.AppSettings["mainConnection"]; 
SqlConnection Test = new SqlConnection(connectionString); 
SqlCommand Ocmd = new SqlCommand("p_aic_select_dept"); 
Ocmd.CommandType = CommandType.StoredProcedure; 
Ocmd.Connection = Test; 
Test.Open(); 
DropDownList1.DataSource=Ocmd.ExecuteReader(); 
DropDownList1.DataTextField="DeptName"; 
DropDownList1.DataValueField="DeptName"; 
DropDownList1.DataBind(); 
Test.Close(); 
} 
 
{ 
 
 
ParameterFields paramFields = new ParameterFields (); 
ParameterField paramField = new ParameterField (); 
ParameterDiscreteValue discreteVal = new ParameterDiscreteValue (); 
paramField.ParameterFieldName = "Dept"; 
 
discreteVal.Value = DropDownList1.SelectedValue; 
paramField.CurrentValues.Add (discreteVal); 
paramFields.Add (paramField); 
.CrystalReportViewer1.ParameterFieldInfo = paramFields; 
 
 
} 
} 
#region Web Form Designer generated code 
override protected void OnInit(EventArgs e) 
{ 
InitializeComponent(); 
base.OnInit(e); 
} 
 
/// </summary> 
private void InitializeComponent() 
{  
this.Button1.Click += new System.EventHandler(this.Button1_Click); 
this.Load += new System.EventHandler(this.Page_Load); 
} 
#endregion 
private void Button1_Click(object sender, System.EventArgs e) 
{ 
{ 
this.CrystalReportViewer1.Visible=true; 
this.DropDownList1.Visible=false; 
this.Label1.Visible=false; 
this.Button1.Visible=false; 
string report = @"C:\Test\AssetDept.rpt"; 
String strUserName = (String) Session["report"]; 
CrystalReportViewer1.ReportSource = report; 
CrystalReportViewer1.DataBind();  
}  

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/MumbaiUserGroup/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to