473,325 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Crystal Reports Logon Problem

I have a report where in I want to display the data from a subreport as
well as a the main report. The sub report is the Company info as the
header, for all the reports. with out a sub report added, the report
works perfectly. Once the sub report is added, every time the login
information is requested and the report does not open.
The following is the code:

m_DSBankStmnt = New DataSet
objRptBnk = New rptBankStmnt '//The main report
objclsBank = New clsBank

m_iMonth = dStmntDt.Month
m_iYear = dStmntDt.Year
m_DSBankStmnt = objclsBank.GenBnkStmnt(m_iMonth, m_iYear)
'//a unction to load the data

objRptBnk.SetDataSource(m_DTBankStmnt.Tables(0))
crvwBnkStmnt.ReportSource = objRptBnk

'R&D________________ done by me
Dim objCR As New CRSubReport
'The subreport object
objCR.SetDatabaseLogon("sa", "", "raghavendra",
"db_payroll") 'Logon info for the report
objRptBnk.OpenSubreport("CRSubReport.rpt")
'the report
name

'R&D____________

Any help will be deeply appreciated.

Ravi

Nov 13 '06 #1
1 1212
I think this will help (we had to do it like this to 'refresh' the
connectionstring of the reports)...
The SetDatabaseLogon-method doesn't seem to have the behaviour we would want
it to have :-)
'This method must be called BEFORE the "crvwBnkStmnt.ReportSource =
objRptBnk"!!!!
'SetReportConnectionString(objRptBnk)...
Private Sub SetReportConnectionString(ByRef repEtat As ReportDocument)
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo
myConnectionInfo.ServerName =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\ServerName")
myConnectionInfo.DatabaseName =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\DatabaseName")
myConnectionInfo.UserID =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\UserID")
myConnectionInfo.Password =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\Password")

Dim myTableLogOnInfo As New TableLogOnInfo

'Dim myTableLogOnInfos As TableLogOnInfos = crvEtats.LogOnInfo
'For Each myTableLogOnInfo In myTableLogOnInfos
' myTableLogOnInfo.ConnectionInfo = myConnectionInfo
'Next

myTableLogOnInfo = New TableLogOnInfo
myTableLogOnInfo.ConnectionInfo.ServerName =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\ServerName")
myTableLogOnInfo.ConnectionInfo.DatabaseName =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\DatabaseName")
myTableLogOnInfo.ConnectionInfo.UserID =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\UserID")
myTableLogOnInfo.ConnectionInfo.Password =
Configuration.ConfigurationSettings.AppSettings.Ge t("CrystalReports\Password")

Dim intX As Integer
For intX = 0 To (repEtat.Database.Tables.Count - 1)
repEtat.Database.Tables.Item(intX).ApplyLogOnInfo( myTableLogOnInfo)
Next
End Sub
I hope this helps,

Pieter
"Ravimama" <ma**********@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...
>I have a report where in I want to display the data from a subreport as
well as a the main report. The sub report is the Company info as the
header, for all the reports. with out a sub report added, the report
works perfectly. Once the sub report is added, every time the login
information is requested and the report does not open.
The following is the code:

m_DSBankStmnt = New DataSet
objRptBnk = New rptBankStmnt '//The main report
objclsBank = New clsBank

m_iMonth = dStmntDt.Month
m_iYear = dStmntDt.Year
m_DSBankStmnt = objclsBank.GenBnkStmnt(m_iMonth, m_iYear)
'//a unction to load the data

objRptBnk.SetDataSource(m_DTBankStmnt.Tables(0))
crvwBnkStmnt.ReportSource = objRptBnk

'R&D________________ done by me
Dim objCR As New CRSubReport
'The subreport object
objCR.SetDatabaseLogon("sa", "", "raghavendra",
"db_payroll") 'Logon info for the report
objRptBnk.OpenSubreport("CRSubReport.rpt")
'the report
name

'R&D____________

Any help will be deeply appreciated.

Ravi

Nov 13 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tim Jones | last post by:
Hey all, I am trying to try get a crytal report running properly. A "Hello World" report that does not add criteria to the record selection formula of the report (either in the development tool,...
0
by: Max | last post by:
Hi wise people, Has anyone encountered the Crystal Reports problem I describe below? If so, how did you solve it? It seems that every article posted on google regarding CR and logon problems is...
1
by: Mithun Verma | last post by:
Hello All, I have a Windows application that uses Crystal Reports 9 (bundled Version) developed using VS.NET 2003 on a windows server 2003 m/c. The application has to be deployed on the client...
0
by: google | last post by:
My Crystal reports are being supplied the logon credentials via a C# code class that recursively loops through all the tables present in the reports and applies the login credentials (Servername,...
2
by: Karun Karunakaran | last post by:
Hi, I am using the Crystal Enterprise .NET assemblies to generate and display a crystal report in a webform. This report connects to an SQL server (running locally) using a specific username and...
1
by: andy lim | last post by:
Hello all, I'm developing a web application using ASP.NET/VB. I have problem in viewing my CR reports. It returns following exception when I tried to view any CR report. ...
3
by: Milan Todorovic | last post by:
Hello, I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report purely for testing purposes: connect to...
3
by: Shawn H. Mesiatowsky | last post by:
I have come across lots of information regarding this, but nothing seems to work. I have created a Crystal Report that access's a SQL server backend for the data, and I want to display the report...
19
by: Michael O'Donnell | last post by:
Hi All Am having major problem with crystal reports...Have designed my report no problem, its when I try to run and display ther report that I am getting a "Login Failed" message. At first I...
0
by: Peter Proost | last post by:
Hi, I've got the following very strange problem. I've got a crystal reports report (cr9) which is called from my app. The app is installed on about 140 pc's and runs fine on 139 of them. On the one...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.