CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  .NET技术 >  C#

水晶报表每次打开都要登录数据库 ?? 求助

楼主lovelycat0512(努力学习)2005-08-01 13:41:47 在 .NET技术 / C# 提问

连接Oracle数据库,每次打开报表都要求登陆数据库,  
  能不能跳过,或者通过设置解决这个问题。  
  在线。。。。  
   
  谢谢。 问题点数:50、回复次数:4Top

1 楼lovelycat0512(努力学习)回复于 2005-08-01 14:08:53 得分 0

自己顶,  
  没人会吗?Top

2 楼lovelycat0512(努力学习)回复于 2005-08-01 14:25:51 得分 0

再顶  
  Top

3 楼lyb_abiandbel(专注于OO分析与设计)回复于 2005-08-01 16:43:05 得分 50

可能没有设置登陆信息吧!  
   
  /*********************************************  
   
  File   Name:           csharp_win_oraclelogoninfo.sln  
  Created:               September   9,   2003  
  Author   ID:           HIT  
  Purpose:               This   C#   sample   Windows   application  
  demonstrates   how   to   provide   Logon   Information   to    
  an   Oracle   database   at   runtime.        
  ********************************************/  
   
  using   System;  
  using   System.Drawing;  
  using   System.Collections;  
  using   System.ComponentModel;  
  using   System.Windows.Forms;  
  using   System.Data;  
  using   CrystalDecisions.CrystalReports.Engine;  
  using   CrystalDecisions.Shared;  
   
   
  namespace   csharp_win_oraclelogoninfo  
  {  
  ///   <summary>  
  ///   Summary   description   for   Form1.  
  ///   </summary>  
  public   class   Form1   :   System.Windows.Forms.Form  
  {  
  private   CrystalDecisions.Windows.Forms.CrystalReportViewer   crystalReportViewer1;  
  ///   <summary>  
  ///   Required   designer   variable.  
  ///   </summary>  
  private   System.ComponentModel.Container   components   =   null;  
   
  //CR   Variables  
  OracleReport   crReportDocument;  
  Database   crDatabase;    
  Tables   crTables;  
  TableLogOnInfo   crTableLogOnInfo;  
  ConnectionInfo   crConnectionInfo;  
   
   
  public   Form1()  
  {  
  //  
  //   Required   for   Windows   Form   Designer   support  
  //  
  InitializeComponent();  
   
  //Create   an   instance   of   the   strongly-typed   report   object  
  crReportDocument   =   new   OracleReport();  
   
  //Set   the   crConnectionInfo   with   the   current   values   stored   in   the   report  
  crConnectionInfo   =   crReportDocument.Database.Tables[0].LogOnInfo.ConnectionInfo;  
   
  /*   Populate   the   ConnectionInfo   Objects   Properties   with   the   appropriate   values   for  
  the   ServerName,   User   ID,   Password   and   DatabaseName.   However,   since   Oracle    
  works   on   Schemas,   Crystal   Reports   does   not   recognize   or   store   a   DatabaseName.    
  Therefore,   the   DatabaseName   property   must   be   set   to   a   BLANK   string.   */  
  crConnectionInfo.DatabaseName   =   "";  
  crConnectionInfo.ServerName   =   "Your   Server   Name";  
  crConnectionInfo.UserID   =   "Your   User   ID";  
  crConnectionInfo.Password   =   "Your   Password";  
   
  //Set   the   CrDatabase   Object   to   the   Report's   Database  
  crDatabase   =   crReportDocument.Database;  
   
  //Set   the   CrTables   object   to   the   Tables   collection   of   the   Report's   dDtabase  
  crTables   =   crDatabase.Tables;  
   
  //Loop   through   each   Table   object   in   the   Tables   collection   and   apply   the   logon   info  
  //specified   ealier.   Note   this   sample   only   has   one   table   so   the   loop   will   only   execute   once  
  foreach   (Table   crTable   in   crTables)  
  {  
  crTableLogOnInfo   =   crTable.LogOnInfo;  
  crTableLogOnInfo.ConnectionInfo   =   crConnectionInfo;  
  crTable.ApplyLogOnInfo   (crTableLogOnInfo);  
   
  //   if   you   wish   to   change   the   schema   name   as   well,   you   will   need   to   set   Location   property   as   follows:  
  //   crTable.Location   =   "<new   schema   name>."   +   crTable.Name;  
  }  
   
  //Set   the   ReportSource   of   the   CrystalReportViewer   to   the   strongly   typed   Report   included   in   the   project  
  crystalReportViewer1.ReportSource   =   crReportDocument;  
                           
  }  
   
  ///   <summary>  
  ///   Clean   up   any   resources   being   used.  
  ///   </summary>  
  protected   override   void   Dispose(   bool   disposing   )  
  {  
  if(   disposing   )  
  {  
  if   (components   !=   null)    
  {  
  components.Dispose();  
  }  
  }  
  base.Dispose(   disposing   );  
  }  
   
  #region   Windows   Form   Designer   generated   code  
  ///   <summary>  
  ///   Required   method   for   Designer   support   -   do   not   modify  
  ///   the   contents   of   this   method   with   the   code   editor.  
  ///   </summary>  
  private   void   InitializeComponent()  
  {  
  this.crystalReportViewer1   =   new   CrystalDecisions.Windows.Forms.CrystalReportViewer();  
  this.SuspendLayout();  
  //    
  //   crystalReportViewer1  
  //    
  this.crystalReportViewer1.ActiveViewIndex   =   -1;  
  this.crystalReportViewer1.Dock   =   System.Windows.Forms.DockStyle.Fill;  
  this.crystalReportViewer1.Name   =   "crystalReportViewer1";  
  this.crystalReportViewer1.ReportSource   =   null;  
  this.crystalReportViewer1.Size   =   new   System.Drawing.Size(784,   565);  
  this.crystalReportViewer1.TabIndex   =   0;  
  //    
  //   Form1  
  //    
  this.AutoScaleBaseSize   =   new   System.Drawing.Size(5,   13);  
  this.ClientSize   =   new   System.Drawing.Size(784,   565);  
  this.Controls.AddRange(new   System.Windows.Forms.Control[]   {  
      this.crystalReportViewer1});  
  this.Name   =   "Form1";  
  this.Text   =   "Form1";  
  this.ResumeLayout(false);  
   
  }  
  #endregion  
   
  ///   <summary>  
  ///   The   main   entry   point   for   the   application.  
  ///   </summary>  
  [STAThread]  
  static   void   Main()    
  {  
  Application.Run(new   Form1());  
  }  
  }  
  }  
   
   
  Top

4 楼lovelycat0512(努力学习)回复于 2005-08-05 14:04:53 得分 0

不行啊,算啦吧,结了Top

相关问题

  • 水晶报表的数据库登录问题!
  • 水晶报表访问数据库登录失败
  • 水晶报表怎么登录数据库啊?
  • 水晶报表的参数和数据库登录页面
  • 水晶报表的参数和数据库登录页面
  • 水晶报表中动态更改数据库服务器,出现打开行集失败的问题?
  • 水晶报表不能打开ACCESS数据库问题,请教大侠,分不高.
  • 为什么数据库设置密码后,打开水晶报表会要求输入密码?
  • 水晶报表crystalReportViewer老是弹出数据库登录对话框有什么办法解决??
  • 水晶报表的登录

关键词

  • 数据库
  • report
  • database
  • oracle
  • null
  • crystalreportviewer
  • crtable
  • crconnectioninfo
  • crtablelogoninfo
  • crreportdocument

得分解答快速导航

  • 帖主:lovelycat0512
  • lyb_abiandbel

相关链接

  • CSDN .NET频道
  • .NET类图书
  • C#类图书
  • .NET类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo