Can any body tell me the code procedure for preparing parameterized cristel reports.the report should be generated by taking to or more parameters.example: report should be genarated FROM DATE to TODATE

Showing Answers 1 - 5 of 5 Answers

Sutirtha

  • Dec 2nd, 2005
 

Create report with a view,and pass sql with fromDate and todate.

  Was this answer useful?  Yes

JAGAN.G

  • Aug 30th, 2006
 

We can generate Crystal Report by using date parameter, but the date format should be "yyyy,mm,dd".

Ex.  CrystaReport1.SelectionFormula = "{GLNOTE.L_DT} =  date(" & a & ")"

The variable 'a' should be assign with formated date

  Was this answer useful?  Yes

mubin4all

  • Apr 7th, 2009
 

'use this procedure for displaying crystal report with two date paramenters
Private Sub btnshow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshow.Click
        Dim cryRpt As New ReportDocument
        Dim crtableLogoninfos As New TableLogOnInfos
        Dim crtableLogoninfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim CrTables As Tables
        Dim CrTable As Table

        cryRpt.Load(My.Application.Info.DirectoryPath & "reportscashmemoreport.rpt")
        With crConnectionInfo
            .ServerName = ""
            .DatabaseName = My.Application.Info.DirectoryPath & "dbhms.mdb"
            .UserID = "admin"
            .Password = "admin"
        End With

        CrTables = cryRpt.Database.Tables
        For Each CrTable In CrTables
            crtableLogoninfo = CrTable.LogOnInfo
            crtableLogoninfo.ConnectionInfo = crConnectionInfo
            CrTable.ApplyLogOnInfo(crtableLogoninfo)
        Next
        Dim crParameterFieldDefinitions, crParameterFieldDefinitions1 As ParameterFieldDefinitions
        Dim crParameterFieldDefinition, crParameterFieldDefinition1 As ParameterFieldDefinition
        Dim crParameterValues, crParameterValues1 As New ParameterValues
        Dim crParameterDiscreteValue As New ParameterDiscreteValue
        Dim crParameterDiscreteValue1 As New ParameterDiscreteValue

        crParameterDiscreteValue.Value = dtprepbdate.Value
        crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields
        crParameterFieldDefinition = crParameterFieldDefinitions.Item("bdate")
        crParameterValues = crParameterFieldDefinition.CurrentValues
        crParameterValues.Clear()
        crParameterValues.Add(crParameterDiscreteValue)
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

        crParameterDiscreteValue1.Value = dtprepedate.Value
        crParameterFieldDefinitions1 = cryRpt.DataDefinition.ParameterFields
        crParameterFieldDefinition1 = crParameterFieldDefinitions.Item("edate")
        crParameterValues1 = crParameterFieldDefinition.CurrentValues
        crParameterValues1.Clear()
        crParameterValues1.Add(crParameterDiscreteValue1)
        crParameterFieldDefinition1.ApplyCurrentValues(crParameterValues1)

        crvdcashmemo.ReportSource = cryRpt
        crvdcashmemo.Refresh()

    End Sub

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions