Results 1 to 7 of 7

Thread: [RESOLVED] data saved with report

  1. #1

    Thread Starter
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Resolved [RESOLVED] data saved with report

    This below code I am using to call report of prescription. I am using crystal report 8.0 & database is ACCESS 2000.
    but my problem is that when I add one more record into database it unable to display that record. I mean it only shows the data which is saved with that report. I tried with removing tick from "saved data with report" option but that give another error that "cannot connect SQL Server".
    In short my report is not "Refreshing" whenever I call that report so plz tell me is there any procedure to refresh that report at run time.


    VB Code:
    1. frmreport.CRreport.Connect = DE.Connection1
    2.         frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
    3.         str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
    4.         frmreport.CRreport.Destination = crptToWindow
    5.         frmreport.CRreport.WindowParentHandle = frmreport.hWnd
    6.         frmreport.CRreport.SelectionFormula = str
    7.         Screen.MousePointer = Default
    8.         frmreport.CRreport.Action = 1
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: data saved with report

    shirishdawane,

    Add

    VB Code:
    1. [B]frmreport.DiscardSavedData[/B]
    2.  
    3.         frmreport.CRreport.Connect = DE.Connection1
    4.         frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
    5.         str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
    6.         frmreport.CRreport.Destination = crptToWindow
    7.         frmreport.CRreport.WindowParentHandle = frmreport.hWnd
    8.         frmreport.CRreport.SelectionFormula = str
    9.         Screen.MousePointer = Default
    10.         frmreport.CRreport.Action = 1

  3. #3

    Thread Starter
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Re: data saved with report

    but where to write it coz i have tried as u told then it gives error
    "Compile error : Invalide use of proparty"

    VB Code:
    1. frmreport.CRreport.DiscardSavedData
    2.         frmreport.CRreport.Connect = DE.Connection1
    3.         frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
    4.         str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
    5.         frmreport.CRreport.Destination = crptToWindow
    6.         frmreport.CRreport.WindowParentHandle = frmreport.hWnd
    7.         frmreport.CRreport.SelectionFormula = str
    8.         Screen.MousePointer = Default
    9.         frmreport.CRreport.Action = 1
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: data saved with report

    shirishdawane,

    Sorry, I am sleepy. Here is the correct code.

    VB Code:
    1. [B]CRreport.DiscardSavedData[/B]
    2.  
    3.         frmreport.CRreport.Connect = DE.Connection1
    4.         frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
    5.         str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
    6.         frmreport.CRreport.Destination = crptToWindow
    7.         frmreport.CRreport.WindowParentHandle = frmreport.hWnd
    8.         frmreport.CRreport.SelectionFormula = str
    9.         Screen.MousePointer = Default
    10.         frmreport.CRreport.Action = 1

  5. #5

    Thread Starter
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Re: data saved with report

    sorry to disturb u but again it showing error that "Cannot open SQL Server"

    plz help
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  6. #6

    Thread Starter
    Hyperactive Member shirishdawane's Avatar
    Join Date
    Dec 2004
    Location
    Mumbai,India
    Posts
    363

    Unhappy Plz any1 help.. data saved with report

    I have searched in this forum but i have not got any satisfactory answer if any one knows plz tell me only this part of my project is remainig & i have to finish it by today itself otherwise my boss will kill me.
    On Error GoTo http://www.vbforums.com

    Note :
    1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
    2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: data saved with report

    shirishdawane,

    Then the problem is with your connection. Post what your connection code is.

    DE.Connection1?

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