473,722 Members | 2,459 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crystal Report Problems

hello,

i am having problems with loading a crystal report in asp.net, below is the
code, the error message.

for shorts the following is bugging
st = oRpt.FormatEngi ne.ExportToStre am(req)
please help,
its been 2 days now and i cant figure this

Thanks
MP

code
=============== ===============

Dim str As String = "'0','2','7 '"
CrystalReportVi ewer1.ReportSou rce = Server.MapPath( "admin_print.rp t")
If Not Me.IsPostBack Then
Dim Ods As DataSet
Try
oRpt = New ReportDocument
oRpt.Load(Serve r.MapPath("admi n_print.rpt"))
'Ods = dg.DataSource
Ods = getData(str)
'Response.Write (Ods.Tables.Cou nt.ToString)
oRpt.SetDataSou rce(Ods)
Call ExportToPDF() ' this inititiates the next sub where it fails
Catch oException As Exception
'Throw oException
Response.Write( oException.ToSt ring)
Finally
oRpt.Dispose()
'Ods.Dispose()
'Ods.Clear()
End Try
End If

Private Sub ExportToPDF()
Dim tblCurrent As CrystalDecision s.CrystalReport s.Engine.Table
Dim tliCurrent As CrystalDecision s.Shared.TableL ogOnInfo
For Each tblCurrent In oRpt.Database.T ables
tliCurrent = tblCurrent.LogO nInfo
With tliCurrent.Conn ectionInfo
'get log in info from web.config
..ServerName = ConfigurationSe ttings.AppSetti ngs("SQLServer" )
..DatabaseName = ConfigurationSe ttings.AppSetti ngs("Database")
..UserID = ConfigurationSe ttings.AppSetti ngs("UserId")
..Password = ConfigurationSe ttings.AppSetti ngs("Password")
End With
'apply the log in info
tblCurrent.Appl yLogOnInfo(tliC urrent)
Next tblCurrent

Dim crExportOptions As ExportOptions
Dim st As System.IO.Strea m
crExportOptions = oRpt.ExportOpti ons
With crExportOptions
..FormatOptions = New PdfRtfWordForma tOptions
..ExportFormatT ype = ExportFormatTyp e.PortableDocFo rmat
End With
Dim req As ExportRequestCo ntext = New ExportRequestCo ntext
req.ExportInfo = crExportOptions
st = oRpt.FormatEngi ne.ExportToStre am(req)
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.Binary Write(b)
End Sub
===============
error stack
=============== =============== =====
Logon failed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.LogOnE xception:
Logon failed.
Nov 19 '05 #1
2 1489
skg
Looks like your reports are failing to LogIn into the database. Check your
Report to see what userid and password they are using to logon into the
database.

"Michael Persaud" <mi************ **@hotmail.com> wrote in message
news:e3******** ******@TK2MSFTN GP09.phx.gbl...
hello,

i am having problems with loading a crystal report in asp.net, below is
the
code, the error message.

for shorts the following is bugging
st = oRpt.FormatEngi ne.ExportToStre am(req)
please help,
its been 2 days now and i cant figure this

Thanks
MP

code
=============== ===============

Dim str As String = "'0','2','7 '"
CrystalReportVi ewer1.ReportSou rce = Server.MapPath( "admin_print.rp t")
If Not Me.IsPostBack Then
Dim Ods As DataSet
Try
oRpt = New ReportDocument
oRpt.Load(Serve r.MapPath("admi n_print.rpt"))
'Ods = dg.DataSource
Ods = getData(str)
'Response.Write (Ods.Tables.Cou nt.ToString)
oRpt.SetDataSou rce(Ods)
Call ExportToPDF() ' this inititiates the next sub where it fails
Catch oException As Exception
'Throw oException
Response.Write( oException.ToSt ring)
Finally
oRpt.Dispose()
'Ods.Dispose()
'Ods.Clear()
End Try
End If

Private Sub ExportToPDF()
Dim tblCurrent As CrystalDecision s.CrystalReport s.Engine.Table
Dim tliCurrent As CrystalDecision s.Shared.TableL ogOnInfo
For Each tblCurrent In oRpt.Database.T ables
tliCurrent = tblCurrent.LogO nInfo
With tliCurrent.Conn ectionInfo
'get log in info from web.config
.ServerName = ConfigurationSe ttings.AppSetti ngs("SQLServer" )
.DatabaseName = ConfigurationSe ttings.AppSetti ngs("Database")
.UserID = ConfigurationSe ttings.AppSetti ngs("UserId")
.Password = ConfigurationSe ttings.AppSetti ngs("Password")
End With
'apply the log in info
tblCurrent.Appl yLogOnInfo(tliC urrent)
Next tblCurrent

Dim crExportOptions As ExportOptions
Dim st As System.IO.Strea m
crExportOptions = oRpt.ExportOpti ons
With crExportOptions
.FormatOptions = New PdfRtfWordForma tOptions
.ExportFormatTy pe = ExportFormatTyp e.PortableDocFo rmat
End With
Dim req As ExportRequestCo ntext = New ExportRequestCo ntext
req.ExportInfo = crExportOptions
st = oRpt.FormatEngi ne.ExportToStre am(req)
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.Binary Write(b)
End Sub
===============
error stack
=============== =============== =====
Logon failed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.LogOnE xception:
Logon failed.

