PDA

View Full Version : سوال: جمع زدن جمع های کل در ریپورت



vB.N3T
دوشنبه 19 بهمن 1394, 21:26 عصر
سلام مهندسین عزیز

من گزارشی داریم به این شکل
138896

قسمت های که با قرمز مشخص کردم جمع ستون های بالاییشون هستن
حالا چطور میشه خود ااین جمع های کل رو با هم جمع کرد و تقسیم بر 64 کرد
تشکر

AmiN0012
چهارشنبه 21 بهمن 1394, 10:23 صبح
من امتحان نکردم ولی ببین اونجایی که میخای sum بدی نمیشه به چندتا ستون بگی sum بشن.

vb341
چهارشنبه 21 بهمن 1394, 18:45 عصر
باید کد بنویسی . در سایت w3-fasrsi.com نمونه کد برای اینکار رو گذاشتم

vb341
جمعه 23 بهمن 1394, 00:17 صبح
این هم نمونه کد :



namespace Darya
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}


private void button1_Click(object sender, EventArgs e)
{
this.masterInformationTableAdapter.Fill(this.shahr akDaryaDataSet.MasterInformation);
Fa_Face();
Load_report();
}
private void Fa_Face()
{
//برای نمایش فارسی محیط گزارش
string f = Application.StartupPath + @"\fa.xml";
Stimulsoft.Report.StiConfig.LoadLocalization(f);
}
private void Load_report()
{
string fn;
StiReport masterinfo = new StiReport();


fn = Application.StartupPath + @"\Report\MasterInfo.mrt";
masterinfo.Load(fn);
masterinfo.RegData(this.shahrakDaryaDataSet);
//================================================== ====================================
Stimulsoft.Report.Components.StiText t;
t=new Stimulsoft.Report.Components.StiText();
t =(Stimulsoft.Report.Components.StiText)masterinfo. GetComponentByName("TextDate");
t.Text =PersianDate();
//================================================== ====================================
Stimulsoft.Report.Components.StiImage img;
img = new Stimulsoft.Report.Components.StiImage();
img = (Stimulsoft.Report.Components.StiImage)masterinfo. GetComponentByName("Image1");
string fnImage;
fnImage= Application.StartupPath + @"\Pic\cover.jpg";
img.File = fnImage;
//================================================== =====================================
Stimulsoft.Report.Components.StiText t4;
t4 = new Stimulsoft.Report.Components.StiText();
t4 = (Stimulsoft.Report.Components.StiText)masterinfo.G etComponentByName("Text4");


Stimulsoft.Report.Components.StiText t5;
t5 = new Stimulsoft.Report.Components.StiText();
t5 = (Stimulsoft.Report.Components.StiText)masterinfo.G etComponentByName("Text5");


Stimulsoft.Report.Components.StiText t6;
t6 = new Stimulsoft.Report.Components.StiText();
t6 = (Stimulsoft.Report.Components.StiText)masterinfo.G etComponentByName("Text6");


Int32 i;
i = int.Parse(t4.Text) + int.Parse(t5.Text);


t6.Text = i.ToString();


masterinfo.Show();
}


private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'shahrakDaryaDataSet.MasterInformation' table. You can move, or remove it, as needed.
this.masterInformationTableAdapter.Fill(this.shahr akDaryaDataSet.MasterInformation);
textBox1.Text = PersianDate().ToString();
}


private void button2_Click(object sender, EventArgs e)
{
this.masterInformationTableAdapter.FillByParvandeh Number(this.shahrakDaryaDataSet.MasterInformation, textBox1.Text);
Fa_Face();
Load_report();
}
private string PersianDate()
{
DateTime today = DateTime.Now;
PersianCalendar pc = new PersianCalendar();
string StrDateFa = pc.GetYear(today).ToString("0000/") + pc.GetMonth(today).ToString("00/") + pc.GetDayOfMonth(today).ToString("00");
return StrDateFa;
}
}
}