PDA

View Full Version : پرینت گرفتن از report در اکسس



rerzaz
سه شنبه 05 آبان 1394, 14:25 عصر
سلام خسته نباشید
من می خوام به وسیله یک دکمه در سی شارپ از یک report در بانک اکسسم پرینت بگیرم ، چکار باید بکنم ؟

batman1
چهارشنبه 06 آبان 1394, 10:50 صبح
این دستور شاید تا حدودی به دردت بخوره:
public void printButton()
{
printDocument1.DefaultPageSettings.Landscape = true;
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Bitmap bm = new Bitmap(Width, Height);
this.DrawToBitmap(bm, new Rectangle(0, 0, this.Width, this.Height));
e.Graphics.DrawImage(bm, 20, 20);
البته یه ذره باهاش ور برو تا بهتر فیکس فرمت بشه.

rerzaz
چهارشنبه 06 آبان 1394, 11:29 صبح
سلام ممنون ، خوب حالا کجا باید بهش معرفی کنم از فایل اکسس فلان برو report فلان رو چاپ کن

این دستور شاید تا حدودی به دردت بخوره:
public void printButton()
{
printDocument1.DefaultPageSettings.Landscape = true;
printPreviewDialog1.Document = printDocument1;
printPreviewDialog1.ShowDialog();
}

private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Bitmap bm = new Bitmap(Width, Height);
this.DrawToBitmap(bm, new Rectangle(0, 0, this.Width, this.Height));
e.Graphics.DrawImage(bm, 20, 20);
البته یه ذره باهاش ور برو تا بهتر فیکس فرمت بشه.