473,513 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use crystalreports in visual basic

14 New Member
plz explain me how to use crystalreports in visual basic in detail with an example.actually i have read so many books but still i m not cleared so plz explain me in detail through a good example also through coding and with database connectivity.

i hope i will get reply soon
thanks in advance
waiting 4 ur reply
Jul 30 '07 #1
3 1390
hariharanmca
1,977 Top Contributor
plz explain me how to use crystalreports in visual basic in detail with an example.actually i have read so many books but still i m not cleared so plz explain me in detail through a good example also through coding and with database connectivity.

i hope i will get reply soon
thanks in advance
waiting 4 ur reply

The below Code will Work for External CR Desigen Report.

'StrRecordSelection Declare as String Globle
'StrRecordSelection wil Contain Record selection

'strreportpath Declare as String Globle
'strreportpath will contain Report path.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. On Error Resume Next
  3. '    Setting
  4.     Set crystal = New CRAXDRT.Application           'MANAGES REPORTS
  5.     Set Report = Nothing
  6.     Set Report = crystal.OpenReport(strreportpath)  'OPEN  REPORT
  7. Report.Database.LogOnServer "pdsodbc.dll", <Database Name>, <DSN Name>, <User Name>, <Password>
  8.     If StrRecordSelection <> "" Then
  9.         Report.RecordSelectionFormula = StrRecordSelection
  10.     End If
  11.     Report.DiscardSavedData                         'CLEARS REPORT SO WE WORK FROM RECORDSET
  12.     Cry.ReportSource = Report                       'LINK VIEWER TO REPORT
  13.     Cry.ViewReport
  14.     Cry.Zoom 1
  15.     Set crystal = Nothing
  16.     StrRecordSelection = ""
  17.     strreportpath = ""
  18. End Sub
Jul 31 '07 #2
hariharanmca
1,977 Top Contributor
Billow is the procedure to Call that Report Form.

Expand|Select|Wrap|Line Numbers
  1. StrRecordSelection = "{TableName.FieldName} = " & intValue
  2.         strreportpath = App.Path & "\Reports\ReportName.rpt"
  3.         frmReportDisplayForumName.Show 1
Jul 31 '07 #3
r035198x
13,262 MVP
Billow is the procedure to Call that Report Form.

Expand|Select|Wrap|Line Numbers
  1. StrRecordSelection = "{TableName.FieldName} = " & intValue
  2.         strreportpath = App.Path & "\Reports\ReportName.rpt"
  3.         frmReportDisplayForumName.Show 1
Moved to VB forum
Jul 31 '07 #4

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

Similar topics

0
2761
by: Stijn Lambert | last post by:
Hi all, I am having some problems with Crystal Reports 9 for Visual Studio .NET ... I have a multithreaded application that prints reports in several threads (based upon incoming requests on a...
2
9696
by: Joel | last post by:
Hi! I have a problem when I run it on another PC. On my PC it runs very fine but when I install it on another PC I have this Error message when I try to preview a report. The type initializer for...
0
1315
by: Susil Patro | last post by:
Hi all, I have installed Visual Studio dot net version 2003, in my machine. I opened a new project for developing an application related to crystal reports. I got the following error, while I...
5
1363
by: Ĺženol Akbulak | last post by:
Hi, I want to use Crystal Reports in my asp.net application. I get this error: ### CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed. ### I have read this solution and then...
3
1986
by: Lorenc | last post by:
Is anybody experiencing the following error when trying to export a crystal report to a pdf? This error happens randomly. ------------------------------------------------------------------------...
2
7124
by: Anne DeBlois | last post by:
Hi, We are developing an application based on an MSDE database. We want to create various reports such as a printable catalog that contains pictures. Because our application will ship with over...
2
1298
by: mattioli.mirko | last post by:
Hi , I have a problem with CrystalReports. It is possible create CrystalReports at runtime? I don't have the file .xsd at designer , when run my application, I have the DataTable object , and the...
3
1284
by: nmsreddi | last post by:
Hello all, i hav a web application in that there are as many as reports done in default crystal reports with visual studio1.1 .now when i uploaded my application in web i am able to...
0
796
by: anianu | last post by:
how to use crystalreports in visual basic 6.0.please explain me in detail through an example.i hope i will get my reply soon actually i read black book and also book from peter norton but...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7379
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,...
0
7535
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...
1
7098
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
5682
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,...
1
5084
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...
0
3232
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...
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.