using System;
using Stimulsoft.Report;
using Stimulsoft.Report.Dictionary;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Web.UI.WebControls;
public partial class calismasti : System.Web.UI.Page
{
string gun1 = "", day2 = "";
string month1 = "", month2 = "";
string year1 = "", year2 = "";
string date1 = "";
string date2 = "";
int control = 0;
SqlDataAdapter _da = null;
System.Data.DataTable _dt = new System.Data.DataTable();
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["EnergyConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
}
private void GetcboX()
{
control++;
if (control == 1)
if (!string.IsNullOrEmpty(lastDate.Text))
{
if (!string.IsNullOrEmpty(startDate.Text))
{
DateTime date= Convert.ToDateTime(startDate.Text);
year1 = date.Year.ToString();
month1 = date.Month.ToString();
if (month1.Length != 2)
month1 = "0" + month1;
gun1 = tarih.Day.ToString();
if (gun1.Length != 2)
day1 = "0" + day1;
date1 = year1 + month1 + day1;
date = Convert.ToDateTime(lastDate.Text);
year2 = date.Year.ToString();
month2 = date.Month.ToString();
if (month2.Length != 2)
month2 = "0" + month2;
day2 = date.Day.ToString();
if (day2.Length != 2)
day2 = "0" + day2;
day2 = year2 + month2 + day2;
String _whereClause = String.Format(" WHERE Date >=convert(datetime, '{0}') and Tarih <=convert(datetime, '{1}')", date1, date2);
_da = new SqlDataAdapter(@"SELECT * FROM BGS_001_01_AkisKontrol" + _whereClause, con);
_da.Fill(_dt);
}
else
if (control > 1)
lblAlert.Text = AlertMessage.Alert("Please Write Firts Date!");
}
else
if (control > 1)
lblAlert.Text = AlertMessage.Alert("Please Write Last Date!");
}
private void GetReport()
{
StiWebViewer1.Visible = true;
string path = Server.MapPath(@"~\mrt\izlemeformu.mrt");
string cmd = @"select * from BGS_001_01_AkisKontrol where date between '{0}' and '{1}";
string prm1 = startDate.Text;
string prm2 = lastDate.Text;
string Connection = "DataSource1";
sti _sti = new sti();
StiWebViewer1.Report = _sti._STI(path, cmd, Connection, prm1, prm2);
}
protected void ButtonGet_Click(object sender, EventArgs e)
{
GetReport();
}
}
