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

Help with crystal reports in ASP.net

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 why is the bloody thing doing this.
The paths have been checked and are correct.
The crystal Report is a .rpt file. Not one created in the VS.net IDE but in
crystal itself.
It runs fine. It is a SELECT statement against the DB.
I am stuck. Help me get moving again.

<code>
dim str strOrderId as string
strOrderId = "1234"
Dim cryRptDestinationOptions As New
CrystalDecisions.Shared.DiskFileDestinationOptions
With cryRptDestinationOptions
.DiskFileName = (Server.MapPath("./OCCOrderDetailPDFs/" & strOrderId &
".pdf"))
End With
Dim cryRptTheReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocum ent

With cryRptTheReport
.Load(Server.MapPath("./Reports/FI0002-OccBillDetails.rpt"),
CrystalDecisions.[Shared].OpenReportMethod.OpenReportByDefault)
Dim cryRtpLogintableInfo As New CrystalDecisions.Shared.TableLogOnInfo
Dim MyConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
With MyConnectionInfo
.ServerName = "Modor"
.DatabaseName = "MountDoom"
.UserID = "Nazgul"
.Password = "OneRing"
End With
Dim T As CrystalDecisions.CrystalReports.Engine.Table
For Each T In .Database.Tables
cryRtpLogintableInfo = T.LogOnInfo
cryRtpLogintableInfo.ConnectionInfo = MyConnectionInfo
T.ApplyLogOnInfo(cryRtpLogintableInfo)
Next
.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
.ExportOptions.DestinationOptions = cryRptDestinationOptions
.Export()
End With
</code>
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
Nov 19 '05 #1
3 3763
If you send your report file to me, I can try to figure
out the problem.

BTW, which CrystalDesions version are you using , 1.0 or
1.1.

Elton Wang
el********@hotmail.com

-----Original Message-----
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 why is the bloody thing doing this.The paths have been checked and are correct.
The crystal Report is a .rpt file. Not one created in the VS.net IDE but incrystal itself.
It runs fine. It is a SELECT statement against the DB.
I am stuck. Help me get moving again.

<code>
dim str strOrderId as string
strOrderId = "1234"
Dim cryRptDestinationOptions As New
CrystalDecisions.Shared.DiskFileDestinationOption s
With cryRptDestinationOptions
.DiskFileName = (Server.MapPath ("./OCCOrderDetailPDFs/" & strOrderId &".pdf"))
End With
Dim cryRptTheReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocu ment

With cryRptTheReport
.Load(Server.MapPath("./Reports/FI0002- OccBillDetails.rpt"),CrystalDecisions. [Shared].OpenReportMethod.OpenReportByDefault) Dim cryRtpLogintableInfo As New CrystalDecisions.Shared.TableLogOnInfo Dim MyConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo With MyConnectionInfo
.ServerName = "Modor"
.DatabaseName = "MountDoom"
.UserID = "Nazgul"
.Password = "OneRing"
End With
Dim T As CrystalDecisions.CrystalReports.Engine.Table
For Each T In .Database.Tables
cryRtpLogintableInfo = T.LogOnInfo
cryRtpLogintableInfo.ConnectionInfo = MyConnectionInfo T.ApplyLogOnInfo(cryRtpLogintableInfo)
Next
.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
.ExportOptions.ExportFormatType =
CrystalDecisions. [Shared].ExportFormatType.PortableDocFormat .ExportOptions.DestinationOptions = cryRptDestinationOptions .Export()
End With
</code>
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
.

Nov 19 '05 #2
Got it to work finally.
1] Had to add report viewer to page and mark the crystal shared dll to copy
local.
Weird thing here is afterwards I could remove them and it still
worked !!!
So not sure what they did in the backgroud to fix it.
2] Also note that only a OLEDB connection worked. No other connection worked
as the pasword refused to be accepted by the objects. Actually they refused
to keep the value. It was allways "".

