困扰了好几个月的高难度问题
crystal report默认绑定的标签是数据的字段名,但我用的是MYSQL数据库,当字段名为中文名时会出现乱码,我想先用英文字段名绑定然后在crystal report里修改成中文标签,这该如何操作呢,请各位大虾赐教。 --------------------编程问答-------------------- 郁闷,这个问题居然没人会 --------------------编程问答-------------------- 自从微软出了报表控件 就没再用水晶报表了你可以试下 将你的dataset.xss都用gb2312编码,然后 最好用宋体 --------------------编程问答-------------------- fkg --------------------编程问答-------------------- 先读到DataSet中,再绑定数据啊 --------------------编程问答-------------------- 先定义一个结构绑定到水晶报表 然后把数据库返回的DateTable表头修改到与结构匹配就行啊 --------------------编程问答-------------------- 用资源文件保留对应的中文跟英文字段名,然后可以对数据源的字段名进行转换 --------------------编程问答-------------------- http://topic.csdn.net/u/20080923/12/635b87d8-fe1e-4d03-a25d-e3e38dc0f8c1.html
http://www.cnblogs.com/babyt/archive/2008/09/24/1297803.html --------------------编程问答-------------------- 我最近也在做水晶报表是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;
}
}
这是我写的程序 希望对你有些帮助 --------------------编程问答-------------------- 在报表生成后,我记得可以直接修改字段名称 --------------------编程问答-------------------- 修改不了,能修改最好说如何修改,给思路太泛泛了 --------------------编程问答--------------------
就说不知道如何对数据源的字段名进行转换
补充:.NET技术 , C#