水晶报告中的asp.net问题“需要进一步的信息”。 [英] asp.net problem in crystal report "requires further information"

查看:66
本文介绍了水晶报告中的asp.net问题“需要进一步的信息”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用asp.net,c ++,我的报告的水晶报告和带有Windows身份验证登录的sql数据库。



一直在网上寻找答案,但似乎我找不到。我真的跳来解决我的问题

当我在水晶报表查看器中打印,导出或查找它会提示我登录服务器。





webform1中的代码



< pre>< ; pre lang =HTML>

i use asp.net, c++, crystal report for my report and sql database with windows authentication login.

been looking in the internet for the answer but it seems i can not find. i really hopping to solve my problem
when i "print", "export", or "find" in the crystal report viewer it will prompt me to log in in the server.


code in webform1

<pre><pre lang="HTML">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportSource;
using CrystalDecisions.Reporting;

namespace WebApplication9
{

    public partial class WebForm1 : System.Web.UI.Page
    {
        SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["listoq"].ConnectionString);
        ReportDocument rdoc = new ReportDocument();


        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            cn.Open();
            SqlConnection cs = new SqlConnection("data source=.; database=palistuhan; integrated security=SSPI");
            SqlCommand cmd = new SqlCommand("listoproce", cn);
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable ds = new DataTable();
            da.Fill(ds);
            rdoc.Load(Server.MapPath("CrystalReport1.rpt"));
            rdoc.SetDataSource(ds);
            rdoc.SetParameterValue("My Parameter", TextBox1.Text);
            CrystalReportViewer1.ReportSource = rdoc;
            CrystalReportViewer1.DataBind();
            cn.Close();
        }

    }
}



见下图

http://i1228.photobucket.com/albums/ee443/jaylisto/q1_zpswrwmzwoc.png

推荐答案

crystalReport.Load(Server.MapPath("~/CrystalReport1.rpt"));
    Customers dsCustomers = GetData("select top 5 * from customers");
    crystalReport.SetDataSource(dsCustomers);
    CrystalReportViewer1.ReportSource = crystalReport;


这篇关于水晶报告中的asp.net问题“需要进一步的信息”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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