using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Data.SqlClient; using System.Data; using System.IO; using CrystalDecisions.CrystalReports.Engine; using CrystalDecisions.ReportSource; using CrystalDecisions.Reporting; namespace WebApplication9 { public partial class WebForm1 : System.Web.UI.Page { SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["listoq"].ConnectionString); ReportDocument rdoc = new ReportDocument(); protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { cn.Open(); SqlConnection cs = new SqlConnection("data source=.; database=palistuhan; integrated security=SSPI"); SqlCommand cmd = new SqlCommand("listoproce", cn); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable ds = new DataTable(); da.Fill(ds); rdoc.Load(Server.MapPath("CrystalReport1.rpt")); rdoc.SetDataSource(ds); rdoc.SetParameterValue("My Parameter", TextBox1.Text); CrystalReportViewer1.ReportSource = rdoc; CrystalReportViewer1.DataBind(); cn.Close(); } } }
crystalReport.Load(Server.MapPath("~/CrystalReport1.rpt")); Customers dsCustomers = GetData("select top 5 * from customers"); crystalReport.SetDataSource(dsCustomers); CrystalReportViewer1.ReportSource = crystalReport;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)