Discussion Locked

Print the same data in 1 page(vb6)

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Can anyone tell me how do i print the same data repeat in 10 times on the same piece of paper using DATAREPORT in VB6. Thank you. :)

6 replies

by madestroitsolutions

Well, I don't really see why you would want to do something like this, but anyways, to start, the datareport needs to have a datasource, so assuming you use a database, create a temporary table, and move the record to display to this table, then assign 10 report textbox controls to the detail area, set the datasource of the report to the temp table, and the data field of the 10 controls to the fields. Since there is only one record, and all the boxes are assigned to the same field, it will display it 10 times.

good luck!

by poois

hello,
is not necessary to print 10 times, sometimes maybe 3 times, sometimes 5 times, this is depends on the user.

by sl-campbell

In the detail section add the text boxes desired.
Then create an additional detail sections, one below the previous one, and copy the text boxes into it. Do this until the page is full.
Then add a public variable to a Module that will hold the number of times the data is to be repeated. From the Form, add a control to allow the user to enter or select the number of copies and on the Control's Change event assign the Public variable to the value of the control.
In the Report, use the value ofthe variable to supress the detail sections. If the report has 10 detail sections, then starting with the last section, detail section no. 10, suppress it if the value of the variable < than 10. For the 9th section suppress it if the value of the variable < 9, and so forth.

This discussion is closed to new replies.