是否可以创建运行时水晶报表? [英] Is it possible to create runtime crystal report?

查看:73
本文介绍了是否可以创建运行时水晶报表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在运行时显示水晶报表值.
我想使用一个文本框并传递日期值,直到该日期为止,所有记录都必须从数据库中显示.

怎么做?
请帮助

is it possible to show the crystal report value at runtime.
i want to take one textbox and pass the date value, up to that date all record must be show from database.

how does it done?
please help

推荐答案

在这里

C#Crystal Reports Date参数 [
Here you go

C# Crystal Reports Date parameter[^]


using System;

using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public partial class Pages_ReportLoader : System.Web.UI.Page
{
    ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            paramField.Name = "@Dept"
            paramDiscreteValue.Value = "CS";
            paramField.CurrentValues.Add(paramDiscreteValue);
            paramFields.Add(paramField);
            CrystalReportViewer1.ParameterFieldInfo = paramFields;
            reportDocument.Load(Server.MapPath("CrystalReportTest.rpt"));
            CrystalReportViewer1.ReportSource = reportDocument;
            reportDocument.SetDatabaseLogon(---connectionstring---);

        }

    }

    protected void btnShowReport_Click(object sender, EventArgs e)

    {
        paramField.Name = "@Dept";
        paramDiscreteValue.Value = txtParamDept.Text.ToString();
        paramField.CurrentValues.Add(paramDiscreteValue);
        paramFields.Add(paramField);
        CrystalReportViewer1.ParameterFieldInfo = paramFields;
        reportDocument.Load(Server.MapPath("CrystalReportTest.rpt"));
        CrystalReportViewer1.ReportSource = reportDocument;
        reportDocument.SetDatabaseLogon(--connection string--);

    }

}


可以.

看看这些文章以掌握所需的知识:
愚蠢的Crystal Reports指南,第一部分-Winforms [动态Crystal报表查看 [具有C#的动态Crystal报表 [ .NET中的Crystal Reports简介 [使用其功能组,图形,交叉表和子报表逐步创建Crystal报表 [ ^ ]
ASP.NET中的晶体报告 [
Yes possible.

Have a look at these articles to get equiped with knowledge needed for it:
Idiot''s Guide to Crystal Reports, Part I - Winforms[^]
Dynamic Crystal Reports Viewing[^]
Dynamic Crystal Report with C#[^]

Few features step-by-step:
Introductions to Crystal Reports in .NET[^]
Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]
Crystal Reports in ASP.NET[^]


这篇关于是否可以创建运行时水晶报表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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