100分求C#.net+水晶报表开发的原代码,主要是统计图方面的,比喻饼图,柱图等等。。急等!

sunangel 2005-02-28 11:19:08
正在做的项目中需要这个,请各高手给我指点指点。
...全文
506 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
longwulaoda 2005-03-17
  • 打赏
  • 举报
回复
有這方面的期待也發一封小第我,先謝過了
overdream 2005-03-17
  • 打赏
  • 举报
回复
搭车,电邮地址
cap@163.com
谢谢。
sunangel 2005-03-16
  • 打赏
  • 举报
回复
人气太小,,大家帮忙顶
overdream 2005-03-11
  • 打赏
  • 举报
回复
老大們哪,也給我一份吧,我不知道怎麼動態地在水晶報表裡顯示圖片
sunangel 2005-03-09
  • 打赏
  • 举报
回复
没有项目经验很丰富的前辈来指导一下吗?
lg9706032921 2005-03-06
  • 打赏
  • 举报
回复
忘记邮箱了:leigang8110@163.com
lg9706032921 2005-03-06
  • 打赏
  • 举报
回复
我帮顶啊,哪位哥 们解决,我也开帖给分啊
lg9706032921 2005-03-06
  • 打赏
  • 举报
回复
我也想要这个啊,楼上哥们,你手上的资料能不能发一份给我啊,
sunangel 2005-03-04
  • 打赏
  • 举报
回复
谢谢大家的支持,我想我们能拿套成熟的解决方案出来,以后遇到这个问题的时候也好解决。特别是希望那些作个这些项目的前辈们不惜赐教,讨论讨论自己的解决办法和优缺点。当然更希望能拿出原代码来,这样可以帮助很多人。
在这里我先表态:等项目达到要求以后,我会公开此部分的所有代码。
sunangel 2005-03-03
  • 打赏
  • 举报
回复
怎么没有高手出手了吗?
sunangel 2005-03-01
  • 打赏
  • 举报
回复
xiaomaoxia(我的信誉怎么了,该结的都结了啊) ,,感谢你,我调试了程序出错了,你能不能帮我看看,,感谢了。
也谢谢 andywang110001(痞子王),你能不能把工程用邮件发给我调试调试。。
我的邮件地址:dreamalong@163.net QQ:12597325

因为现在的确太需要这个了,而我对水晶报表真的不熟悉。我也可以把我做的项目代码拿出来交流交流。
andywang110001 2005-03-01
  • 打赏
  • 举报
回复
private void Page_Load(object sender, System.EventArgs e)
{
string FilePath="";
if(!Page.IsPostBack)
{
DataSet dataSet=new DataSet();
DataOperate myDataOperate=new DataOperate();
string ddlSQL="select distinct df_bgname from tb_budget";
dataSet=myDataOperate.GetDataSet(ddlSQL);

ListItem listItem0=new ListItem();
listItem0.Value="-1";
listItem0.Text="-----所有费用-----";
DropDownList1.Items.Insert(0,listItem0);
for(int i=0;i<dataSet.Tables[0].Rows.Count;i++)
{
ListItem listItem=new ListItem();
listItem.Text=dataSet.Tables[0].Rows[i]["df_bgname"].ToString();
listItem.Value=dataSet.Tables[0].Rows[i]["df_bgname"].ToString();
DropDownList1.Items.Insert(i+1,listItem);
}
DropDownList1.DataBind();
}
string selectFormula=""; //传递公式

//按标段查询
MarkSegment=Session["OutlayType"].ToString().Trim();
PublicOperate publicOper=new PublicOperate();
bdassoc=publicOper.GetMarkSegmentCode(MarkSegment);

// 在此处放置用户代码以初始化页面
oRpt=new ReportDocument();

string bgname=DropDownList1.SelectedValue;
int index=DropDownList1.SelectedIndex;

if(MarkSegment=="建筑安装工程费")
{
FilePath=Server.MapPath("CrystalReports\\HistogramChart2.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart2.rpt");
DropDownList1.Visible=false;
Label2.Visible=false;
//Label1.Visible=false;
Label3.Visible=false;
}
else
{
DataSet dataSet=new DataSet();
DataOperate dataOper=new DataOperate();
string strSQL="select * from outlaycompare_image_view where sf_bdassoc='"+bdassoc+"' ";
dataSet=dataOper.GetDataSet(strSQL);
DataView compareDv=dataSet.Tables[0].DefaultView;
if(index==0)
{
if(compareDv.Count==0)
{
FilePath=Server.MapPath("CrystalReports\\HistogramChart_bd_indexBlank.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart_bd_indexBlank.rpt");
DropDownList1.Visible=false;
Label2.Visible=false;
Label3.Visible=false;
DisplayChart();
return;
}
FilePath=Server.MapPath("CrystalReports\\HistogramChart_bd.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart_bd.rpt");
selectFormula = "{outlaycompare_image_view.sf_bdassoc}='"+bdassoc+"'";
oRpt.DataDefinition.RecordSelectionFormula = selectFormula;
oRpt.Refresh();
}
else
{
FilePath=Server.MapPath("CrystalReports\\HistogramChart_bd_index.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart_bd_index.rpt");
selectFormula = "{outlaycompare_image_view.sf_bdassoc}='"+bdassoc+"'";
oRpt.DataDefinition.RecordSelectionFormula = selectFormula;
oRpt.Refresh();
}
}
DisplayChart();
}

