PDA

View Full Version : سوال: تهیه کارت شناسایی از دو رکورد بصورت همزمان



neda_dela
دوشنبه 26 اردیبهشت 1390, 18:11 عصر
با سلام به دوستان خوبم
من در حال حاضر می تونم برای یک رکورد در بانکم کارت شناسایی بگیرم اون هم توی یک برگه A5
حالا چون اندازه این برگه برای اطلاعات یک نفر زیاده می خام این برگ رو برای 2 رکورد استفاده کنم. تصاویر و کد ها رو ضمیمه کردم
لطفا کمک کنید...
70009

کد کلید "تایید" در تصویر اول به قرار زیر هست:



privatevoid button1_Click(object sender, EventArgs e)
{
(newreport_pclass(comboBox2.Text, textBox1.Text, comboBox1.Text, textBox2.Text)).ShowDialog();
comboBox1.Text = "";
comboBox2.Text = "";
textBox1.Text = "";
textBox2.Text = "";
}


من میخام این فرم رو برای 2 نفر توسعه بدم و بعد که کلید تایید رو زدم اطلاعات برای 2 نفر در یک برگه A5 نشون داده بشه نصف برگه برای یک رکورد و نصف دیگه برای رکورد بعدی
و کد کریستال ریپورت هم که در لود فرم قرار داده شده هم در زیر هست : (عکس دوم)



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace quran
{
publicpartialclassreport_pclass : Form
{
string term;
string year;
string sath;
int code;
public report_pclass(string trm, string yr, string st, string cd)
{
term = trm;
year = yr;
sath = st;
code = Convert.ToInt32(cd);
InitializeComponent();
}
privatevoid report_pclass_Load(object sender, EventArgs e)
{
try
{
SqlConnection Conn = newSqlConnection("Data Source=.;Initial Catalog=quran;Integrated Security=True");
string StrSelect = "SELECT [st-shakhsi].firstname, [st-shakhsi].lastname, [st-shakhsi].id, [st-shakhsi].fname, [st-shakhsi].pic, [st-sabt].sath, [st-sabt].term, [st-sabt].years, [st-sabt].days, [st-sabt].sath, [st-sabt].educator, [st-sabt].clock, [st-sabt].days, [st-sabt].classnum FROM [st-shakhsi] INNER JOIN [st-sabt] ON [st-shakhsi].id = [st-sabt].id WHERE ([st-sabt].term = '" + term + "') AND ([st-sabt].years = '" + year + "') AND ([st-sabt].sath = '" + sath + "') AND ([st-shakhsi].id = '" + code + "')";
SqlDataAdapter DA = newSqlDataAdapter(StrSelect, Conn);
quranDataSet DS = newquranDataSet();
DS.Clear();
Conn.Close();
Conn.Open();
DA.Fill(DS, "t");
Conn.Close();
program_class CR = newprogram_class();
CR.SetDataSource(DS.Tables["t"]);
crystalReportViewer1.ReportSource = CR;
CR.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA5;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
}


70010

neda_dela
جمعه 30 اردیبهشت 1390, 14:21 عصر
چرا هیشکی منو کمک نمی کنه؟:گریه:
دوباره کد ها رو می ذارم:
کد کلید "تایید" در تصویر اول به قرار زیر هست:



privatevoid button1_Click(object sender, EventArgs e)
{
(newreport_pclass(comboBox2.Text, textBox1.Text, comboBox1.Text, textBox2.Text)).ShowDialog();
comboBox1.Text = "";
comboBox2.Text = "";
textBox1.Text = "";
textBox2.Text = "";
}


و کد کریستال ریپورت هم که در لود فرم قرار داده شده هم در زیر هست : (عکس دوم)


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace quran
{
publicpartialclassreport_pclass : Form
{
string term;
string year;
string sath;
int code;
public report_pclass(string trm, string yr, string st, string cd)
{
term = trm;
year = yr;
sath = st;
code = Convert.ToInt32(cd);
InitializeComponent();
}
privatevoid report_pclass_Load(object sender, EventArgs e)
{
try
{
SqlConnection Conn = newSqlConnection("Data Source=.;Initial Catalog=quran;Integrated Security=True");
string StrSelect = "SELECT [st-shakhsi].firstname, [st-shakhsi].lastname, [st-shakhsi].id, [st-shakhsi].fname, [st-shakhsi].pic, [st-sabt].sath, [st-sabt].term, [st-sabt].years, [st-sabt].days, [st-sabt].sath, [st-sabt].educator, [st-sabt].clock, [st-sabt].days, [st-sabt].classnum FROM [st-shakhsi] INNER JOIN [st-sabt] ON [st-shakhsi].id = [st-sabt].id WHERE ([st-sabt].term = '" + term + "') AND ([st-sabt].years = '" + year + "') AND ([st-sabt].sath = '" + sath + "') AND ([st-shakhsi].id = '" + code + "')";
SqlDataAdapter DA = newSqlDataAdapter(StrSelect, Conn);
quranDataSet DS = newquranDataSet();
DS.Clear();
Conn.Close();
Conn.Open();
DA.Fill(DS, "t");
Conn.Close();
program_class CR = newprogram_class();
CR.SetDataSource(DS.Tables["t"]);
crystalReportViewer1.ReportSource = CR;
CR.PrintOptions.PaperSize = CrystalDecisions.Shared.PaperSize.PaperA5;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
}
}
}