人员档案信息:姓名、身份证号、年龄、性别、籍贯、工资、学历、培训、照片等等等,很多这类信息要打印成一个档案表,请问应该怎样实现???

解决方案 »

  1.   

    你可以采用报表,如Report servers 通过你的查询条件,链接到报表页面,就可以。
      

  2.   

    恩,RDLC吧,简单好用自己要求的格式???
      

  3.   


    是啊,RDLC。看了实例了,也动手做了,就是不明白数据集是怎样发挥作用的。
      

  4.   

    printDialog控件,红色地方就是你要打印的内容,蓝色的的是画线的,想要什么格式自己设计
    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);             
     }
      

  5.   

    using System.Drawing;namespace tsleyyg.panelPrint
    {
        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);
            }
        }
    }