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,