打印和报告Crystal Report中的问题 [英] Problem in Printing and Reporting Crystal Report

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

问题描述

Hai,


我正在使用VS2010和SQL Server。


下面的代码是我在我的页面中用于Crystal报表



protected void Page_Load(object sender ,EventArgs e)

    {


//这里我使用session


        lblUserName.Text = Session [" empName"]。ToString();

    }¥b $ b    protected void btnReport_Click(object sender,EventArgs e)

    {

        ReportDocument rdoc = new ReportDocument();

        SqlConnection con = new SqlConnection(" Data Source = SERVICETEAM-PC; Initial Catalog = salaryReg; User ID = sa; Password = kavi");

        con.Open();

        SqlCommand cmd = new SqlCommand(" SalaryEarnings1",con);

        cmd.CommandType = CommandType.StoredProcedure;

        SqlDataAdapter da = new SqlDataAdapter(cmd);

        DataTable dt = new DataTable();

        da.Fill(dt);

        rdoc.Load(Server.MapPath(" CrystalReport.rpt"));

        rdoc.SetDataSource(dt);

        rdoc.SetParameterValue(" empName",lblUserName.Text);

        CrystalReportViewer1.ReportSource = rdoc;

        CrystalReportViewer1.DataBind();

        con.Close();

    }




这是代码  I 've 用于在我的asp.net网站上的按钮点击事件下生成水晶报告。这个创建报告没有任何错误,但之后当
i点击水晶报表工具栏上的打印按钮打印功能不起作用时,当尝试执行导出报表时,它会通过提供这样的窗口来询问更多详细信息




您请求的报告需要更多信息。

DataSet

服务器名称:...........

数据库名称:.........

用户名:..........

密码:...........


(复选框)使用Integrated Security 

解决方案

请发布与使用Crystal Reports相关的问题
论坛

Hai,

I'm Using VS2010 and SQL Server.

The below code is I have used in my page for Crystal report

protected void Page_Load(object sender, EventArgs e)
    {

//Here I retrieve User Name from another page using session

        lblUserName.Text = Session["empName"].ToString();
    }
    protected void btnReport_Click(object sender, EventArgs e)
    {
        ReportDocument rdoc = new ReportDocument();
        SqlConnection con = new SqlConnection("Data Source=SERVICETEAM-PC;Initial Catalog=salaryReg;User ID=sa;Password=kavi");
        con.Open();
        SqlCommand cmd = new SqlCommand("SalaryEarnings1", con);
        cmd.CommandType = CommandType.StoredProcedure;
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataTable dt = new DataTable();
        da.Fill(dt);
        rdoc.Load(Server.MapPath("CrystalReport.rpt"));
        rdoc.SetDataSource(dt);
        rdoc.SetParameterValue("empName", lblUserName.Text);
        CrystalReportViewer1.ReportSource = rdoc;
        CrystalReportViewer1.DataBind();
        con.Close();
    }

this is the code I've used to generate crystal report in one of my asp.net web site under button click event. This create report without any errors but after that when i click print button on crystal report tool bar print function is not working and when try to do Exporting the report it asks for further details by giving a window like this

The report you requested requires further information.
DataSet
Server name: ...........
Database name: .........
User name: ..........
Password: ...........
(checkbox) Use Integrated Security 

解决方案

Please post questions related to using Crystal Reports on their forums.


这篇关于打印和报告Crystal Report中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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