• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Crystal Report

Hi Expert,

i wanna to display crystal report on the interface.The report need to pass a parameter in order to load it.The system require user to select what are the format of file they want to view the report.I have generate 4 options in combo boz for them to select : excel,word,pdf,report. I can get the output of report correctly by using excel,word,pdf format to load report.BUt i face the problem when i choosing report format and click a button, the output that display is not based on the date parameter that i choosing.
for example : i select 4/10/2005 date, but report show 3/31/2005 date and some more the output only show half data,means the data is not complete.If i choose 4/10/2005 date for pdf format the report's data is show correctly that what i expected. i have developed two main page : first page i differentiate if it is the report ,then i go to report.aspx else i go to file.aspx. The following is the coding when i click the button and it link to next page which is report.aspx.Can any one help me?

 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strDocNO As String
        Dim strReturnValue As String
        Dim strReturn() As String
        Dim strStatus As Integer

        Dim strFileName As String
        Dim ExportPath As String
        Dim crReportDocument As ReportDocument
        Dim oCrExport As New ipws.CRExport
        Dim strParameter() As String
        Dim strParamName As String

        If Session("LoginState") <> 1 Then
        End If

        crReportDocument = New BALANCESHEET10

        If oCrExport.Logon(crReportDocument) = False Then

            Response.Write("<script language='javascript'>alert('ERROR: Unable to login to database via crystal report.')</script>")
        End If
        strDocNO = Request.Params("DATEFROM")
        strParamName = Request.Params("rp")

        Dim ds = New DataSet("element1")


        CrystalReportViewer1.ReportSource = crReportDocument

        CrystalReportViewer1.HasDrillUpButton = True
        CrystalReportViewer1.HasRefreshButton = True
        CrystalReportViewer1.HasGotoPageButton = True
        CrystalReportViewer1.HasSearchButton = True
        CrystalReportViewer1.HasZoomFactorList = True
        crReportDocument.SetParameterValue(strParamName, strDocNO)
    End Sub
1 Solution
Hi sonny_j81,

 try setting the ParameterValues before setting the report source.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now