Hello dear,
I have in problem on crystal report ondinding event. I have an aspx page within a dropdown list and button and also a crystal report viewer. In normal situation everything is ok, But when i am trying to add ondatabinding event into report viewer. My button click event wont read value from dropdon list !!!! Please help me how can i read value from dropdown. My code is
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<CR:CrystalReportViewer ID="CrtViewer" runat="server" AutoDataBind="true"
ToolPanelView="None" ShowAllPageIds="True" ReuseParameterValuesOnRefresh="True"
OnDataBinding="CrtViewer_DataBinding" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="CrtViewer" />
</Triggers>
</asp:UpdatePanel>
ReportDataGateway rptGateway =new ReportDataGateway();
DataTable ds=new DataTable();
int projId = Convert.ToInt32(ddlEmpProject.Value); // facing problem here
string month = selectMonth.Value;
string year = selectYear.Value;
ds = rptGateway.GetPayReportByProjectAndMonth(projId, month, year);
PayRollReportByProjectAndYearAndMonth report = new PayRollReportByProjectAndYearAndMonth();
report.SetDataSource(ds);
CrtViewer.ReportSource = report;
CrtViewer.PDFOneClickPrinting = true;
CrtViewer.RefreshReport();