Ono sto sam do sada uradio je sledece
Code (csharp):
private void OnPrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Brush brush = new SolidBrush(richTextBox1.ForeColor);
Font font = new Font("Arial", 16.0f, FontStyle.Bold);
e.Graphics.DrawString(ImePrezime, font, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2);
e.Graphics.DrawString(Kompanija, font, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10);
Font font1 = new Font("Arial", 16.0f, FontStyle.Regular);
e.Graphics.DrawString(Ulica, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15);
e.Graphics.DrawString(Grad, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15 + font.Size + 8);
e.Graphics.DrawString(Drzava, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15 + font.Size + 8 + font.Size + 8);
}
private void OnPrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Brush brush = new SolidBrush(richTextBox1.ForeColor);
Font font = new Font("Arial", 16.0f, FontStyle.Bold);
e.Graphics.DrawString(ImePrezime, font, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2);
e.Graphics.DrawString(Kompanija, font, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10);
Font font1 = new Font("Arial", 16.0f, FontStyle.Regular);
e.Graphics.DrawString(Ulica, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15);
e.Graphics.DrawString(Grad, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15 + font.Size + 8);
e.Graphics.DrawString(Drzava, font1, brush, e.PageBounds.Width / 3 * 2, e.PageBounds.Height / 2 + font.Size + 10 + font.Size + 15 + font.Size + 8 + font.Size + 8);
}
i ako mu rucno dam vrednosti za ImePrezime, Kompaniju... u Form_Load, to u print preview-u izbaci kako treba. Ali gde ubacivati podatke iz baze u ove promenjive i kako ??? Znaci ako uzmem 10 podataka iz baze, on u PrintPreview-u treba da mi izbaci 10 strana sa razlicitim podacima. Verujem da je ovo neka prosta stvar, ali izgleda da vazi pravilo da su proste stvari i najteze :)
Ivan Urosevic