using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using BrightIdeasSoftware; namespace DatenDB { public class Report { public Report() { } public static Image Get_ListView_Report(OLVListItem listitems) { Bitmap bitmap = new Bitmap(1120, 790); Graphics g = Graphics.FromImage(bitmap); Pen pen = new Pen(Brushes.Black); Font kat1 = new Font("Arial", 20, FontStyle.Bold); Font kat2 = new Font("Arial", 12, FontStyle.Regular); Font kat3 = new Font("Arial", 8, FontStyle.Regular); //int y = 100; //int height = 100; //foreach (FahrerAuftrag auftrag in fahrerauftragliste) //{ // Rectangle rahmen = new Rectangle(50, y, 690, height); // g.DrawRectangle(pen, rahmen); // g.DrawLine(pen, new Point(50, y + (int)datum.Height), new Point(740, y + (int)datum.Height)); // g.DrawString(auftrag.Wann.ToShortDateString(), kat2, Brushes.Black, 50, y); // g.DrawString(auftrag.KundeNummer + " " + auftrag.Kunde, kat2, Brushes.Black, (790 / 2) - (g.MeasureString(auftrag.KundeNummer + " " + auftrag.Kunde, kat2).Width / 2), y); // g.DrawString(auftrag.Aufgabe, kat2, Brushes.Black, 740 - g.MeasureString(auftrag.Aufgabe, kat2).Width, y); // //ZUSATZ SCHREIBEN // g.DrawString("Zusatz:", kat2, Brushes.Black, 50, y + (int)datum.Height + 5); // if (g.MeasureString(auftrag.Zusatz, kat2).Width + 100 <= 790) g.DrawString(auftrag.Zusatz, kat2, Brushes.Black, 50, y + (int)datum.Height * 2 + 10); // else g.DrawString("Zusatztext zu lange. Bitte händisch hinzufügen.", kat2, Brushes.Black, 50, y + (int)datum.Height * 2 + 10); // y += height + 5; //}//AUFTRÄGE ERSTELLEN Image image = bitmap; return image; } } }