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

Crystal Reports - 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
Jul 21 '05 #1
0 1667

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: stephan | last post by:
I know that this has been beaten to death but I can't seem to resolve my issues (I have 2 of them). I have created a class that exposes a public method which returns a datatable as a datasource...
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...
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...
0
by: Timmy 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,...
1
by: Hardy Wang | last post by:
Hi all, I have a piece of code in my C# console application to export from crystal report files to PDF. For some reports files, I get errors below. I have Crystal Reports 8.5 with service pack...
1
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is...
2
by: MartyInOz | last post by:
Hi, I'm currently running Crystal Reports 8.5 from PHP using COM..(yes I know that is an older version of Crystal)...I am also running PHP on localhost. The following code: <?php $crapp =...
2
by: =?Utf-8?B?Um9iZXJ0?= | last post by:
About the time we installed Windows Server 2003 SP2 on our Web servers, our exports to Excel stopped working from Crystal Reports .NET within all our ASP.NET applications. However, the exports to...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.