|
Okay, please help. Modify text
protected System.Web.UI.WebControls.Button btnChangeText;
protected CrystalDecisions.Web.CrystalReportViewer cRV;
myReport ReportDoc = new myReport();
private void Page_Load(object sender, System.EventArgs e)
{
// Place user code here to initialize the page
string strProvider = "Server=(local);DataBase=Northwind;UID=sa;PWD=111";
SqlConnection MyConn = new SqlConnection(strProvider);
MyConn.Open();
string strSelOrders = "Select * from orders";
string strSelOrdersDetails = "Select * from [Order Details]";
SqlDataAdapter daOrder = new SqlDataAdapter(strSelOrders,MyConn);
SqlDataAdapter daOrderDetails = new SqlDataAdapter(strSelOrdersDetails,MyConn);
DataSet ds = new DataSet();
daOrder.Fill(ds,"orders");
daOrderDetails.Fill(ds,"Order Details");
ReportDoc.SetDataSource(ds);
cRV.ReportSource = ReportDoc;
}
private void btnChangeText_Click(object sender, System.EventArgs e)
{
TextObject tb = (TextObject )ReportDoc.ReportDefinition.ReportObjects["Text2"];
tb.Text = "Order Number";
}
load
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
protected System.Web.UI.WebControls.Button btnLoad;
protected System.Web.UI.HtmlControls.HtmlInputFile File1;
private void Page_Load(object sender, System.EventArgs e)
{
// Place user code here to initialize the page
if(Session["filename"]!=null)
CrystalReportViewer1.ReportSource = Session["filename"].ToString();
}
private void btnLoad_Click(object sender, System.EventArgs e)
{
string strName = File1.PostedFile.FileName;
if(strName.Trim()!="")
{
CrystalReportViewer1.ReportSource = strName;
Session["filename"] = strName;
}
} |
|