Crystal Report

Posted on 2005-04-28
Last Modified: 2010-04-07
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
Question by:sonny_j81
    1 Comment
    LVL 9

    Accepted Solution

    Hi sonny_j81,

     try setting the ParameterValues before setting the report source.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now