|
-
Dec 8th, 2005, 10:15 PM
#1
data report output still the same
Hi to all!
I have a problem with my data report.
when I pass these values to the parameters for the first time, it will produce the output correctly. On the second processing, the output will never change. The output is still the same.
An example is when I input values for dates of sales that occured in range with November 11 - November 16, it will produce the correct output. However, in the second processing like I input values like dates December 1 and December 25, the output does not change. It will display the sales from November 11 - November 16.
Here is the code...
VB Code:
Private Sub cmdProcessReport_Click()
deOrders.Commands(6).Parameters(0).Value = s_date
deOrders.Commands(6).Parameters(1).Value = e_date
End Sub
Private Sub cmdViewReport_Click()
rptSalesReport.WindowState = vbMaximized
rptSalesReport.Show
End Sub
Is this has something to do with the parameters passed to the data environment command qrySalesReport?
Hoping for any response....
-
Dec 8th, 2005, 10:40 PM
#2
Lively Member
Re: data report output still the same
why don't you try "rptsalesreport.refresh" before passing parameters.
-
Dec 8th, 2005, 11:20 PM
#3
-
Dec 8th, 2005, 11:41 PM
#4
Re: data report output still the same
Are you using a client-side cursor?
-
Dec 9th, 2005, 12:05 AM
#5
-
Dec 9th, 2005, 12:07 AM
#6
Re: data report output still the same
-
Dec 9th, 2005, 12:11 AM
#7
-
Dec 9th, 2005, 12:31 AM
#8
Re: data report output still the same
Would you post all your code involve in that report-generation?
-
Dec 9th, 2005, 12:47 AM
#9
Re: data report output still the same
Hi.....
Here is the code for my report generation form (frmSalesReport)..
The codes with comment are the previous solutions I've used...
This code that I've posted a while ago was working though with errors on the result of data report...
VB Code:
Option Explicit
Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim prm1 As New ADODB.Parameter
Dim prm2 As New ADODB.Parameter
Dim rst As New ADODB.Recordset
Dim strsql As String
Private Sub cmdExit_Click()
Set rst = Nothing
Set cnn = Nothing
Unload Me
End Sub
Private Sub cmdProcessReport_Click()
Dim s_date As String
Dim e_date As String
'dtPicker controls dtStart and dtEnd
s_date = dtStart.Value
e_date = dtEnd.Value
deOrders.Commands(6).Parameters(0).Value = s_date
deOrders.Commands(6).Parameters(1).Value = e_date
Print s_date & " " & e_date
'With cmd
' .ActiveConnection = cnn 'predefined connection object
' .CommandType = adCmdText
' .CommandText = "select * from qrySalesReport"
' .Parameters(0) = DateValue(s_date)
' .Parameters(1) = DateValue(e_date)
' Set rst = cmd.Execute
'End With
'With rptSalesReport
' Set .DataSource = rst
' .DataMember = rst.DataMember
'End With
'With cmd
' Set .ActiveConnection = cnn
'.CreateParameter "[Starting Date]", adDate, adParamReturnValue, , DateValue(s_date)
'.CreateParameter "[Last Date]", adDate, adParamReturnValue, , DateValue(e_date)
'.Parameters.Append cmd.CreateParameter("[Starting Date]", adDate, adParamInput, , CDate(s_date))
'.Parameters.Append cmd.CreateParameter("[Last Date]", adDate, adParamInput, , CDate(e_date))
'.CommandType = adCmdStoredProc
'.CommandText = "qrySalesReport"
' .CommandText = "Select * from qrySalesReport where OrderDate Between" & #s_date# & "And" #e_date#
'Set rst = cmd.Execute
'End With
cmdViewReport.Enabled = True
txtStart.Text = s_date
txtEnd.Text = e_date
End Sub
Private Sub cmdReset_Click()
If dtStart.CheckBox = False Then
dtStart.Value = Null
End If
If dtEnd.CheckBox = False Then
dtEnd.Value = Null
End If
End Sub
Private Sub cmdViewReport_Click()
rptSalesReport.WindowState = vbMaximized
rptSalesReport.Refresh
rptSalesReport.Show
End Sub
Private Sub Form_Load()
cmdViewReport.Enabled = False
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=d:\POSSample\Orders.mdb;"
dtStart.CheckBox = True
dtEnd.CheckBox = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set rst = Nothing
Set cnn = Nothing
End Sub
Is the problem has something to do with the value property of the command in my data environment? How do I make sure if the parameters being passed will take effect and will replace the old values?
-
Dec 9th, 2005, 12:57 AM
#10
Re: data report output still the same
Crystal, right? Open the report, and under the File menu... make sure the "Save Data With Report" option is TURNED OFF. For what ever reason, this is turned on by default. We ran into this problem we ran into early on with CR until some one figured it out.
-tg
-
Dec 9th, 2005, 01:03 AM
#11
Re: data report output still the same
Hi!!!
Im still using the built in data report designer....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|