باسلام
private void button1_Click(object sender, EventArgs e)
{
System.Globalization.PersianCalendar pc =
new System.Globalization.PersianCalendar();
string dateNow = "";
string day = pc.GetDayOfMonth(DateTime.Now).ToString();
string month = pc.GetMonth(DateTime.Now).ToString();
string year = (pc.GetYear(DateTime.Now)).ToString();//.Substring(2, 2);
if (day.Length == 1)
day = "0" + day;
if (month.Length == 1)
month = "0" + month;
dateNow = year + "/" + month + "/" + day;
DateTime fd = Convert.ToDateTime(df.GetSelectedDateInDateTime(). ToShortDateString());
DateTime ed = Convert.ToDateTime(de.GetSelectedDateInDateTime(). ToShortDateString());
string fDate = df.GetSelectedDateInPersianDateTime().ToShortDateS tring();
string eDate = de.GetSelectedDateInPersianDateTime().ToShortDateS tring();
StiVariable NowDate = new StiVariable("Date", "NowDate", typeof(string), dateNow, false);
StiVariable FirstDate = new StiVariable("Date", "FirstDate", typeof(string), fDate, false);
StiVariable EndDate = new StiVariable("Date", "EndDate", typeof(string), eDate, false);
using (var db = new DataClasses1DataContext())
{
var print = (db.TypeCamerConstants(fd, ed));
stiReport1.Load("TypeCamerConstants.mrt");
stiReport1.RegData("db1", print.ToList());
stiReport1.Dictionary.Variables.Add(NowDate);
stiReport1.Dictionary.Variables.Add(FirstDate);
stiReport1.Dictionary.Variables.Add(EndDate);
stiReport1.Show();
}
}
df.GetSelectedDateInDateTime().ToShortDateString()
تاریخ است که کامپونت شمسی می خوانم برای شماه هر چیزی می تواند باشد
TypeCamerConstants(fd, ed)
اسم sp من است که با 2متغییر است
بنظرم منظور شما این خطها
StiVariable NowDate = new StiVariable("Date", "NowDate", typeof(string), dateNow, false);
StiVariable FirstDate = new StiVariable("Date", "FirstDate", typeof(string), fDate, false);
StiVariable EndDate = new StiVariable("Date", "EndDate", typeof(string), eDate, false);
و
خط
stiReport1.Dictionary.Variables.Add(NowDate);
stiReport1.Dictionary.Variables.Add(FirstDate);
stiReport1.Dictionary.Variables.Add(EndDate);
است