Hi everyone,
There is a one problem. how to get Stimulsoft Reports between 2 dates in ASP.NET C#
DateEdit1 selected date1
DateEdit2 selected date2
Date1 and Date show reports
How get it?
HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
Re: HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
Hello.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Re: HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
i want to make date difference between 2 date in Stimulsoft Reports but i cant write a code in C#
Re: HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
Hello,
Can you please send us a test data and a sample (image, screenshot or other document) how it should look like.
We try to prepare the sample for you.
Thank you.
Can you please send us a test data and a sample (image, screenshot or other document) how it should look like.
We try to prepare the sample for you.
Thank you.
Re: HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
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();
}
}

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();
}
}

Re: HOW TO GET Stimulsoft Reports BETWEEN TWO SPECIFIC DATES
Hello,
Can you please send us a sample project for analysis.
Most probably, in this case, you are changing the query with parameters, but not send it in report.
Thank you.
Can you please send us a sample project for analysis.
Most probably, in this case, you are changing the query with parameters, but not send it in report.
Thank you.