Break page in Printdocument in VB.Net

Asked

Viewed 220 times

1

I need a simple help I’m making a simple report with PrintDocument, however I am having difficulty to do so that it visualizes several pages. According to the record that is displayed in my datagrid.

Any ideas that might be useful in this process of my code?

I need you to show me the result of a record according to the history, in the case of the employee. It is only showing a page and incomplete information. I cannot implement this phase in the code I have.

For Each dr As DataGridViewRow In dgvRegistros.Rows
    'CODIGO 
    e.Graphics.DrawString("Nº REG.", New Font("Calibri", 10, FontStyle.Bold), Brushes.Black, 70, 270)
    e.Graphics.DrawString(dr.Cells(0).Value, New Font("Calibri", 10), Brushes.Black, 90, y)
    'TIPO
    e.Graphics.DrawString("TIPO", New Font("Calibri", 10, FontStyle.Bold), Brushes.Black, 120, 270)
    e.Graphics.DrawString(dr.Cells(3).Value, New Font("Calibri", 10), Brushes.Black, 120, y)
    'JUSTIFICATIVA
    e.Graphics.DrawString("JUSTIFICATIVA", New Font("Calibri", 10, FontStyle.Bold), Brushes.Black, 250, 270)
    e.Graphics.DrawString(dr.Cells(6).Value, New Font("Calibri", 10), Brushes.Black, 250, y)
    'DATA
    e.Graphics.DrawString("DATA", New Font("Calibri", 10, FontStyle.Bold), Brushes.Black, 660, 270)
    e.Graphics.DrawString(dr.Cells(4).Value, New Font("Calibri", 10), Brushes.Black, 660, y)
    'HORA
    e.Graphics.DrawString("HORA", New Font("Calibri", 10, FontStyle.Bold), Brushes.Black, 750, 270)
    e.Graphics.DrawString(dr.Cells(5).Value, New Font("Calibri", 10), Brushes.Black, 750, y)
    y += 20

    'LINHA 
    e.Graphics.DrawLine(New Pen(Color.Black, 1), 25, 290, 800, 290)
Next
  • 1

    -1 by the unnecessary CAPSLOCK.

  • I don’t understand. I’m sorry

  • You wrote the whole title in upper case (in upper case).

  • 1

    Would it hurt experienced users to edit the title? If you think it’s too much work to rewrite a sentence, you can make use of this wonderful tool called Convert Case. Remember that we are also site moderators and that means we’re here to help the newbies and show them how to "do right" and not just go out giving downvote and complaining. Setting a good example is a much more valuable attitude =)

  • After the http://answall.com/revisions/197343/3 the -1 has been removed.

  • sorry man, but today I entered and do not know yet the treatment of the forum, is not ignorance or arrogance, just did not know. but this is not the center point wanted to know if there is facility to help me in my problem.

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.