|
|
 |
BOOK: Professional Crystal Reports for VS.NET  | This is the forum to discuss the Wrox book Professional Crystal Reports for Visual Studio .NET by David McAmis; ISBN: 9780764544033 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional Crystal Reports for VS.NET section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 26th, 2005, 12:25 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Passing a Date Parameter
Hi i've followed chapter 4 about passing parameters which worked OK. So i changed the report to my own and again that worked.
I've now tried to pass two paramters and i now have a problem. The parameter is a Date and when the application is run the default paramter promt screen appears.
Below is my code. Please help
Imports CrystalDecisions.Shared
Public Class Form2
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents CrystalReportViewer1 As CrystalDecisions.Windows.Forms.CrystalReportViewer
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents DateTimePicker1 As System.Windows.Forms.DateTimePicker
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents cmdRedisplay As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.CrystalReportViewer1 = New CrystalDecisions.Windows.Forms.CrystalReportViewer
Me.Label1 = New System.Windows.Forms.Label
Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker
Me.Label2 = New System.Windows.Forms.Label
Me.cmdRedisplay = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'CrystalReportViewer1
'
Me.CrystalReportViewer1.ActiveViewIndex = -1
Me.CrystalReportViewer1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.CrystalReportViewer1.Location = New System.Drawing.Point(0, 160)
Me.CrystalReportViewer1.Name = "CrystalReportViewer1"
Me.CrystalReportViewer1.ReportSource = Nothing
Me.CrystalReportViewer1.Size = New System.Drawing.Size(680, 240)
Me.CrystalReportViewer1.TabIndex = 0
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(224, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(100, 24)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Supplier"
'
'DateTimePicker1
'
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short
Me.DateTimePicker1.Location = New System.Drawing.Point(8, 56)
Me.DateTimePicker1.Name = "DateTimePicker1"
Me.DateTimePicker1.Size = New System.Drawing.Size(120, 20)
Me.DateTimePicker1.TabIndex = 3
'
'Label2
'
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(8, 24)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(152, 32)
Me.Label2.TabIndex = 4
Me.Label2.Text = "Period End Date"
'
'cmdRedisplay
'
Me.cmdRedisplay.Location = New System.Drawing.Point(408, 88)
Me.cmdRedisplay.Name = "cmdRedisplay"
Me.cmdRedisplay.TabIndex = 5
Me.cmdRedisplay.Text = "Redisplay"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(216, 64)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.TabIndex = 6
Me.TextBox1.Text = "000370"
'
'Form2
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(680, 398)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.cmdRedisplay)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.DateTimePicker1)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.CrystalReportViewer1)
Me.Name = "Form2"
Me.Text = "Form2"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CrystalReportViewer1.DisplayGroupTree = False
End Sub
Private Sub cmdRedisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRedisplay.Click
Dim myParameterFields As New ParameterFields
Dim myParameterField As New ParameterField
Dim myDiscreteValue As New ParameterDiscreteValue
Dim myParameterFields2 As New ParameterFields
Dim myParameterField2 As New ParameterField
Dim myDiscreteValue2 As New ParameterDiscreteValue
myParameterField2.ParameterFieldName = "Supplier"
myDiscreteValue2.Value = TextBox1.Text
myParameterField2.CurrentValues.Add(myDiscreteValu e2)
myParameterField.ParameterFieldName = "Date"
myDiscreteValue.Value = DateTimePicker1.Text
myParameterField.CurrentValues.Add(myDiscreteValue )
myParameterFields.Add(myParameterField)
myParameterFields2.Add(myParameterField2)
CrystalReportViewer1.ParameterFieldInfo = myParameterFields
CrystalReportViewer1.ParameterFieldInfo = myParameterFields2
CrystalReportViewer1.ReportSource = New HORSALZERO
CrystalReportViewer1.Refresh()
End Sub
End Class
|

January 27th, 2005, 08:12 AM
|
|
Registered User
|
|
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Right it's not the date that is the problem it's passing a 2nd paramter in general.
Any HELP plz
|
| 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
|
|
|
|
 |