动态水晶报告 [英] Dyanmic Crystal Report

查看:88
本文介绍了动态水晶报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#Vs2008开发Windows应用程序.我需要创建动态水晶报表.
要创建动态Crystal报表,首先添加一个数据集,然后向该数据集添加一个数据表.现在,我向数据表添加4列.
现在,我添加一个水晶报表并将该水晶报表与数据集的数据表绑定.现在,我将使用crystalreportviewer并将Crystalreport与Crystal Reportviewer绑定.我使用的以下代码..

I am developing a windows application using C# Vs2008 . I need to create dynamic crystal report.
To create the dynamic crystal report, first I add a dataset and then a datatable to the dataset. Now I add 4 columns to the datatable.
Now I add a crystal report and bind the crystal report with the datatable of the dataset. Now I take a crystalreportviewer and bind the crystalreport with the crystal reportviewer. The following code i used..

private void button1_Click(object sender, EventArgs e)
     {
         CrystalReport1 objRpt = new CrystalReport1();
         con.Open();
         SqlCommand cmd=new SqlCommand("select pro_id,pro_nm,quantity,total from bill_t ",con);
         SqlDataAdapter da=new SqlDataAdapter(cmd);
         DataSet1 ds = new DataSet1();
         da.Fill(ds, "bill_t");
         objRpt.SetDataSource(ds.Table[1]);
         crystalReportViewer1.ReportSource = objRpt;
         crystalReportViewer1.Refresh();
         con.Close();

     }

我没有得到任何错误,只有水晶报表没有显示任何内容.
因此,请帮助我解决此问题.

I did not get any error, only crystal report does not show anything.
So, Please help me to solve this problem.

推荐答案

请参阅这些..
使用C#的动态Crystal报表 [ http://csharp.net-informations.com/crystal-reports/csharp- dynamic-crystal-reports.htm [ ^ ]
See these..
Dynamic Crystal Report with C#[^]
http://csharp.net-informations.com/crystal-reports/csharp-dynamic-crystal-reports.htm[^]


尝试一下...

它可以帮助您

这篇关于动态水晶报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