Albee_J
asked on
Turn Integrated Security ON in Crystal Reports
I am working in visual studio 2005 with a connection to SQL Server 2005.
I am trying to take all of my current crystal reports and turn off 'enable database logon prompting'
I have tried to set my report connections to use 'integrated' logon but it doesn't work. I am displaying my reports with crystal reports viewer.
Where do I go to put report username and password in the code to disable the logon prompt?
I am trying to take all of my current crystal reports and turn off 'enable database logon prompting'
I have tried to set my report connections to use 'integrated' logon but it doesn't work. I am displaying my reports with crystal reports viewer.
Where do I go to put report username and password in the code to disable the logon prompt?
ASKER
That should of said 'all of my reports are setup using Smart Task"
Wha t code are you using to call the reports?
mlmcc
mlmcc
ASKER
Just the crystal reports viewer
<%@ Register Assembly="CrystalDecisions .Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521 e1304"
Namespace="CrystalDecision s.Web" TagPrefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Cont entPlaceHo lder1" Runat="Server">
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
DisplayGroupTree="False" EnableParameterPrompt="Fal se" Height="50px" ReportSourceID="EnhancedLo go"
Width="350px" />
<CR:CrystalReportSource ID="EnhancedLogo" runat="server">
<Report FileName="EnhancedLogoRepo rt.rpt">
</Report>
</CR:CrystalReportSource>
</asp:Content>
<%@ Register Assembly="CrystalDecisions
Namespace="CrystalDecision
<asp:Content ID="Content1" ContentPlaceHolderID="Cont
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="True"
DisplayGroupTree="False" EnableParameterPrompt="Fal
Width="350px" />
<CR:CrystalReportSource ID="EnhancedLogo" runat="server">
<Report FileName="EnhancedLogoRepo
</Report>
</CR:CrystalReportSource>
</asp:Content>
This may show you how. It is a tutorial on using VS2005 Crystal
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf
mlmcc
http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf
mlmcc
ASKER
I posted that tutorial earlier in my original post. It doesn't show me how to take existing reports and make them integrated. Plus the area that shows the integration is not binding reports using the crystal reports viewer.
ASKER
I found some possible code but I am getting the following errors;
Error 3 Name 'OpenReportMethod' is not declared. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 37 39 C:\...\FabtechSales\
Error 4 Name 'ReportDocument' is not declared. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 38 20 C:\...\FabtechSales\
Error 5 Value of type 'CrystalDecisions.CrystalR eports.Eng ine.Table' cannot be converted to 'System.Web.UI.WebControls .Table'. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 41 23 C:\...\FabtechSales\
Error 6 'LogOnInfo' is not a member of 'System.Web.UI.WebControls .Table'. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 42 30 C:\...\FabtechSales\
Error 7 'ApplyLogOnInfo' is not a member of 'System.Web.UI.WebControls .Table'. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 44 13 C:\...\FabtechSales\
Error 8 Name 'ReportDocument' is not declared. C:\Users\jalbee\Documents\ Visual Studio 2005\WebSites\FabtechSales \Admin\Enh ancedRepor t.aspx.vb 47 45 C:\...\FabtechSales\
Error 3 Name 'OpenReportMethod' is not declared. C:\Users\jalbee\Documents\
Error 4 Name 'ReportDocument' is not declared. C:\Users\jalbee\Documents\
Error 5 Value of type 'CrystalDecisions.CrystalR
Error 6 'LogOnInfo' is not a member of 'System.Web.UI.WebControls
Error 7 'ApplyLogOnInfo' is not a member of 'System.Web.UI.WebControls
Error 8 Name 'ReportDocument' is not declared. C:\Users\jalbee\Documents\
Protected Sub InitReport()
Dim pServerName As String
Dim pDbName As String
Dim pUserid As String
Dim pPwd As String
pServerName = System.Configuration.ConfigurationManager.AppSettings(" ")
pDbName = System.Configuration.ConfigurationManager.AppSettings(" ")
pUserid = System.Configuration.ConfigurationManager.AppSettings("")
pPwd = System.Configuration.ConfigurationManager.AppSettings(" ")
Dim crTable As Table
Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim crTabLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
'/*** Information provider for connection with the Database ***/
Dim crConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo()
Dim intCnt As Integer
crConnectionInfo.ServerName = pServerName
crConnectionInfo.DatabaseName = pDbName
crConnectionInfo.UserID = pUserid
crConnectionInfo.Password = pPwd
'/*** To get the Database object ***/
Dim Filepath As String
Filepath = Server.MapPath("EnhancedLogoReport.rpt")
ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument()
ReportDocument.Load(Filepath, OpenReportMethod.OpenReportByDefault)
crTables = ReportDocument.Database.Tables
For intCnt = 0 To crTables.Count - 1
crTable = crTables.Item(intCnt)
crTabLogonInfo = crTable.LogOnInfo
crTabLogonInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTabLogonInfo)
Next
CrystalReportViewer1.ReportSource = ReportDocument
End Sub
ASKER
K making progress but now I am getting this error:
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'report'. SQL State: 42000 Native Error: Error in File C:\Users\jalbee\AppData\Lo cal\Temp\E nhancedLog oReport {597CBAF6-FE74-4C3D-80C2-9 D9F1918E58 F}.rpt: Unable to connect: incorrect log on parameters.
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'report'. SQL State: 42000 Native Error: Error in File C:\Users\jalbee\AppData\Lo
Protected Sub CrystalReportViewer1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Init
Dim pServerName As String
Dim pDbName As String
Dim pUserid As String
Dim pPwd As String
pServerName = " "
pDbName = " "
pUserid = " "
pPwd = " "
Dim crTable As Table
Dim crTables As Tables
Dim crTabLogonInfo As TableLogOnInfo
'/*** Information provider for connection with the Database ***/
Dim crConnectionInfo As New ConnectionInfo()
Dim intCnt As Integer
crConnectionInfo.ServerName = pServerName
crConnectionInfo.DatabaseName = pDbName
crConnectionInfo.UserID = pUserid
crConnectionInfo.Password = pPwd
'/*** To get the Database object ***/
Dim Filepath As String
Filepath = Server.MapPath("EnhancedLogoReport.rpt")
ReportDocument = New ReportDocument()
ReportDocument.Load(Filepath, OpenReportMethod.OpenReportByDefault)
crTables = ReportDocument.Database.Tables
For intCnt = 0 To crTables.Count - 1
crTable = crTables.Item(intCnt)
crTabLogonInfo = crTable.LogOnInfo
crTabLogonInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTabLogonInfo)
Next
CrystalReportViewer1.ReportSource = ReportDocument
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Crap ran into a glitch, if you have a report that has 'parameter' prompting on, I use it for year, sales rep, association the code won't work....
ASKER
"Configuring Database Logon Prompting in the Smart Task " See page 305 in attached document.
VS2005-Walkthroughs.pdf