Vous êtes sur la page 1sur 2

http://localhost:49168

http://localhost:49168/reportserver

Chandraprakash
Chandu9211

mJobNo Text
CoId Int
YrId Int
DataSetForCheck_List

using Microsoft.Reporting.WebForms;
using ShowReports.Reports;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ShowReports
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath =
Server.MapPath("~/Reports/CheckList_v2.rdlc");
DataSetForCheck_List dsSetForCheck_List = new
DataSetForCheck_List();
DataSet ds = new DataSet();
using (SqlConnection con = new SqlConnection("data
source=118.185.125.244;initial catalog=PORTALL_CHA_SA;user
id=db_portall2;password=db_portall2##17;persist security info=true;"))
{
con.Open();

//SetParameterFieldInfo("@mJobNo", JobNo);
//SetParameterFieldInfo("@CoId",
Convert.ToString(SessionHelper.CurrentBranch));
//SetParameterFieldInfo("@YrId",
Convert.ToString(SessionHelper.FinancialYear));
// SqlCommand cmd = new SqlCommand("select * from
userinformation", con);

SqlCommand cmd = new SqlCommand("Select * from


Import_Document",con);
//cmd.CommandText = "nQryImport_ChedkList";
//cmd.Connection = con;
//// 2. set the command object so it knows
//// to execute a stored procedure
//cmd.CommandType = CommandType.StoredProcedure;
//// 3. add parameter to command, which
//// will be passed to the stored procedure
//cmd.Parameters.AddWithValue("@mJobNo", "02-19-I001453");
//cmd.Parameters.AddWithValue("@CoId", 02);
//cmd.Parameters.AddWithValue("@YrId", 19);

SqlDataAdapter da = new SqlDataAdapter(cmd);


cmd.CommandTimeout = 600;
da.Fill(ds);
con.Close();
}
ReportDataSource datasource = new
ReportDataSource("DataSetForCheck_List", dsSetForCheck_List.Tables[0]);

ReportViewer1.LocalReport.DataSources.Clear();
ReportViewer1.LocalReport.DataSources.Add(datasource);
ReportViewer1.DataBind();
}
}
}
}

_______________________________________

con.Open();

//SetParameterFieldInfo("@mJobNo", JobNo);
//SetParameterFieldInfo("@CoId",
Convert.ToString(SessionHelper.CurrentBranch));
//SetParameterFieldInfo("@YrId",
Convert.ToString(SessionHelper.FinancialYear));
// SqlCommand cmd = new SqlCommand("select * from
userinformation", con);

//SqlCommand cmd = new SqlCommand("Select * from


Import_Document",con);
//cmd.CommandText = "nQryImport_ChedkList";
//cmd.Connection = con;
//// 2. set the command object so it knows
//// to execute a stored procedure
//cmd.CommandType = CommandType.StoredProcedure;
string str = "Select * from Import_Document";
//// 3. add parameter to command, which
//// will be passed to the stored procedure
//cmd.Parameters.AddWithValue("@mJobNo", "02-19-I001453");
//cmd.Parameters.AddWithValue("@CoId", 02);
//cmd.Parameters.AddWithValue("@YrId", 19);

SqlDataAdapter da = new SqlDataAdapter(str,con);


// cmd.CommandTimeout = 600;
da.Fill(ds);
con.Close();

Vous aimerez peut-être aussi