| |
support.activereports.general
Started by webadmin@datadynamics.com at 08-29-2003 12:00 AM. Topic has 3 replies.
 
 
|
|
Sort Posts:
|
|
|
|
08-29-2003, 12:00 AM
|
webadmin@datadynamics.com
Joined on 12-12-2005
Posts 0
|
|
|
Originally Posted By: Bob Leffew<bobleffew@harwood-intl.com>
I have a trial balance (print report) that I set up a Customer Number as Group and Invoice as the sub group:
Customer # Customer Name
Invoice No Type Invoice Date Inv Amt Current Over 30 Over 90
I have the formula to calculate whether the Invoice Date is current, over 30 days or over 90 days.
I set up fields for the Current, Over 30, Over 90.
Program only wants to populate my fields that are in the database.
How do I read invidual records and populate printfields record by record then print results out.
Normally I have just the ADO and printed straight from recordset.
Below is my code:
|
|
|
|
|
Report
|
|
|
|
08-29-2003, 12:00 AM
|
webadmin@datadynamics.com
Joined on 12-12-2005
Posts 0
|
|
|
Originally Posted By: Bob Leffew<bobleffew@harwood-intl.com>
Forgot code:
Private Sub ActiveReport_ReportStart() modMakeConnection.OpenConnection Set rsAR = New ADODB.Recordset rsAR.CursorLocation = adUseClient rsAR.Open "Select * From ARTrialBalanceQ1", _ modMakeConnection.cnPricebook, adOpenDynamic, adLockOptimistic
If rsAR.RecordCount = 0 Then Exit Sub
rsAR.MoveLast rsAR.MoveFirst End Sub
Private Sub Detail_Format()
Do Until rsAR.EOF
Current = 0 Over30 = 0 Over60 = 0 Over90 = 0
Period = DateDiff("d", AgeDate, rsAR!TransDate)
If Period < 0 Then Period = Period * (-1)
Select Case Period
Case Is <= 30 Current = rsAR!TransAmt
Case 31 To 60 Over30 = rsAR!TransAmt
Case 61 To 90 Over60 = rsAR!TransAmt
Case Is > 90 Over90 = rsAR!TransAmt
End Select
fldCurrent.Text = Current fldOver30.Text = Over30 fldOver60.Text = Over60 fldOver90.Text = Over90
rsAR.MoveNext
Loop End Sub
"Bob Leffew" wrote in message news:dyNUWtjbDHA.140@dynaweb.datadynamics.com... > I have a trial balance (print report) that I set up a Customer Number as > Group and Invoice as the sub group: > > Customer # Customer Name > > Invoice No Type Invoice Date Inv Amt Current Over 30 Over > 90 > > I have the formula to calculate whether the Invoice Date is current, over 30 > days or over 90 days. > > I set up fields for the Current, Over 30, Over 90. > > Program only wants to populate my fields that are in the database. > > How do I read invidual records and populate printfields record by record > then print results out. > > Normally I have just the ADO and printed straight from recordset. > > > Below is my code: > > >
|
|
|
|
|
Report
|
|
|
|
08-29-2003, 12:00 AM
|
webadmin@datadynamics.com
Joined on 12-12-2005
Posts 0
|
|
|
Originally Posted By: Bob Leffew<bobleffew@harwood-intl.com>
I also tried this but it just printed the first line.
Then I have to figure out to print out my group totals and grand total.
Private Sub ActiveReport_DataInitialize() modMakeConnection.OpenConnection Set rsAR = New ADODB.Recordset rsAR.CursorLocation = adUseClient rsAR.Open "Select * From ARTrialBalanceQ1", _ modMakeConnection.cnPricebook, adOpenDynamic, adLockOptimistic
If rsAR.RecordCount = 0 Then Exit Sub
rsAR.MoveLast rsAR.MoveFirst End Sub
Private Sub ActiveReport_FetchData(EOF As Boolean)
Current = 0 Over30 = 0 Over60 = 0 Over90 = 0
Period = DateDiff("d", AgeDate, rsAR!Transdate)
If Period < 0 Then Period = Period * (-1)
Select Case Period
Case Is <= 30 Current = rsAR!TransAmt
Case 31 To 60 Over30 = rsAR!TransAmt
Case 61 To 90 Over60 = rsAR!TransAmt
Case Is > 90 Over90 = rsAR!TransAmt
End Select
txtInvoiceNumber.Text = rsAR!InvoiceNumber txtTransCode.Text = rsAR!Description txtTransDate.Text = rsAR!Transdate txtTransAmt.Text = rsAR!TransAmt fldCurrent.Text = Current fldOver30.Text = Over30 fldOver60.Text = Over60 fldOver90.Text = Over90
rsAR.MoveNext
End Sub
"Bob Leffew" wrote in message news:eSUt6tjbDHA.376@dynaweb.datadynamics.com... > Forgot code: > > Private Sub ActiveReport_ReportStart() > modMakeConnection.OpenConnection > Set rsAR = New ADODB.Recordset > rsAR.CursorLocation = adUseClient > rsAR.Open "Select * From ARTrialBalanceQ1", _ > modMakeConnection.cnPricebook, adOpenDynamic, adLockOptimistic > > If rsAR.RecordCount = 0 Then Exit Sub > > rsAR.MoveLast > rsAR.MoveFirst > End Sub > > Private Sub Detail_Format() > > Do Until rsAR.EOF > > Current = 0 > Over30 = 0 > Over60 = 0 > Over90 = 0 > > Period = DateDiff("d", AgeDate, rsAR!TransDate) > > > If Period < 0 Then Period = Period * (-1) > > Select Case Period > > Case Is <= 30 > Current = rsAR!TransAmt > > Case 31 To 60 > Over30 = rsAR!TransAmt > > Case 61 To 90 > Over60 = rsAR!TransAmt > > Case Is > 90 > Over90 = rsAR!TransAmt > > End Select > > fldCurrent.Text = Current > fldOver30.Text = Over30 > fldOver60.Text = Over60 > fldOver90.Text = Over90 > > rsAR.MoveNext > > Loop > End Sub > > > "Bob Leffew" wrote in message > news:dyNUWtjbDHA.140@dynaweb.datadynamics.com... > > I have a trial balance (print report) that I set up a Customer Number as > > Group and Invoice as the sub group: > > > > Customer # Customer Name > > > > Invoice No Type Invoice Date Inv Amt Current Over 30 > Over > > 90 > > > > I have the formula to calculate whether the Invoice Date is current, over > 30 > > days or over 90 days. > > > > I set up fields for the Current, Over 30, Over 90. > > > > Program only wants to populate my fields that are in the database. > > > > How do I read invidual records and populate printfields record by record > > then print results out. > > > > Normally I have just the ADO and printed straight from recordset. > > > > > > Below is my code: > > > > > > > >
|
|
|
|
|
Report
|
|
|
|
08-29-2003, 12:00 AM
|
webadmin@datadynamics.com
Joined on 12-12-2005
Posts 0
|
|
|
Originally Posted By: Bob Leffew<bobleffew@harwood-intl.com>
Is my question to stupid to be answered?
Where can I read on how to do this?
Bob
"Bob Leffew" wrote in message news:ffm%23N6jbDHA.376@dynaweb.datadynamics.com... > I also tried this but it just printed the first line. > > Then I have to figure out to print out my group totals and grand total. > > Private Sub ActiveReport_DataInitialize() > modMakeConnection.OpenConnection > Set rsAR = New ADODB.Recordset > rsAR.CursorLocation = adUseClient > rsAR.Open "Select * From ARTrialBalanceQ1", _ > modMakeConnection.cnPricebook, adOpenDynamic, adLockOptimistic > > If rsAR.RecordCount = 0 Then Exit Sub > > rsAR.MoveLast > rsAR.MoveFirst > End Sub > > Private Sub ActiveReport_FetchData(EOF As Boolean) > > Current = 0 > Over30 = 0 > Over60 = 0 > Over90 = 0 > > Period = DateDiff("d", AgeDate, rsAR!Transdate) > > > If Period < 0 Then Period = Period * (-1) > > Select Case Period > > Case Is <= 30 > Current = rsAR!TransAmt > > Case 31 To 60 > Over30 = rsAR!TransAmt > > Case 61 To 90 > Over60 = rsAR!TransAmt > > Case Is > 90 > Over90 = rsAR!TransAmt > > End Select > > txtInvoiceNumber.Text = rsAR!InvoiceNumber > txtTransCode.Text = rsAR!Description > txtTransDate.Text = rsAR!Transdate > txtTransAmt.Text = rsAR!TransAmt > fldCurrent.Text = Current > fldOver30.Text = Over30 > fldOver60.Text = Over60 > fldOver90.Text = Over90 > > rsAR.MoveNext > > End Sub > > "Bob Leffew" wrote in message > news:eSUt6tjbDHA.376@dynaweb.datadynamics.com... > > Forgot code: > > > > Private Sub ActiveReport_ReportStart() > > modMakeConnection.OpenConnection > > Set rsAR = New ADODB.Recordset > > rsAR.CursorLocation = adUseClient > > rsAR.Open "Select * From ARTrialBalanceQ1", _ > > modMakeConnection.cnPricebook, adOpenDynamic, adLockOptimistic > > > > If rsAR.RecordCount = 0 Then Exit Sub > > > > rsAR.MoveLast > > rsAR.MoveFirst > > End Sub > > > > Private Sub Detail_Format() > > > > Do Until rsAR.EOF > > > > Current = 0 > > Over30 = 0 > > Over60 = 0 > > Over90 = 0 > > > > Period = DateDiff("d", AgeDate, rsAR!TransDate) > > > > > > If Period < 0 Then Period = Period * (-1) > > > > Select Case Period > > > > Case Is <= 30 > > Current = rsAR!TransAmt > > > > Case 31 To 60 > > Over30 = rsAR!TransAmt > > > > Case 61 To 90 > > Over60 = rsAR!TransAmt > > > > Case Is > 90 > > Over90 = rsAR!TransAmt > > > > End Select > > > > fldCurrent.Text = Current > > fldOver30.Text = Over30 > > fldOver60.Text = Over60 > > fldOver90.Text = Over90 > > > > rsAR.MoveNext > > > > Loop > > End Sub > > > > > > "Bob Leffew" wrote in message > > news:dyNUWtjbDHA.140@dynaweb.datadynamics.com... > > > I have a trial balance (print report) that I set up a Customer Number as > > > Group and Invoice as the sub group: > > > > > > Customer # Customer Name > > > > > > Invoice No Type Invoice Date Inv Amt Current Over 30 > > Over > > > 90 > > > > > > I have the formula to calculate whether the Invoice Date is current, > over > > 30 > > > days or over 90 days. > > > > > > I set up fields for the Current, Over 30, Over 90. > > > > > > Program only wants to populate my fields that are in the database. > > > > > > How do I read invidual records and populate printfields record by record > > > then print results out. > > > > > > Normally I have just the ADO and printed straight from recordset. > > > > > > > > > Below is my code: > > > > > > > > > > > > > > >
|
|
|
|
|
Report
|
|
|
|
|
GrapeCity » Forum Archives » support.activer... » Re: Newbie question
|
|
|
|
|