1,105,281 Community Members

Multipage report

Member Avatar
dipankar_pr
Newbie Poster
5 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 
  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
Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
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?

Member Avatar
dipankar_pr
Newbie Poster
5 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

I see. No problem then.

Did my above answer solve the problem though?

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article