|
-
Jan 31st, 2005, 10:29 AM
#1
Thread Starter
New Member
Two Parameters
Right i've followed a guide and got a VB program working with Crystal Reports. So i added my own report and that worked ok.
Now i want to pass two parameters to the report. This is where i need help, i've googled but can't find any guides/samples that pass two parameters e.g. Date and Supplier.
Below is the code for passing just one parameter. Anyone able to modify it so i can pass two. Thanks
VB Code:
Imports CrystalDecisions.Shared
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.ShowPrintButton = True
End Sub
Private Sub Button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myParameterFields As New ParameterFields
Dim myParameterField As New ParameterField
Dim myDiscreteValue As New ParameterDiscreteValue
myParameterField.ParameterFieldName = "DataDate"
myDiscreteValue.Value = DateTimePicker1.Text
myParameterField.CurrentValues.Add(myDiscreteValue )
myParameterFields.Add(myParameterField)
CrystalReportViewer1.ParameterFieldInfo = myParameterFields
CrystalReportViewer1.ReportSource = New CCReport
CrystalReportViewer1.Refresh()
End Sub
End Class
I've tried passing two parameters but only one seems to work. Sorry but i'm a bit of a newbie to both Crystal Reports and VB
-
Jan 31st, 2005, 05:26 PM
#2
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 1st, 2005, 04:12 AM
#3
Thread Starter
New Member
Re: Two Parameters
Thanks for the reply.
I've had a look at that thread but not sure how to mod my code to allow the second parameter.
Sorry for being such a newbie. 
Should i of said i'm trying to do an windows application not Web site
Last edited by [ego]mouse; Feb 1st, 2005 at 09:19 AM.
-
Feb 1st, 2005, 12:13 PM
#4
Re: Two Parameters
Not a prob. I havent used CR in .NET yet, but I will try. You can .Add the
first parameter to the Parameters collection. You can access them by doing
something like...
VB Code:
myParameterFields.Items(1).ClearCurrentValueAndRange
myParameterFields.Items(1).Add strValue1
myParameterFields.Items(2).ClearCurrentValueAndRange
myParameterFields.Items(2).Add strValue2
I think something like this will work for you. In the link I posted the post that
is most relevant is #11.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 2nd, 2005, 03:57 AM
#5
Thread Starter
New Member
Re: Two Parameters
God i hate VB hehehehe.
Still no joy. Is there anyone that actual codes VB with Crystal Reports in them. Looks like i may have to pay someone to do it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|