473,323 Members | 1,574 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,323 software developers and data experts.

Crystal Report - with parms - .Export error

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, or in the code) works fine.

However, when I try to add any parameter through the record selection
formula and/or the report parameters method, the report crashes.

I have tried each of the methods:

1. Use the Record Selection Formula property:

crReportDocument.DataDefinition.RecordSelectionFor mula = "{qryTest.ID} = 54"

2. Use the Crystal Parameters collection(s)

crParameterFieldDefinitions =
crReportDocument.DataDefinition.ParameterFields

crParameterFieldDefinition = crParameterFieldDefinitions.Item("[@TestID]")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterDiscreteValue = New
CrystalDecisions.Shared.ParameterDiscreteValue()

crParameterDiscreteValue.Value = 54
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crPa rameterValues)
Both of the methods above work fine on my development machine but the
testing server gives these errors.

I also set the record selection formula in the report to automatically set
the TestID parameter = 54 and then tested that report on the testing server
and everything worked.

So the issue seems to be with populating the crystal report's parameters at
runtime. The error that comes back with a logon failure at the .Export line.

I have tried two methods to logon to the reports:
####################
Basic:
With tliTableLogonInfo.ConnectionInfo
.ServerName = m_strDSNName
.DatabaseName = m_strDatabase
.UserID = m_strUserId
.Password = m_strPassword
End With

'setup each connection in the report
For Each tTable In crReportDocument.Database.Tables
tTable.ApplyLogOnInfo(tliTableLogonInfo)
Next tTable
####################
and Complex (loops through sub-reports):
Dim mySection As Section
Dim mySections As Sections
Dim myReportObject As ReportObject
Dim myReportObjects As ReportObjects
Dim mySubReportObject As SubreportObject
Dim mySubRepDoc As New ReportDocument()

'Declare all of the sections of the main report
mySections = crReportDocument.ReportDefinition.Sections

'Loop through the sections in the main report to find the subreport objects
'then set the logon information to the subreport
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo

For Each mySection In mySections
myReportObjects = mySection.ReportObjects

For Each myReportObject In myReportObjects
If myReportObject.Kind = ReportObjectKind.SubreportObject Then
'Subreport Found - convert the report object to a sub report type
mySubReportObject = CType(myReportObject, SubreportObject)
'Set the specific instance of this subreport
mySubRepDoc =
mySubReportObject.OpenSubreport(mySubReportObject. SubreportName)

'Set the login information for the current subreport(found)
For Each crTable In mySubRepDoc.Database.Tables
myLogin = crTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = m_strDSNName
myLogin.ConnectionInfo.DatabaseName = m_strDatabase
myLogin.ConnectionInfo.UserID = m_strUserId
myLogin.ConnectionInfo.Password = m_strPassword
crTable.ApplyLogOnInfo(myLogin)
Next
End If
Next
Next
####################
Does anyone know of other methods to filter a report at runtime? Or is there
a Crystal DLL that I need to move from my dev machine to the server to allow
for the record selection properties to be set at runtime?

OR ANY OTHER INFO WOULD BE GREAT!!!

Thanks,

TJ
Nov 20 '05 #1
0 1703

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

Similar topics

1
by: DeeCay | last post by:
Dear folks, I was trying to write a .Net web application (using C#) that loads a Crystal Report on server side, export the report in PDF format as a file in the web server, and then serves up...
1
by: Stephanie Stowe | last post by:
I am doing a support rotation for our massive ASP app. We use Crystal Reports / Enterprise. By some magic which I am unfamiliar with Crystal Enterprise allows the creation of a report on the...
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,...
3
by: Colin Graham | last post by:
Error when attempting to export Crystal Report as PDF document asp.net. I get the following error. Error in File...
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
3
by: Russ | last post by:
I have a page that uses crystal reports to generate reports from a SQl server database. As of a week ago everything was working fine, but now I am all of the sudden getting errors. To the best of...
3
by: Deasun | last post by:
I need some help please! Crystal is driving me nuts. Heres my code so far, see below. Problem: On the .export() line it comes back with error #5 Login failed! I know the login info is good so...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
2
by: drisso | last post by:
Hello, I have searched that error on these message boards, msdn and crystaldecisions.com. I found tutorials that showed how to export a crystal report to pdf, but like many others I am getting...
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...
1
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...
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.