人员档案信息:姓名、身份证号、年龄、性别、籍贯、工资、学历、培训、照片等等等,很多这类信息要打印成一个档案表,请问应该怎样实现???
解决方案 »
- datagridview checkbox 有选中时才激活button
- Win窗体程序中,如何 手动实现 IDocHostUIHandler 接口??
- 如何筛选XML里的数据
- c# 控制台应用程序作用
- C# 动态绑定新闻
- 求 WinForm的DataGridView的一个用法
- c# 循环语句请高手点一下~~~急啊!!!!
- 属性中的访问器前面的修饰符有什么意义呢?就是get , set前面加public之类的修饰符我感觉不出他的意义,加在属性前还说的过去,加在访问器前就完全不知道什么意思了,求教???
- B/S模式下怎么上传图片到数据库啊?
- 求C#语言参考手册(中文版的)急需!!!
- 动态生成label控件后,要在label上显示指定文字,可是只显示一个字符
- 关于.net编程
是啊,RDLC。看了实例了,也动手做了,就是不明白数据集是怎样发挥作用的。
private void Form3_Load(object sender, EventArgs e)
{
int pageCount = 1;
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "app";
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
pd.DocumentName = pageCount.ToString();
pd.PrinterSettings.PrintFileName = "produce";
printDialog1.Document = pd;
printDialog1.PrinterSettings.PrinterName = "app";
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDialog1.PrinterSettings.PrinterName = printDialog1.PrinterSettings.PrinterName;
printDialog1.Document.Print();
}
else
pd.Print();
} void pd_PrintPage(object sender,PrintPageEventArgs e)
{
//这事件里写你要打印的内容
System.Drawing.Font font;
Pen linePen = new Pen(Color.Black); font = new System.Drawing.Font("宋体", 20, FontStyle.Bold);
e.Graphics.DrawString("生 産 管 理 単", font, Brushes.Black, 293, 30);
font = new System.Drawing.Font("C39HrP36DmTt", 36);
//打印生产管理单的barcode(sha_seq)
e.Graphics.DrawString("*2040607*", font, Brushes.Black, new Rectangle(8, 10, 220, 80));
("Number:", font, Brushes.Black, 20, 125);
e.Graphics.DrawString("CHC" + "2040607", font, Brushes.Black, 180, 125);
e.Graphics.DrawLine(linePen, 160, 145, 340, 145);
}
{
class panelPrint
{
private static Bitmap mBitmap = null;
private static System.Drawing.Printing.PrintDocument printDoc = new System.Drawing.Printing.PrintDocument(); public static void PrintPanel(Panel p)
{
PrintPreviewDialog ppvw;
Graphics mygraphics = p.CreateGraphics();
Size s = p.Size;
mBitmap = new Bitmap(s.Width,s.Height,mygraphics);
Graphics memoryGraphics = Graphics.FromImage(mBitmap); IntPtr dc1 = mygraphics.GetHdc();
IntPtr dc2 = memoryGraphics.GetHdc(); BitBlt(dc2,0,0,p.ClientRectangle.Width,p.ClientRectangle.Height,dc1,0,0,13369376);
mygraphics.ReleaseHdc(dc1);
memoryGraphics.ReleaseHdc(dc2); ppvw = new PrintPreviewDialog();
ppvw.Width = 160;
ppvw.Height = 221;
ppvw.Document = printDoc;
printDoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
if (ppvw.ShowDialog() != DialogResult.OK)
{
printDoc.PrintPage -= new System.Drawing.Printing.PrintPageEventHandler(PrintDoc_PrintPage);
return;
} printDoc.Print();
} [System.Runtime.InteropServices.DllImport("gdi32.dll")]
private static extern long BitBlt(IntPtr HDest, int nXDest, int nYDest, int nWidth, int hHeight, IntPtr Hsrc, int nXSrc, int nYSrc, int DwRop); private static void PrintDoc_PrintPage(Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawImage(mBitmap,0,0);
}
}
}