第一次使用水晶报表,柱状图的横竖坐标不会定位,怎么办?

 从昨天开始收集了很多制作水晶报表的资料,想自学成材,数据都从来效果了,但是就是柱状图的横竖坐标不会定位,发篇博客,有路过的帮帮忙,谢谢了。
以下是cs代码,
InBlock.gif 1using System; 
InBlock.gif 2using System.Collections; 
InBlock.gif 3using System.Configuration; 
InBlock.gif 4using System.Data; 
InBlock.gif 5using System.Linq; 
InBlock.gif 6using System.Web; 
InBlock.gif 7using System.Web.Security; 
InBlock.gif 8using System.Web.UI; 
InBlock.gif 9using System.Web.UI.HtmlControls; 
InBlock.gif10using System.Web.UI.WebControls; 
InBlock.gif11using System.Web.UI.WebControls.WebParts; 
InBlock.gif12using System.Xml.Linq; 
InBlock.gif13using System.Data.SqlClient; 
InBlock.gif14using CrystalDecisions.CrystalReports.Engine; 
InBlock.gif15using CrystalDecisions.Shared; 
InBlock.gif16 
InBlock.gif17public partial  class Teacher_fxlr : System.Web.UI.Page 
InBlock.gif18{ 
InBlock.gif19         string marketid; 
InBlock.gif20         string marketyear; 
InBlock.gif21         protected  void Page_Load( object sender, EventArgs e) 
InBlock.gif22        {    
InBlock.gif23                marketid =Session [ "marketid"].ToString (); 
InBlock.gif24 
InBlock.gif25         if (! this.IsPostBack) 
InBlock.gif26        { 
InBlock.gif27                yearlist(); 
InBlock.gif28                report(); 
InBlock.gif29                
InBlock.gif30        } 
InBlock.gif31                
InBlock.gif32        } 
InBlock.gif33         protected  void report() 
InBlock.gif34        { 
InBlock.gif35 
InBlock.gif36                 string constr = ConfigurationManager.ConnectionStrings[ "constr"].ConnectionString; 
InBlock.gif37                SqlConnection myconn =  new SqlConnection(constr); 
InBlock.gif38                myconn.Open(); 
InBlock.gif39                 //marketname--市场名称;marketyear--市场年份;projectname--企业名称,jlr--净利润;xssr--销售收入; 
InBlock.gif40                 //zyl--市场占有率=净利润/销售收入,条件是市场编号marketid等于session传的id值,marketyear等于年份的yearradiobutton的选项值。 
InBlock.gif41                 string sql =  "select marketname,marketyear,projectname,jlr,xssr,convert(varchar(10),(jlr*100/xssr))+'%' as zyl from fxlr where marketid='" + marketid +  "' and marketyear='" + marketyear +  "'"
InBlock.gif42                SqlDataAdapter myadr =  new SqlDataAdapter(sql, myconn); 
InBlock.gif43                lrDataSet ds =  new lrDataSet(); 
InBlock.gif44                myadr.Fill(ds,  "fxlr"); 
InBlock.gif45                ReportDocument myreport =  new ReportDocument(); 
InBlock.gif46                 string FilePath = Server.MapPath( "fxlr.rpt"); //映射到当前目录 
InBlock.gif47 
InBlock.gif48                 if (!myreport.IsLoaded) 
InBlock.gif49 
InBlock.gif50                        myreport.Load(FilePath); //加载报表 
InBlock.gif51 
InBlock.gif52 
InBlock.gif53                myreport.SetDataSource(ds); 
InBlock.gif54 
InBlock.gif55                CrystalReportViewer1.ReportSource = myreport; 
InBlock.gif56             
InBlock.gif57        } 
InBlock.gif58        /** <summary> 
InBlock.gif59         /// 加载市场年份 
InBlock.gif60         /// </summary> 
InBlock.gif61         protected  void yearlist() 
InBlock.gif62        { 
InBlock.gif63                DataOperate DO =  new DataOperate(); 
InBlock.gif64                yearbl.Items.Clear(); 
InBlock.gif65                 string sql =  "select marketyear from market where id='" + marketid +  "'"
InBlock.gif66                 int yearcount = DO.GetCount(sql); 
InBlock.gif67                 //增加初始年 
InBlock.gif68                ListItem LI =  new ListItem( "初始年""0"); 
InBlock.gif69                yearbl.Items.Add(LI); 
InBlock.gif70                yearbl.Items[0].Selected =  true
InBlock.gif71                 for ( int i = 1; i <= yearcount; i++) 
InBlock.gif72                { 
InBlock.gif73                        LI =  new ListItem( "第" + i +  "年", i.ToString()); 
InBlock.gif74                        yearbl.Items.Add(LI); 
InBlock.gif75                } 
InBlock.gif76        
InBlock.gif77        } 
InBlock.gif78        /** <summary> 
InBlock.gif79         /// 点击查看按钮发生的方法。 
InBlock.gif80         /// </summary> 
InBlock.gif81         /// <param name="sender"></param> 
InBlock.gif82         /// <param name="e"></param> 
InBlock.gif83         protected  void Button1_Click( object sender, EventArgs e) 
InBlock.gif84        { 
InBlock.gif85                marketyear=yearbl .SelectedValue; 
InBlock.gif86                report(); 
InBlock.gif87                
InBlock.gif88        } 
InBlock.gif89}
我想要的柱状图是按市场年份点击按钮,出现横坐标为企业的名字,纵坐标为企业的占有率
柱状图的是如下图配置的,但是效果不对,我该怎么配呢?
本文转自叶子文文博客51CTO博客,原文链接http://blog.51cto.com/leafwf/185701如需转载请自行联系原作者

叶子文文
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值