如何创建最新的水晶报表 [英] how to create crystal reports from date to todate

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

问题描述

大家好
如何创建水晶报告.我有两个文本框,第一个文本框是从日期开始的,第二个文本框是到目前为止,我想在fromdate和todate报告之间显示报告.
在asp.net中使用usig c#.请给我任何一个.
Thankyou.

hi all
how to create crystal reports . i have two textboxes first textbox is from date and second textbox is to date i want to display report between fromdate and todate report.
in asp.net usig c#.please send me any one.
thankyou.

推荐答案

有关crstal报告的生成,请参阅此链接,您可能会有所了解
http://stackoverflow.com/questions/11665611/如何在两个日期之间创建水晶报告 [ http://www.crystalreporthostingnews.com/index.php/archives/271 [ ^ ]
在Visual Studio 2010中使用Crystal Reports生成报告 [ ^ ]
For crstal report Generation see this link you may get some idea
http://stackoverflow.com/questions/11665611/how-can-i-create-a-crystal-report-between-two-dates[^]
http://www.crystalreporthostingnews.com/index.php/archives/271[^]
Generate a Report using Crystal Reports in Visual Studio 2010[^]


尝试一下:

将两个日期值都输入到QueryString中为:

Try This :

take both date value in to QueryString as:

string from_date = Request.QueryString["fromdate"];
string to_date = Request.QueryString["todate"];


import these namespace first :
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Reporting;

declare variable like :
ReportDocument cr;


then apply query :

protected void Page_Init(object sender, EventArgs e)
{

 String data = "SELECT * from table name where from_date>=''"+from_date+"'' and to_date<=''"+to_date+"'';

        SqlDataAdapter ad1 = new SqlDataAdapter(data, connection object);
        DataSet ds1 = new DataSet();
        ad1.Fill(ds1);


       path = Server.MapPath("Reportname");
        cr = new ReportDocument();
        cr.Load(path);

        cr.SetDataSource(ds1.Tables[0]);
        CrystalReportViewer1.ReportSource = cr;

}



如果您遇到任何问题,请将其发布...



if any problem you get, please post it...


这篇关于如何创建最新的水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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