Geeks Talk

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.

crystalreportviewer control navigation button problem

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 ...

Go Back   Geeks Talk > Web Development > ASP.NET
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

ASP.NET ASP.NET and ASP Related Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2009
Junior Member
 
Join Date: Apr 2009
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
shree2312 is on a distinguished road
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
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-11-2009
Junior Member
 
Join Date: Apr 2009
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
shree2312 is on a distinguished road
Re: crystalreportviewer control navigation button problem

Hey i solved the issue ...thanq
Reply With Quote
  #3 (permalink)  
Old 08-12-2009
Junior Member
 
Join Date: Aug 2009
Location: Chennai
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
chinnakulandaiv is on a distinguished road
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
Reply With Quote
Reply

  Geeks Talk > Web Development > ASP.NET

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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


All times are GMT -4. The time now is 03:28 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved