|
|
 |
| 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, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

December 23rd, 2009, 03:36 AM
|
|
Registered User
|
|
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 28th, 2009, 09:04 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,104
Thanks: 5
Thanked 51 Times in 49 Posts
|
|
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.
================================================== =========
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |