[dba-VB] Active Reports for Visual Basic 6

Gary Ray GRAY at utah.gov
Fri Mar 14 08:56:29 CST 2003


This is some code I am using in an Active Reports designer that works
for me.  It is based on the code in Chapter 6 of the manual "Unbound
Reporting and Grouping"
 
Private Sub ActiveReport_DataInitialize()
    Set mRS = New ADODB.Recordset
    '---This report gets its recordset from a custom Activex control's
property
    Set mRS = frmMain.ActiveControl.GetSummaryRS
    mRS.MoveFirst
    With Fields
        .Add "Category"
        .Add "Boundaries"
        .Add "Obs"
        .Add "Percent"
    End With
End Sub
 

Private Sub ActiveReport_FetchData(EOF As Boolean)
    
    'If mRS.EOF = True Then Exit Sub
    If Not mRS.EOF Then
        '---Sets ActiveReports fields collection values to mRS values
        Fields("Category").Value = mRS!Category
        Fields("Boundaries").Value = mRS!Boundaries
        Fields("Obs").Value = mRS!Obs
        Fields("Percent").Value = mRS!Percent
    End If
    
    If Not mRS.EOF Then
        '---If not at the EOF then set FetchData's EOF value to false
        EOF = False
        '---Advance the RS
        mRS.MoveNext
    End If
 
End Sub
 
Gary Ray - Application Developer
Workforce Information Systems R & D
E-Mail gray at utah.gov

>>> paul.hartland at fsmail.net 03/14/03 02:42AM >>>
To all,

Has anyone had any experience with Active Reports v2.0 for Visual
Basic, if so I wondered if someone could help me with somthing (bearing
in mind I only started using it yesterday).  I have built a report using
the ADO connector and I need it to buils the recordset on the fly. So I
am trying to use the following method.....

repPersonnelByOffice.dcRptData.Recordset = "SELECT * FROM
[tblPersonnel] WHERE [FinishDate] Is Null ORDER BY [Office], [Surname]"

But I get the error Type Mismatch and the whole line gets highlighted
when I click debug.  Now I can't see anything wrong with this, can
anyone point out my mistakes please.......

Thanks in advance.

Paul Hartland

__________________________________________________________________________
Freeserve AnyTime - Go online whenever you want for just £6.99 a month
for
your first 3 months, that's HALF PRICE! And then it's just £14.99 a
month
after that.

For more information visit http://www.freeserve.com/time/ or call free
on 
0800 970 8890


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com 
http://databaseadvisors.com/mailman/listinfo/dba-vb 
http://www.databaseadvisors.com 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-vb/attachments/20030314/43e78e90/attachment-0003.html>


More information about the dba-VB mailing list