水晶报表登录错误 [英] Crystal Report Login Error

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

问题描述

朋友,

我的CRV(Crystal Reports Viewer)中存在登录问题.

第一次打开水晶报表时,它完全可以正常运行.
但是,当我进入水晶报表的第二页时,它显示了数据库登录"对话框.

我尝试将属性EnableDatabaseLogin设置为false,但无法正常工作.

我还需要您的帮助:-
您能否给出如何在Crystal Reports中显示Crystal Reports大报告?

我们可以应用任何CSS吗?


感谢和问候,
Chirag:rose:

Hi Friends,

There is a login problem in my CRV(Crystal Reports Viewer).

The first time the crystal reports open it works completely OK.
But, when I go onto second page of crystal reports it shows Database login dialog.

I try to set property EnableDatabaseLogin to false but it not work properly.

I need also one help from you:-
Can you give how to display crystal reports large reports in crystal reports?

Can we apply any css for it?


thanks and regards,
Chirag :rose:

推荐答案

您好,我遇到了与如何解决该问题相同的问题.注意第一个DataSet(getRpt)及其在以下事件中的用法1.Page_init; 2.Page_Load; 3.CrystalReportViewr_Page_Init; 4.CrystalReportViewrNavigate这是我的完整代码

Hi there, i had the same problem this how i managed to solve it. Pay attention to the first DataSet(getRpt) and how it is used within the following events 1.Page_init;2.Page_Load;3.CrystalReportViewr_Page_Init;4.CrystalReportViewrNavigate heres my Full code

DataSet getRpt()
      {
              CrystalReport2 myRpt = new CrystalReport2();
              string myConstr = ConfigurationManager.AppSettings["ConnectionString"];
              SqlConnection myConnection = new SqlConnection(myConstr);
              SqlDataAdapter myAdapter = new SqlDataAdapter();
              DataSet3 myDataSet = new DataSet3();
              SqlCommand MyCommand = myConnection.CreateCommand();
          try
          {

              CrystalReportViewer1.DisplayGroupTree = false;
              CrystalReportViewer1.DisplayToolbar = true;

              MyCommand.CommandText = "ProcNamet";
              MyCommand.CommandType = CommandType.StoredProcedure;
              myAdapter.SelectCommand = MyCommand;

              myAdapter.SelectCommand.Parameters.Add(new SqlParameter("@myPara1",Convert.ToInt32(txtDays.Text)));
              myAdapter.SelectCommand.Parameters.Add(new SqlParameter("@myPara2", Convert.ToString(DropDownList1.SelectedValue)));
              myAdapter.SelectCommand.Parameters.Add(new SqlParameter("@myPara3", Convert.ToString(DropDownList2.SelectedValue)));

              myAdapter.Fill(myDataSet, "ProcName");
              myRpt.SetDataSource(myDataSet);
              CrystalReportViewer1.ReportSource = myRpt;
          }

          catch (Exception ex)
          {
              string strEX;
              strEX = ex.ToString();
          }
          return myDataSet;

      }

      private void Page_Init(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              DataSet myD = getRpt();
          }
      }

      protected void Page_Load(object sender, EventArgs e)
      {
         if (!IsPostBack)
         {
             DataSet myD = getRpt();
         }
       
      }
      protected void btnPreview_Click(object sender, EventArgs e)
      {


          if (!IsPostBack)
          {
              DataSet myD = getRpt();

          }
      }

      protected void CrystalReportViewer1_Init(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              DataSet myD = getRpt();
          }
      }

      protected void CrystalReportViewer1_Navigate(object source, CrystalDecisions.Web.NavigateEventArgs e)
      {
          if (!IsPostBack)
          {
              DataSet myD = getRpt();
          }
      }


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

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