/// <summary>
/// 将图表显示出来
/// </summary>
private void DisplayChart()
{
CrystalDecisions.CrystalReports.Engine.Database crDatabase; //定义一个水晶报表相关的数据库对象
CrystalDecisions.CrystalReports.Engine.Table crTable;
crDatabase=oRpt.Database; //得到报表的数据库
Object[] arrTable=new Object[1];
crDatabase.Tables.CopyTo(arrTable,0);
crTable=(CrystalDecisions.CrystalReports.Engine.Table)arrTable[0];

TableLogOnInfo dbConn=new TableLogOnInfo();
dbConn = crTable.LogOnInfo;
dbConn.ConnectionInfo.ServerName=ConfigurationSettings.AppSettings["StrDBConnection_ServerName"];
dbConn.ConnectionInfo.UserID=ConfigurationSettings.AppSettings["StrDBConnection_UserID"];
dbConn.ConnectionInfo.Password=ConfigurationSettings.AppSettings["StrDBConnection_Password"];
dbConn.ConnectionInfo.DatabaseName=ConfigurationSettings.AppSettings["StrDBConnection_DatabaseName"];
crTable.ApplyLogOnInfo(dbConn);

CrystalReportViewer1.ReportSource=oRpt;
CrystalReportViewer1.DataBind();
}

/// <summary>
/// 选择细目时,图表变化
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void IndexChanged(object sender, System.EventArgs e)
{
string FilePath="";
string bgname=DropDownList1.SelectedValue;
int index=DropDownList1.SelectedIndex;
string selectFormula="";

DataSet dataSet=new DataSet();
DataOperate dataOper=new DataOperate();
string strSQL="select * from outlaycompare_image_view where sf_bdassoc='"+bdassoc+"' ";
dataSet=dataOper.GetDataSet(strSQL);
DataView compareDv=dataSet.Tables[0].DefaultView;
string path_bd_indexBlank=Server.MapPath("HistogramChart_bd_indexBlank.rpt");
if(index==0)
{
selectFormula= "{outlaycompare_image_view.sf_bdassoc}='"+bdassoc+"'";
if(compareDv.Count==0)
{
// oRpt.Load(path_bd_indexBlank);
FilePath=Server.MapPath("CrystalReports\\HistogramChart_bd_indexBlank.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart_bd_indexBlank.rpt");
oRpt.Refresh();
return;
}
}
else
{
compareDv.RowFilter=" df_bgname='"+bgname+"'";
if(compareDv.Count==0)
{
// oRpt.Load(path_bd_indexBlank);
FilePath=Server.MapPath("CrystalReports\\HistogramChart_bd_indexBlank.rpt");
oRpt.Load(FilePath);
// oRpt.Load("C:\\Inetpub\\wwwroot\\InvestManage\\HistogramChart_bd_indexBlank.rpt");
DropDownList1.Visible=false;
Label2.Visible=false;
Label3.Visible=false;
DisplayChart();
return;
}
else
selectFormula = "{outlaycompare_image_view.sf_bdassoc}='"+bdassoc+"' and {outlaycompare_image_view.df_bgname}='"+bgname+"'";
}
oRpt.DataDefinition.RecordSelectionFormula = selectFormula;
DisplayChart();
DropDownList1.SelectedIndex=index;
oRpt.Refresh();
}


这是我以前作得一个例子,可以选择图标显示
xiaomaoxia 2005-03-01
  • 打赏
  • 举报
回复
我发给你的代码就是现实上面的功能!很简单!
sunangel 2005-03-01
  • 打赏
  • 举报
回复
我想实现的功能是:选择不同的选项,然后生成不同的图形,然后可以预览,选择打印这些图形。
landlordh 2005-02-28
  • 打赏
  • 举报
回复
要源码呀

你可以去官方网站去下载,用多个基础的例子

http://support.crystaldecisions.com/
xiaomaoxia 2005-02-28
  • 打赏
  • 举报
回复
其实web 的 和 win 的一样的!!!!
sunangel 2005-02-28
  • 打赏
  • 举报
回复
我看到了,我要的是webform上的例子呀,,
sunangel 2005-02-28
  • 打赏
  • 举报
回复
恩,多谢你了,,,
panxuegang 2005-02-28
  • 打赏
  • 举报
回复
我发给你吧,是书上的例子,你看看有用吗。
sunangel 2005-02-28
  • 打赏
  • 举报
回复
你们可以发邮件给我你的代码呀dreamalong@163.net
加载更多回复(3)

4,819

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