We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,913 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Multipage report

  1. database in access
  2. ADO is in use
  3. Datareport is designed.
  4. I have 40 records in Recordset.
  5. I want create one page per record in recordset.

It just create one page report for only first record

Private Sub Command1_Click()
Dim cnString As String
    Set rs = New ADODB.Recordset
    cnString = "Select * from Main"
    rs.Open cnString, cn, adOpenStatic, adLockOptimistic

    Set DataReport1.DataSource = rs
    If Not rs.EOF Then
        DataReport1.Sections(4).ForcePageBreak = rptPageBreakAfter
        DataReport1.Show
        rs.MoveNext
    End If
End Sub
3
Contributors
3
Replies
3 Days
Discussion Span
3 Months Ago
Last Updated
9
Views
dipankar_pr
Newbie Poster
5 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Change this part...

Set DataReport1.DataSource = rs
    If Not rs.EOF Then
        DataReport1.Sections(4).ForcePageBreak = rptPageBreakAfter
        DataReport1.Show
        rs.MoveNext
    End If

to ...

    If Not rs.EOF Then
        Set DataReport1.DataSource = rs

        DataReport1.Sections(4).ForcePageBreak = rptPageBreakAfter
        DataReport1.Show
        rs.MoveNext
    End If

I am not sure why you would want to show 40 seperate report pages though. It will consume large amounts of pc performance. Why not rather open just the record you want to view?

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

Each record row contain marks of a student and I like to create a marksheet for each shudent as datareport page.

dipankar_pr
Newbie Poster
5 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I see. No problem then.

Did my above answer solve the problem though?

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0620 seconds using 2.64MB