So it is working but no idea why, :(.
Spent why too much time on this and I am currently burned out on it. Still
would like to know why this happened.

Deasun the tired.
www.tirnaog.com

"Elton Wang" wrote:
If you send your report file to me, I can try to figure
out the problem.

BTW, which CrystalDesions version are you using , 1.0 or
1.1.

Elton Wang
el********@hotmail.com

-----Original Message-----
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 why is the bloody thing

doing this.
The paths have been checked and are correct.
The crystal Report is a .rpt file. Not one created in the

VS.net IDE but in
crystal itself.
It runs fine. It is a SELECT statement against the DB.
I am stuck. Help me get moving again.

<code>
dim str strOrderId as string
strOrderId = "1234"
Dim cryRptDestinationOptions As New
CrystalDecisions.Shared.DiskFileDestinationOption s
With cryRptDestinationOptions
.DiskFileName = (Server.MapPath

("./OCCOrderDetailPDFs/" & strOrderId &
".pdf"))
End With
Dim cryRptTheReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocu ment

With cryRptTheReport
.Load(Server.MapPath("./Reports/FI0002-

OccBillDetails.rpt"),
CrystalDecisions.

[Shared].OpenReportMethod.OpenReportByDefault)
Dim cryRtpLogintableInfo As New

CrystalDecisions.Shared.TableLogOnInfo
Dim MyConnectionInfo As New

CrystalDecisions.Shared.ConnectionInfo
With MyConnectionInfo
.ServerName = "Modor"
.DatabaseName = "MountDoom"
.UserID = "Nazgul"
.Password = "OneRing"
End With
Dim T As CrystalDecisions.CrystalReports.Engine.Table
For Each T In .Database.Tables
cryRtpLogintableInfo = T.LogOnInfo
cryRtpLogintableInfo.ConnectionInfo =

MyConnectionInfo
T.ApplyLogOnInfo(cryRtpLogintableInfo)
Next
.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
.ExportOptions.ExportFormatType =
CrystalDecisions.

[Shared].ExportFormatType.PortableDocFormat
.ExportOptions.DestinationOptions =

cryRptDestinationOptions
.Export()
End With
</code>
--
Deasun
Home Site: www.tirnaog.com
Check out: The Code Vault in my forums section.
.

Nov 19 '05 #3
Hi,

Actually, better way to use Crystal report in .NET is to
add Report to .NET project:

Menu Project à Add Existing Item (Files of types: Crystal
Report(*.rpt)) à pick up report

After that VS.NET will create a class name as reportName
which inherits from
CrystalDecisions.CrystalReports.Engine.ReportClass in
hidden reportName.cs (or reportName.vb) and 3 dll
references:
CrystalDecisions.CrystalReports.Engine
CrystalDecisions.ReportSource
CrystalDecisions.Shared

Then you can use the report as object in the project:
ReportName rpt = new ReportName();

Filling data to report is also very simple:
rpt.Database.Tables(0).SetDataSource(dataTable);
Here dataTable is a DataTable that only requires exactly
the same schema as that in report query.

If no parameter is required, after that the report is
ready for Export() or other command. No any logon info is
required.

Elton Wang
el********@hotmail.com
-----Original Message-----
Got it to work finally.
1] Had to add report viewer to page and mark the crystal shared dll to copy local.
Weird thing here is afterwards I could remove them and it still worked !!!
So not sure what they did in the backgroud to fix it.2] Also note that only a OLEDB connection worked. No other connection worked as the pasword refused to be accepted by the objects. Actually they refused to keep the value. It was allways "".

So it is working but no idea why, :(.
Spent why too much time on this and I am currently burned out on it. Still would like to know why this happened.

Deasun the tired.
www.tirnaog.com

"Elton Wang" wrote:
If you send your report file to me, I can try to figure
out the problem.

BTW, which CrystalDesions version are you using , 1.0 or 1.1.

Elton Wang
el********@hotmail.com

>-----Original Message-----
>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 why is the bloody thing
doing this.
>The paths have been checked and are correct.
>The crystal Report is a .rpt file. Not one created in
the VS.net IDE but in
>crystal itself.
>It runs fine. It is a SELECT statement against the DB.
>I am stuck. Help me get moving again.
>
><code>
>dim str strOrderId as string
>strOrderId = "1234"
>Dim cryRptDestinationOptions As New
>CrystalDecisions.Shared.DiskFileDestinationOption s
>With cryRptDestinationOptions
> .DiskFileName = (Server.MapPath

("./OCCOrderDetailPDFs/" & strOrderId &
>".pdf"))
>End With
>Dim cryRptTheReport As New
>CrystalDecisions.CrystalReports.Engine.ReportDocu ment
>
>With cryRptTheReport
> .Load(Server.MapPath("./Reports/FI0002-

OccBillDetails.rpt"),
>CrystalDecisions.

[Shared].OpenReportMethod.OpenReportByDefault)
> Dim cryRtpLogintableInfo As New

CrystalDecisions.Shared.TableLogOnInfo
> Dim MyConnectionInfo As New

CrystalDecisions.Shared.ConnectionInfo
> With MyConnectionInfo
> .ServerName = "Modor"
> .DatabaseName = "MountDoom"
> .UserID = "Nazgul"
> .Password = "OneRing"
> End With
> Dim T As

CrystalDecisions.CrystalReports.Engine.Table > For Each T In .Database.Tables
> cryRtpLogintableInfo = T.LogOnInfo
> cryRtpLogintableInfo.ConnectionInfo =

MyConnectionInfo
> T.ApplyLogOnInfo(cryRtpLogintableInfo)
> Next
> .ExportOptions.ExportDestinationType =
>CrystalDecisions. [Shared].ExportDestinationType.DiskFile > .ExportOptions.ExportFormatType =
>CrystalDecisions.

[Shared].ExportFormatType.PortableDocFormat
> .ExportOptions.DestinationOptions =

cryRptDestinationOptions
> .Export()
>End With
></code>
>--
>Deasun
>Home Site: www.tirnaog.com
>Check out: The Code Vault in my forums section.
>.
>


.

Nov 19 '05 #4

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

Similar topics

3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
0
by: SWu | last post by:
Hi all Could someone please tell me how to configure and deploy my Crystal reports? Any help would be greatly appreciated. I want to be able to deploy my reports/web pages to another domain,...
7
by: mrwoopey | last post by:
I have a asp.net application that uses the crystal report viewer control. It displays all of my reports but all of a sudden it started giving me the following error on ONLY two reports: "Fail...
7
by: John | last post by:
I am using Crystal Reports in my application I made using Visual Studio.NET. I installed my application on the client machine, with all the DLLs required(added the merge modules), the engine and...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
3
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data...
3
by: Mudcat | last post by:
I am not that familiar with Crystal Reports, but having read some other posts I know that the way to integrate the API with Python is through the COM interface provide by win32all. However, I...
3
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a...
1
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings...
0
by: akshaycjoshi | last post by:
Most of you people are already familier with the working of crystal reports unlike me.I am working on an application when I have no other option but to use CR. It is very diff. for me to read an...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.