Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on crystalreportviewer control navigation button problem within the ASP.NET forums, part of the Web Development category; Hi, I am generating a monthly report using crystalreport...for that...I took 2 dropdownlist controls one for years and the other for months ...and one button for genarating report...after selecting the ...
|
|||||||
|
|||
|
crystalreportviewer control navigation button problem
Hi,
I am generating a monthly report using crystalreport...for that...I took 2 dropdownlist controls one for years and the other for months ...and one button for genarating report...after selecting the year and month.. finally we need to click button control...it loads data using crystalviewer control... Its loading the report...problem is that..when i click on "next navigation button" in crystalviewer control tool bar..the crystalreportviewer control is disappeared...i can see only dropdownlists and button...there is no crystalreportviewer control the code i have written ReportDocument rptDocument = new ReportDocument(); protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadMonths(); LoadYears(); } } public void LoadYears() { for (int i = 2008; i <= 9999; i++) { ddlYear.Items.Add(i.ToString()); } } public void LoadMonths() { DateTime month = Convert.ToDateTime("1/1/2000"); for (int i = 0; i < 12; i++) { DateTime NextMont = month.AddMonths(i); ListItem list = new ListItem(); list.Text = NextMont.ToString("MMMM"); list.Value = NextMont.Month.ToString(); ddlMonth.Items.Add(list); } protected void GenerateReport_Click(object sender, EventArgs e) { BindReport(); } public void BindReport() { ConnectionInfo cinfo = new ConnectionInfo(); cinfo.ServerName = "sivasree"; cinfo.DatabaseName = "Northwind"; cinfo.UserID = "sa"; cinfo.Password = "Passw0rd"; ParameterFields paramFields = new ParameterFields(); ParameterField paramField = new ParameterField(); paramField.Name = "@month"; ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue(); paramDiscreteValue.Value = ddlMonth.SelectedValue.ToString(); paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); paramField = new ParameterField(); paramField.Name = "@year"; paramDiscreteValue = new ParameterDiscreteValue(); paramDiscreteValue.Value = ddlYear.SelectedValue; paramField.CurrentValues.Add(paramDiscreteValue); paramFields.Add(paramField); CrystalReportViewer1.ParameterFieldInfo = paramFields; string rptPath = Server.MapPath("~/MonthlyEmployeeRpt.rpt"); rptDocument.Load(rptPath); CrystalReportViewer1.ReportSource = rptDocument; ConfigureCrystalReport(cinfo); } private void ConfigureCrystalReport(ConnectionInfo cinfo) { TableLogOnInfos tableLogOnInfos = CrystalReportViewer1.LogOnInfo; foreach (TableLogOnInfo tableLogOnInfo in tableLogOnInfos) { tableLogOnInfo.ConnectionInfo = cinfo; } CrystalReportViewer1.LogOnInfo = tableLogOnInfos; } plz help me.... thanks shree |
| Sponsored Links |
|
|||
|
Re: crystalreportviewer control navigation button problem
i think the problem was where u load the pages.
Just try code like below protected void Page_Load(object sender, EventArgs e) { //if (!IsPostBack) //{ LoadMonths(); LoadYears(); //} } dont use ispostback function to load the months and year... i think it will solve ur problem |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A problem when creating a new chart control | pyconan | PeopleSoft | 0 | 05-20-2008 05:42 AM |
| AJAX and the Back Button Problem | Lokesh M | AJAX & XML | 0 | 02-10-2008 04:57 AM |
| Navigation of AUT? | spd15 | Testing Issues | 4 | 05-22-2007 11:44 AM |
| What is navigation testing? | PCPATEL | Web Testing | 2 | 04-02-2007 03:08 AM |
| Dash Board Navigation | bvani | Testing Issues | 0 | 06-27-2006 02:54 PM |