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

crystal report logon error

hi all
i am not much expert in asp.net.
i am using crystal rpt for report generation. is any other report
generation method is available???

i use push method to creat report, and it is working fine, when i
export that report to pdf or xls it generate an error like Logon
failure.

CrystalDecisions.CrystalReports.Engine.LogOnExcept ion: Logon failed.

i use the follwing code for genearting report

Sub BindReport()

Dim myConnection As New SqlClient.SqlConnection

myConnection.ConnectionString = "Password=sa;Persist Security
Info=True;User ID=sa;Initial Catalog=pubs;Data Source=USER"

Dim MyCommand As New SqlClient.SqlCommand

MyCommand.Connection = myConnection

MyCommand.CommandText = "Select * from Stores"

MyCommand.CommandType = CommandType.Text

Dim MyDA As New SqlClient.SqlDataAdapter

MyDA.SelectCommand = MyCommand

Dim myDS As New Dataset1

'This is our DataSet created at Design Time

MyDA.Fill(myDS, "Stores")

'You have to use the same name as that of your Dataset that you
created during design time

Dim oRpt As New CrystalReport1

' This is the Crystal Report file created at Design Time

CType(oRpt.ReportDefinition.Sections(1).ReportObje cts(1),
CrystalDecisions.CrystalReports.Engine.TextObject) .Color =
Color.CadetBlue
CType(oRpt.ReportDefinition.Sections(1).ReportObje cts(1),
CrystalDecisions.CrystalReports.Engine.TextObject) .Top = 1
oRpt.SetDataSource(myDS)

' Set the SetDataSource property of the Report to the Dataset

CrystalReportViewer1.ReportSource = oRpt
End Sub

for exporting to pdf i use the following cod on a buton click.
it generate a error at last line " myReport.Export()"

Dim myReport As CrystalReport1 = New CrystalReport1
Dim DiskOpts As
CrystalDecisions.Shared.DiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
myReport.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
myReport.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
DiskOpts.DiskFileName = "c:\Output.pdf"
myReport.ExportOptions.DestinationOptions = DiskOpts

how i solve it
any reply is appriciated
thanks in advance
with regards
vipin

Jan 2 '06 #1
1 1662
It seems ur missing to set the Datasource property of the report during
post back.
ie we need to again fill the dataset and assign it to the report before
exporting.

Praveen P

Jan 2 '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,...
1
by: Bob Skutnick | last post by:
Help.... I've created an ADO.NET dataset in Visual Studio (a web project). I build the project and then try to create a Crystal Report using the dataset. When I try to use the ADO.NET dataset...
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...
0
by: Bonj | last post by:
Hi I am trying to create a simple 'hello world' type web application involving a crystal report. I have basically done it the simplest possible way as described in the documentation, by adding a...
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: 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...
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,...
3
by: Hugh O | last post by:
Hi, I have been trying to load a Crystal Report newly created via VS.Net 2003. I am using a simply ASP form with only the Crystal Report Viewer. The sample report results display in the...
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...
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...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.