Any of the Crystalreport toolbar icons not working

Rate It (1)

Last post 10-28-2009 5:14 PM by rujirek. 11 replies.

Sort Posts:

  • Any of the Crystalreport toolbar icons not working

    07-16-2009, 8:30 AM
    • Member
      14 point Member
    • enthusiast
    • Member since 09-22-2008, 1:22 PM
    • Posts 51

    Hi all, 


    I have implemented crystal report in my website as follows: 

    In .aspx page:

          <CR:CrystalReportViewer ID="myCrystalReportViewer" runat="server" AutoDataBind="true"
             Height="50px" Width="350px" style="position: absolute" EnableViewState="true" EnableParameterPrompt="false" ReuseParameterValuesOnRefresh="True" DisplayGroupTree="False" ShowAllPageIds="True" OnNavigate="myCrystalReportViewer_Navigate" />


       <CR:CrystalReportViewer ID="myCrystalReportViewer" runat="server" AutoDataBind="true" Height="50px" Width="350px" style="position: absolute" EnableViewState="true" EnableParameterPrompt="false" ReuseParameterValuesOnRefresh="True" DisplayGroupTree="False" ShowAllPageIds="True" OnNavigate="myCrystalReportViewer_Navigate" />


    In .aspx.vb page:


     Protected Sub cmdGenreport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdGenreport.Click
            reportSetup()
        End Sub
    
        Public Sub reportSetup()
            Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
            Dim strReportName As String = ""
            If IsPostBack Then
                myConnectionInfo.DatabaseName = "dbname"
                myConnectionInfo.ServerName = "servername"
                myConnectionInfo.UserID = "Username"
                myConnectionInfo.Password = "password"
                myConnectionInfo.Type = ConnectionInfoType.SQL
    
            End If
    
    
            report.Load(Server.MapPath("~/Report.rpt"))
            SetDBLogonForReport(myConnectionInfo, report)
            report.Refresh()
    
    
            'Load Session variables with values from web-controls
            Session("Semester") = Me.drpSemester.SelectedValue.ToString()
    
            Me.panparam.Visible = False
    
            'Load all parameter fields associated with the report into "fields" object
            Dim fields As ParameterFields
            fields = New CrystalDecisions.Shared.ParameterFields()
            fields = report.ParameterFields
    
    
            For Each field As ParameterField In fields
                report.SetParameterValue(field.Name, Session(field.Name))
            Next
    
            myCrystalReportViewer.ReportSource = report
        End Sub
    
    
        Protected Sub myCrystalReportViewer_Navigate(ByVal source As Object, ByVal e As CrystalDecisions.Web.NavigateEventArgs) Handles myCrystalReportViewer.Navigate
           
             report.FileName = Server.MapPath("~/Report.rpt")
             Dim fields As ParameterFields
            fields = New CrystalDecisions.Shared.ParameterFields()
            fields = report.ParameterFields
           
        End Sub


    This code is passing the parameter successfully and report is being generated, but any of the toolbar icons including export and navigation are not working. Whenever I click on the toolbat icons, the report is disappeared from the screen, showing the masterpage only. 


    I can not call the connection configuration from page_init because the report has to be called on the click event of the button I have in .aspx page. The icons are not working even on my local machine, so I do not think its because of some permission issues. And, aspnet_client folder is already in the same folder of the website. 


    It worked whem I did not have any of the programetically passed parameters and when connnection configuration was being called from page_init. 


    Please suggest me, what can I do to get rid of this problem. 


    Thank you,


  • Re: Any of the Crystalreport toolbar icons not working

    07-17-2009, 2:53 AM

    enthusiast thanks for your post.

    It's due to CR supporting images, js files, css files not configure correctly. So what you do is open

    Inetpub\wwwroot\ copy aspnet_client folder paste into your project root directory and build the application then run it, now it should work

    Any doubts please feel free to ask me.

    If this post is answer of your question then don't forgot to Click Mark As Answer.

    Thanks & Regards,
    J.Jeyaseelan
  • Re: Any of the Crystalreport toolbar icons not working

    07-17-2009, 3:00 AM
    Answer
    • Contributor
      2,730 point Contributor
    • CoolBond
    • Member since 10-25-2007, 1:34 PM
    • Country
    • Posts 535

     hi,

    On page load you need to call the report again. Since web sites are stateless, when ever you do a postback, you need to bind the report once again.

    in the cmdGenreport_Click event,

     after  myCrystalReportViewer.ReportSource = report

    save the report in a session variable or whatever best way to keep the data

    like Session["report1"]=report;

    and in the page load event (not inside !Ispostback, put in genral page load)

    protected void Page_Load(object sender, EventArgs e)
            {
                if (Session["report1"] != null)
                {
                    ReportDocument crReportDocument = (ReportDocument)Session["report1"];
                    myCrystalReportViewer.ReportSource = crReportDocument;
                }
             }

    Hope this will help you....

    " If people criticize you, hurt you, or shout at you,Don't be bothered. Just remember, In every game, audience make the noise, not the players "
  • Re: Any of the Crystalreport toolbar icons not working

    07-20-2009, 8:33 AM
    Answer
    • Member
      14 point Member
    • enthusiast
    • Member since 09-22-2008, 1:22 PM
    • Posts 51

    Thanks a lot CoolBond. It worked. 

    Smile

  • Re: Any of the Crystalreport toolbar icons not working

    07-27-2009, 1:05 PM
    • Member
      14 point Member
    • enthusiast
    • Member since 09-22-2008, 1:22 PM
    • Posts 51

    Hi,


    The report application has stopped working again.. whenever I click on the navigation buttons, it takes me back to the page where parameters are being asked. 


    I do have the session variable implemented. I have not made any changes, but do have added some link buttons. 


    Please help me. 

    Thanks

  • Re: Any of the Crystalreport toolbar icons not working

    07-28-2009, 2:05 AM
    • Contributor
      2,730 point Contributor
    • CoolBond
    • Member since 10-25-2007, 1:34 PM
    • Country
    • Posts 535

    Hi,

    But where do you have added the link buttons? Can you explain bit more

    Hope this will help you....

    " If people criticize you, hurt you, or shout at you,Don't be bothered. Just remember, In every game, audience make the noise, not the players "
  • Re: Any of the Crystalreport toolbar icons not working

    07-28-2009, 4:03 AM

    enthusiast thanks for your post.

    THis is due to your CR supporting files not configured well. So, open \Inetpub\wwwroot\ copy aspnet_client folder and paste into your root directory of the solution explorer.

    Any doubts please feel free to ask me.

    If this post is answer of your question then don't forgot to Click Mark As Answer.

    Thanks & Regards,
    J.Jeyaseelan
  • Re: Any of the Crystalreport toolbar icons not working

    07-28-2009, 8:13 AM
    • Member
      14 point Member
    • enthusiast
    • Member since 09-22-2008, 1:22 PM
    • Posts 51

    Jeyaseelan.. , I already have that folder. It was working fine and it has suddenly  stopped working after adding the two link buttons.

    Cool Bond! I added the link button in the .aspx page of the report where the parameters are being asked. The load event of the form is as follows :

     Dim CRreport As New ReportDocument
            myCrystalReportViewer.Visible = False 
            Me.panparam.Visible = True
            If Session("report1") IsNot Nothing Then
                CRreport = Session("report1")
                myCrystalReportViewer.ReportSource = CRreport
            End If
            MyConnection.Close()


    panparam is the panel where there are the controls to ask for the pasameters. 


    Seeking for your help,

    Thanks

  • Re: Any of the Crystalreport toolbar icons not working

    07-28-2009, 10:44 AM
    • Contributor
      2,730 point Contributor
    • CoolBond
    • Member since 10-25-2007, 1:34 PM
    • Country
    • Posts 535

    Hi,

    please post your complete code inside the page_load, bcz i can give some soluction based on my guess whatmight the code inside

    1. Dim CRreport As New ReportDocument  
    2.        myCrystalReportViewer.Visible = False   
    3.        Me.panparam.Visible = True  
    4.        If Session("report1") IsNot Nothing Then  
    5.            CRreport = Session("report1")  
    6.            myCrystalReportViewer.ReportSource = CRreport  
    7.        End If  
    8.        MyConnection.Close()

           If the code "Me.panparam.Visible = True" outside the !postback, it may show everytime when the page refresed. Its my assumption, I may help you bit more, if you post the complete page load code.

    Hope this will help you....

    " If people criticize you, hurt you, or shout at you,Don't be bothered. Just remember, In every game, audience make the noise, not the players "
  • Re: Any of the Crystalreport toolbar icons not working

    07-29-2009, 11:12 AM
    Answer
    • Member
      14 point Member
    • enthusiast
    • Member since 09-22-2008, 1:22 PM
    • Posts 51

    yes. That was the problem. I resolved the issue by changing the load event as follows:

     If Session("report1") IsNot Nothing Then
                report = Session("report1")
                myCrystalReportViewer.ReportSource = report
    
            Else
    
                Me.panparam.Visible = True
                myCrystalReportViewer.Visible = False
    
            End If
            MyConnection.Close()

    Thank you very much for helping me to solve the issue.

  • Re: Any of the Crystalreport toolbar icons not working

    10-22-2009, 5:37 AM

    hi sir all icons are visible in IE but when I click on the icon does not work. pls help me  

  • Re: Any of the Crystalreport toolbar icons not working

    10-28-2009, 5:14 PM
    • Member
      4 point Member
    • rujirek
    • Member since 10-28-2009, 5:13 PM
    • Posts 2

    Thanks so much, worked like a charm!Kiss 

Page 1 of 1 (12 items)