Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Crystal Questions 1

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I have been asked to create a few reports using Crystal with the data source being Access. I don't have any experience with Crystal, but I have created reports in Access, FoxPro, and SQL Reporting Services. The requested reports are fairly basic with the usual type of filters, date ranges, type of record (from a list), user (from a list), etc. I've found a lot of information on the web and was wondering if someone could point to a few of their favorite resources for basic Crystal education. This seems kind of dumb, but after I create these reports, do I need to develop some kind of front end (.net or other) so the users can run the reports? I hope these questions aren't too basic for this forum. Thanks in advance.

Auguy
Northwest Ohio
 
The users can run the report within the crystal report designer itself, or you can buy a crystal report viewer. These are very cheap, datalink viewer from Millet Software is my favorite.
Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Check out To get access to the full set of books, it's a fairly minimal monthly fee and Brian's books are very good.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Thanks to both of you, those look like great resources.

Auguy
Northwest Ohio
 
I am trying to pass a date parameter to a CR using VB6 and CR 8.5 but am getting an invalid parameter value error? Any suggestions?

Dim strSQL As String
Dim dtStartDate As Date
Dim dtEndDate As Date

Dim strStartDate As Date
Dim strEndDate As Date

Dim dtMonth As Integer
Dim dtYear As Integer

Private Sub Command1_Click()

'clear out old data
Me.CrystalReport1.DiscardSavedData = True
Me.CrystalReport1.Reset

'reset all good params
Me.CrystalReport1.ReportFileName = "N:\Tims\REPORTS\Audit Report - Deleted Entries.rpt"
Me.CrystalReport1.Connect = "uid=tims;pwd=tims;"
Me.CrystalReport1.PrintFileType = crptRecord
Me.CrystalReport1.ReportSource = crptReport
Me.CrystalReport1.ReportTitle = "Audit Report - Deleted Entries"
Me.CrystalReport1.WindowTitle = "Reports: Audit Report - Deleted Entries"

'get the start and stop date for the report
GetDates Trim(str(Me.cboMonth.ListIndex + 1)), Trim(Me.cboYear.Text)

Me.CrystalReport1.ParameterFields(0) = "startdate;" & dtStartDate & ";false"
Me.CrystalReport1.ParameterFields(1) = "enddate;" & dtEndDate & ";false"

'MsgBox Me.CrystalReport1.ParameterFields(0) & " " & Me.CrystalReport1.ParameterFields(1)
Me.CrystalReport1.WindowState = crptMaximized
Me.CrystalReport1.Action = 1

End Sub

Private Sub Form_Load()

Dim strEndDay As String
Dim startYear As Integer
Dim endYear As Integer

Dim strMonth(1 To 12) As String
Dim i As Integer

strMonth(1) = "January"
strMonth(2) = "February"
strMonth(3) = "March"
strMonth(4) = "April"
strMonth(5) = "May"
strMonth(6) = "June"
strMonth(7) = "July"
strMonth(8) = "August"
strMonth(9) = "September"
strMonth(10) = "October"
strMonth(11) = "November"
strMonth(12) = "December"

'fill the combo box with the string array
For i = 1 To 12
Me.cboMonth.AddItem (strMonth(i))
Me.cboMonth.ItemData(Me.cboMonth.NewIndex) = i
Next

'get today's date month and year
dtMonth = DatePart("m", DateTime.Now) - 1
dtYear = DatePart("yyyy", DateTime.Now)

endYear = dtYear
startYear = endYear - 10

'set the display to the current month
Me.cboMonth.ListIndex = dtMonth

'fill the year combo box
For i = startYear To endYear
Me.cboYear.AddItem (str(i))
Me.cboYear.ItemData(Me.cboYear.NewIndex) = i
Next

'set the display to the current year
Me.cboYear.ListIndex = 10

End Sub

Function CheckForLeapYear(intYear As Integer)

'if the current year is completely divisible by 4 with no remainder then
'it is a leap year
If (intYear Mod 4 = 0) Then
CheckForLeapYear = True
Else 'not a leap year
CheckForLeapYear = False
End If

End Function

Sub GetDates(strMonth As String, strYear As String)

Dim isLeapYear As Boolean
Dim strEndDay As String

'get the starting date for the current request
Select Case cboMonth.ListIndex + 1
Case 1, 3, 5, 7, 8, 10, 12
strEndDay = "31"
Case 2
isLeapYear = CheckForLeapYear(dtYear)
If isLeapYear = True Then
strEndDay = "29"
Else
strEndDay = "28"
End If
Case Else
strEndDay = "30"
End Select

'strStartDate = strMonth & "/1/" & strYear & " 00:00:00AM"
'strEndDate = str(strMonth) & "/" + Trim(strEndDay) + strYear + " 23:59:59PM"

strStartDate = strMonth & "/1/" & strYear & " 00:00:00AM"
strEndDate = strMonth & "/" & strEndDay & "/" & strYear & " 23:59:59PM"

dtStartDate = CDate(strStartDate)
dtEndDate = CDate(strEndDate)

'MsgBox strStartDate & Chr(12) & Chr(13) & strEndDate
MsgBox dtStartDate & Chr(12) & Chr(13) & dtEndDate

'MsgBox strStartDate & " " & strEndDate

End Sub
 
Scottke,

You'll get a better response on this if you create a new thread.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top