crystal report默认绑定的标签是数据的字段名,但我用的是MYSQL数据库,当字段名为中文名时会出现乱码,我想先用英文字段名绑定然后在crystal report里修改成中文标签,这该如何操作呢,请各位大虾赐教。

解决方案 »

  1.   

    自从微软出了报表控件 就没再用水晶报表了
     你可以试下 将你的dataset.xss都用gb2312编码,然后 最好用宋体
      

  2.   

    先读到DataSet中,再绑定数据啊
      

  3.   

    先定义一个结构绑定到水晶报表    然后把数据库返回的DateTable表头修改到与结构匹配就行啊
      

  4.   

    http://topic.csdn.net/u/20080923/12/635b87d8-fe1e-4d03-a25d-e3e38dc0f8c1.htmlhttp://www.cnblogs.com/babyt/archive/2008/09/24/1297803.html
      

  5.   

    我最近也在做水晶报表是2005的以视图或表建立相应的数据集,在.CS页面通过程序读数据到DataSet中,再绑定数据这样不出问题的
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Data;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using System.Data.SqlClient;
    using TWXY_ADO;
    using TWXY_BLL;public partial class BB_BB_MX_TEST : System.Web.UI.Page
    {
        private ReportDocument customerReport = new ReportDocument();
        protected void Page_Load(object sender, EventArgs e)
        {
            string strWhere = "";        show(strWhere);
        }    protected void show(string sql)
        {
            string strPath = Server.MapPath("BB_MX_WLBIAO.rpt");
            customerReport.Load(strPath);        DataRow[] foundRows;
            string strsql = string.Empty;
            string strdis = string.Empty;        strsql = "SELECT ID,WLHAO,ABCLEI, GroupID FROM V_AAA where id <=50 and ( ABCLEI='A' or  ABCLEI='C' )  ORDER BY ABCLEI";
            DataSet ds = TWXY.Query(strsql.ToString());        ds.Tables[0].TableName = "V_AAA";        customerReport.SetDataSource(ds);
            this.CrystalReportViewer1.ReportSource = customerReport;
            MessageBox.ResponseScript(this, "loadCrystalPage();");
        }    private void Page_Unload(object sender, EventArgs e)
        {
            customerReport.Dispose();//rd为我这个页面定义的CrystalDecisions.CrystalReports.Engine.ReportDocument rd;
        }
    }这是我写的程序 希望对你有些帮助