Results 1 to 11 of 11

Thread: data report output still the same

  1. #1

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    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:
    1. Private Sub cmdProcessReport_Click()
    2.       deOrders.Commands(6).Parameters(0).Value = s_date
    3.       deOrders.Commands(6).Parameters(1).Value = e_date
    4.     End Sub
    5.    
    6.     Private Sub cmdViewReport_Click()
    7.        rptSalesReport.WindowState = vbMaximized
    8.        rptSalesReport.Show
    9.     End Sub
    Is this has something to do with the parameters passed to the data environment command qrySalesReport?

    Hoping for any response....

  2. #2
    Lively Member rush_shri's Avatar
    Join Date
    Dec 2005
    Location
    Pune,India
    Posts
    78

    Re: data report output still the same

    why don't you try "rptsalesreport.refresh" before passing parameters.

  3. #3

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: data report output still the same

    Hi rush_shri!

    I tried it already. Inserting the refresh before the parameters will display the report first, then an error message will appear. The message is Parameter1 has no default value..


  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: data report output still the same

    Are you using a client-side cursor?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: data report output still the same

    Greetings!!!!

    Yes, Im using (use client-side cursor) for my cursor location....


  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: data report output still the same

    Have you tried...

    VB Code:
    1. rptSalesReport.Refresh
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: data report output still the same

    Greetings!!!

    Yes, I've done that already....

    I placed the refresh before the passing of values code. It will generate an error message.I tried to insert the refresh after the code, the output doesnt change...


  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: data report output still the same

    Would you post all your code involve in that report-generation?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    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:
    1. Option Explicit
    2. Dim cnn As New ADODB.Connection
    3. Dim cmd As New ADODB.Command
    4. Dim prm1 As New ADODB.Parameter
    5. Dim prm2 As New ADODB.Parameter
    6. Dim rst As New ADODB.Recordset
    7. Dim strsql As String
    8.  
    9. Private Sub cmdExit_Click()
    10.     Set rst = Nothing
    11.     Set cnn = Nothing
    12.     Unload Me
    13. End Sub
    14.  
    15. Private Sub cmdProcessReport_Click()
    16.     Dim s_date As String
    17.     Dim e_date As String
    18.    
    19.    'dtPicker controls dtStart and dtEnd
    20.     s_date = dtStart.Value
    21.     e_date = dtEnd.Value
    22.    
    23.     deOrders.Commands(6).Parameters(0).Value = s_date
    24.     deOrders.Commands(6).Parameters(1).Value = e_date
    25.    
    26.     Print s_date & " " & e_date
    27.    
    28.     'With cmd
    29.     '   .ActiveConnection = cnn 'predefined connection object
    30.     '   .CommandType = adCmdText
    31.     '   .CommandText = "select * from qrySalesReport"
    32.     '   .Parameters(0) = DateValue(s_date)
    33.     '   .Parameters(1) = DateValue(e_date)
    34.     '    Set rst = cmd.Execute
    35.     'End With
    36.    
    37.     'With rptSalesReport
    38.     '    Set .DataSource = rst
    39.     '        .DataMember = rst.DataMember
    40.     'End With
    41.     'With cmd
    42.     '   Set .ActiveConnection = cnn
    43.       '.CreateParameter "[Starting Date]", adDate, adParamReturnValue, , DateValue(s_date)
    44.       '.CreateParameter "[Last Date]", adDate, adParamReturnValue, , DateValue(e_date)
    45.    
    46.       '.Parameters.Append cmd.CreateParameter("[Starting Date]", adDate, adParamInput, , CDate(s_date))
    47.       '.Parameters.Append cmd.CreateParameter("[Last Date]", adDate, adParamInput, , CDate(e_date))
    48.       '.CommandType = adCmdStoredProc
    49.       '.CommandText = "qrySalesReport"
    50.      
    51.      ' .CommandText = "Select * from qrySalesReport where OrderDate Between" &  #s_date# & "And" #e_date#
    52.       'Set rst = cmd.Execute
    53.    'End With
    54.     cmdViewReport.Enabled = True
    55.     txtStart.Text = s_date
    56.     txtEnd.Text = e_date
    57. End Sub
    58.  
    59. Private Sub cmdReset_Click()
    60.    
    61.     If dtStart.CheckBox = False Then
    62.         dtStart.Value = Null
    63.     End If
    64.     If dtEnd.CheckBox = False Then
    65.         dtEnd.Value = Null
    66.    End If
    67.    
    68.    
    69. End Sub
    70.  
    71.     Private Sub cmdViewReport_Click()
    72.         rptSalesReport.WindowState = vbMaximized
    73.         rptSalesReport.Refresh
    74.         rptSalesReport.Show
    75.     End Sub
    76.  
    77. Private Sub Form_Load()
    78.       cmdViewReport.Enabled = False
    79.       cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    80.       "Data Source=d:\POSSample\Orders.mdb;"
    81.       dtStart.CheckBox = True
    82.       dtEnd.CheckBox = True
    83. End Sub
    84.  
    85. Private Sub Form_Unload(Cancel As Integer)
    86.     Set rst = Nothing
    87.     Set cnn = Nothing
    88. 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?


  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  11. #11

    Thread Starter
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    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
  •  



Click Here to Expand Forum to Full Width