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

Crystal Report 10

114 100+
Guys, i have created reports in crystal report 10 for my VB application. Now how sud i open the report from my application. Infact i have tried opening the report but i get the following error:
[HTML]Logon failed.
Details: ADO Error Code: 0x80040e4d
Source: Microsoft OLE DB Provider for SQL Server
Description: Login failed for user 'sa'
SQL State: 42000
Native Error: 18456[/HTML]

My code was:
[HTML]Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
CrystalActiveXReportViewer1.Top = 0
CrystalActiveXReportViewer1.Left = 0
CrystalActiveXReportViewer1.Height = ScaleHeight
CrystalActiveXReportViewer1.Width = ScaleWidth
Set Report = Appl.OpenReport("e:\report\rptmaster.rpt")
CrystalActiveXReportViewer1.ReportSource = Report
CrystalActiveXReportViewer1.ViewReport[/HTML]

My database is located in a network server wher SQL server is installed n i have created an odbc datasource for the connection. I have used the same connection with the report an it works. I have added the username and password to access the database in the report. It connects well and can retrieve the data. But when i open the same report via Visual Basic i get the above errors.

What is the possible cause????? Plus i need 2 ask why i cannot find the Crystal Report Viewer Control 10 in the componenents list as suggested by some ppl. I get the Crystal ActiveX report viewer control instead.
Feb 20 '08 #1
3 7629
debasisdas
8,127 Expert 4TB
Try this sample code

The following code uses crystal report viewer and connection is for oracle database.

Expand|Select|Wrap|Line Numbers
  1. Public Sub ReportDisplay(Query As String)
  2.  
  3. Set CRXReport = CrystalReport1
  4. Set CRXDb = CRXReport.Database
  5. CRXReport.DiscardSavedData
  6.  
  7. inti = 1
  8. Do Until inti = CRXReport.Database.Tables.count + 1
  9. CRXReport.Database.Tables.Item(inti).SetLogOnInfo strdblocation, "orcl", "debasis", "debasis"
  10. inti = inti + 1
  11. Loop
  12.  
  13. CrystalReport1.SQLQueryString = Query
  14.  
  15. With FrmReport
  16. .Show
  17. .CRV1.ReportSource = CRXReport
  18. .CRV1.ViewReport
  19. End With
  20.  
  21. Set CRXReport = Nothing
  22. End Sub
  23.  
  24.  
Feb 20 '08 #2
raaman rai
114 100+
i did try ur code but i couldnt succed and i tried the following code but still not working;
[HTML]
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
CrystalActiveXReportViewer1.Top = 0
CrystalActiveXReportViewer1.Left = 0
CrystalActiveXReportViewer1.Height = ScaleHeight
CrystalActiveXReportViewer1.Width = ScaleWidth
Set Report = Appl.OpenReport("e:\reports\rptmaster.rpt")
Report.Database.LogOnServer "p2ssql.dll", "192.168.0.1", "cab", "sa", "123456"
CrystalActiveXReportViewer1.ReportSource = Report
CrystalActiveXReportViewer1.ViewReport[/HTML]

Can i know any other alternatives?
Feb 20 '08 #3
raaman rai
114 100+
Ultimately, i found this solution n it worked 4 me. N i m sure it will work for every body too. So, i m leaving this code for the reference to the ppl with the same problem

[HTML]
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
CrystalActiveXReportViewer1.Top = 0
CrystalActiveXReportViewer1.Left = 0
CrystalActiveXReportViewer1.Height = ScaleHeight
CrystalActiveXReportViewer1.Width = ScaleWidth
Set Report = Appl.OpenReport("your report path")
Report.Database.LogOnServer "p2ssql.dll", "your servername", "your database", "your username", "your password"
For i = 1 To Report.Database.Tables.Count
Report.Database.Tables(i).ConnectionProperties.Ite m("Password") = "your password"
Next i
CrystalActiveXReportViewer1.EnableGroupTree = False
CrystalActiveXReportViewer1.ReportSource = Report
CrystalActiveXReportViewer1.ViewReport
[/HTML]
But please note that i havent tried this with the Windows Authentication for SQL Server.And i would like to say that the report opens very late...which i cannot say...plus i would recommend to use Crystal32.ocx component rather than the Crviewer. I think it will be better in terms of opening the report faster and the implementation approach (i mean the coding) is easier if you already have the report created.All the best!
Feb 21 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
0
by: Dr. Indera | last post by:
hello, i previously posted the questions below on several crystal reports newsgroups, including the one for the company that makes crystal reports, but never got an answer, so i'm hoping that...
2
by: Mythran | last post by:
In .Net, how can I go about and set a Crystal Reports namespace? Right now they use the Root Namespace (VB) from the project. How can I extend the namespace for a single report (which will be set...
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
1
by: bthomas71chevy | last post by:
I have just setup a WebServer and all the applications work fine, but when every any of the applications try to generate a Crystal Report the page errors out. "File or assembly name...
0
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...
9
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...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
11
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I stop receiving this message while calling a crystal report? "The report you requested requires further information." Thanks
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...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.