Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

I want to refresh data in crystal report from vb aplication

I want to refresh data in crystal report from vb aplication.

I am using MS Acess Database.

I had selected the option in crystal report option "refresh data on every print"

If I am giving discard saved data true from vb it gives the error.

Please guide me how to refresh the data from vb application.
0
prashant786
Asked:
prashant786
  • 4
  • 3
1 Solution
 
mlmccCommented:
What error do you get?

What code are you using in VB to display the report?

mlmcc
0
 
prashant786Author Commented:
There is no error

Old data is displayed. and it is not refreshed.

guide me how to refresh
0
 
mlmccCommented:
You said
>> If I am giving discard saved data true from vb it gives the error.


I don't think it takes a value

Try using before you open the report

crRpt.DiscardSavedData

mlmcc
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
mlmccCommented:
What code are you using to display the reports?

mlmcc
0
 
prashant786Author Commented:
I am using ocx. Code is as below :

rep.destination=crpttowindow
b=chr$(34) &text1.text & chr$(34)
d="{aa.kap}=" &b
rep.groupselectionformula = d
rep.action=1

If I am giving discard saved data then it is givin error :

unable to connect; incorrect log on parameters

So please solve my problem
0
 
prashant786Author Commented:
Hellooo please answer me mlmcc

waiting for your answer
0
 
mlmccCommented:
Here is the code I use    


cr_Generic_Report.ReportFileName = "C:\MyApp\Myreport\Report.rpt"
cr_Generic_Report.ReplaceSelectionFormula "{MyTable.MyField} >= 90"
cr_Generic_Report.WindowState = crptMaximized
cr_Generic_Report.Destination = crptToWindow
cr_Generic_Report.WindowShowCloseBtn = True
cr_Generic_Report.WindowShowPrintSetupBtn = True
cr_Generic_Report.Action = 1

mlmcc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now