Nov 19 '05 #2
hello,

thanks

i am using the sa and that password

plus i have a connection string that is creating the dataset and i traced
that to be a workable item

every other call works so why does this one fail?

thanks
MP


"skg" <sk*@yahoo.co m> wrote in message
news:#v******** ******@TK2MSFTN GP14.phx.gbl...
Looks like your reports are failing to LogIn into the database. Check your
Report to see what userid and password they are using to logon into the
database.

"Michael Persaud" <mi************ **@hotmail.com> wrote in message
news:e3******** ******@TK2MSFTN GP09.phx.gbl...
hello,

i am having problems with loading a crystal report in asp.net, below is
the
code, the error message.

for shorts the following is bugging
st = oRpt.FormatEngi ne.ExportToStre am(req)
please help,
its been 2 days now and i cant figure this

Thanks
MP

code
=============== ===============

Dim str As String = "'0','2','7 '"
CrystalReportVi ewer1.ReportSou rce = Server.MapPath( "admin_print.rp t")
If Not Me.IsPostBack Then
Dim Ods As DataSet
Try
oRpt = New ReportDocument
oRpt.Load(Serve r.MapPath("admi n_print.rpt"))
'Ods = dg.DataSource
Ods = getData(str)
'Response.Write (Ods.Tables.Cou nt.ToString)
oRpt.SetDataSou rce(Ods)
Call ExportToPDF() ' this inititiates the next sub where it fails
Catch oException As Exception
'Throw oException
Response.Write( oException.ToSt ring)
Finally
oRpt.Dispose()
'Ods.Dispose()
'Ods.Clear()
End Try
End If

Private Sub ExportToPDF()
Dim tblCurrent As CrystalDecision s.CrystalReport s.Engine.Table
Dim tliCurrent As CrystalDecision s.Shared.TableL ogOnInfo
For Each tblCurrent In oRpt.Database.T ables
tliCurrent = tblCurrent.LogO nInfo
With tliCurrent.Conn ectionInfo
'get log in info from web.config
.ServerName = ConfigurationSe ttings.AppSetti ngs("SQLServer" )
.DatabaseName = ConfigurationSe ttings.AppSetti ngs("Database")
.UserID = ConfigurationSe ttings.AppSetti ngs("UserId")
.Password = ConfigurationSe ttings.AppSetti ngs("Password")
End With
'apply the log in info
tblCurrent.Appl yLogOnInfo(tliC urrent)
Next tblCurrent

Dim crExportOptions As ExportOptions
Dim st As System.IO.Strea m
crExportOptions = oRpt.ExportOpti ons
With crExportOptions
.FormatOptions = New PdfRtfWordForma tOptions
.ExportFormatTy pe = ExportFormatTyp e.PortableDocFo rmat
End With
Dim req As ExportRequestCo ntext = New ExportRequestCo ntext
req.ExportInfo = crExportOptions
st = oRpt.FormatEngi ne.ExportToStre am(req)
Response.ClearC ontent()
Response.ClearH eaders()
Response.Conten tType = "applicatio n/pdf"
Dim b(st.Length) As Byte
st.Read(b, 0, st.Length)
Response.Binary Write(b)
End Sub
===============
error stack
=============== =============== =====
Logon failed.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: CrystalDecision s.CrystalReport s.Engine.LogOnE xception: Logon failed.


Nov 19 '05 #3

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

Similar topics

1
2015
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 server, then the report containing the data can be viewed within the browser using a Crystal Viewer. My experience with Crystal is limited to VB client apps, so this is the limit of my understanding of precisely how this works in the ASP world. Once...
7
4025
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at runtime, the report still showed the results from the default query (from within the Crystal Report). Then I tried the XSD solution where you define a dataset (that mataches the database and the Crystal Report) and have the Crystal Report use this....
1
2782
by: rdshultz | last post by:
My company is going to a new software were I have to learn Crystal Reports. Had my first class and I'm a little confused. The instructor said everytime you run a Crystal report you have to do a "Refresh" if you want the most current data from the tables and that the data stays on your computer. I want the most current data everytime the user runs a report without having to do a "Refresh" and I would think that all that data residing on...
0
2270
by: Chris | last post by:
I have the following situation in a VB.Net App I am working on: 1.)A report created in VS.Net 2003 using the CR.Net component of VS 2003. 2.)The datasource for the report is a Stored Proc in a SQL Server DB (pull method). 3.)The Stored Proc has two input parameters of type date. 4.)The Stored Proc is a rather complex proc that was not written by me, but does work(see next item). It currently returns about 13K rows of data. 5.)The...
9
8270
by: Altman | last post by:
I am currently using ASP.Net 2003 and will be upgrading to 2005 sometime in the near future. I have been having issues with using Crystal Reports that were included with .Net to handle my reporting needs. I was wondering if anybody has an opinion on how the new reportViewer control works in comparison to Crystal. One of the main problems I have been having with Crystal Reports is that they seem to load very slow no matter how small the...
0
9386
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8059
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6685
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2606
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2148
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.