Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 23rd, 2009, 03:36 AM
Registered User
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Parameters to Crystal Reports 8.5 using VB6

I used parameter fields in my crystal report and was able to pass parameters to it from my Visual Basic program. But the problem is the dialog box that keeps appearing asking me to enter the parameters. The discrete values have the same values as the parameters being passed. I do not want to enter the values again. How do I remove the dialog box?

My code:

Code:
Dim CRApp As New CRAXDRT.Application
Dim CRReport As New CRAXDRT.Report   'crystal report object
Dim CrtParameters As CRAXDRT.ParameterFieldDefinitions
Dim sRPTFile As String
Dim simula As String
Dim tapos As String
sRPTFile = App.Path & "\01653.rpt"
Set CRReport = CRApp.OpenReport(sRPTFile)

    simula = Format(DTPicker1.Value, "YYYY/MM/DD")
    tapos = Format(DTPicker2.Value, "YYYY/MM/DD")
    
    With CRReport
        .DiscardSavedData
        .Database.Tables.Item(1).SetLogOnInfo odbcname, odbcname,sysuserid, syspassword
        Set CrtParameters = CRReport.ParameterFields
        .ParameterFields.GetItemByName("@begdate").AddDefaultValue simula
        .ParameterFields.GetItemByName("@enddate").AddDefaultValue tapos
    End With

    'Show Report
    CRViewer1.ReportSource = CRReport
    CRViewer1.EnableExportButton = True
    CRViewer1.DisplayGroupTree = False
    CRViewer1.EnableDrillDown = True
    CRViewer1.EnableDrillDown = False
    CRViewer1.EnableCloseButton = True
    CRViewer1.ViewReport
    CRViewer1.Zoom (100)
    CRViewer1.Visible = True
    CRViewer1.ZOrder 0
Thanks in advance for helping.
Reply With Quote
  #2 (permalink)  
Old December 28th, 2009, 09:04 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,190
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hello..

If CR is asking for parameters, Then you are not passing them correctly, you have more parameters that you think, the query to the database from the report is wrong or some formulas are empty and are expecting a value...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameters to crystal reports at runtime tbhakee Crystal Reports 14 September 11th, 2013 05:49 AM
passing parameters to crystal reports Shubhi ASP.NET 2.0 Professional 0 July 4th, 2008 02:18 AM
Passing parameters w/o prompt to Crystal Reports VannAustin BOOK: Professional Crystal Reports for VS.NET 1 August 31st, 2006 08:46 AM
Passing Parameters to crystal reports through codi secrets Crystal Reports 0 April 5th, 2005 01:44 PM
Passing parameters w/o prompt to Crystal reports VannAustin VB How-To 0 March 2nd, 2005 01:16 AM



All times are GMT -4. The time now is 09:07 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.