Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

XML
<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();
Posted
Comments
raj ch 29-Jul-13 3:23am    
write that code page load event
Member 9399759 29-Jul-13 23:50pm    
then how can i select value from drop down list ?
Member 9399759 29-Jul-13 5:06am    
then how can i select value from drop down list ?
raj ch 31-Jul-13 4:14am    
THEN WRITE THE CODE IN SELECTEDINDEXCHANGED EVENT

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900