473,467 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Create 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 1389
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
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
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
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
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
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
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
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
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
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...
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
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
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
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,...
1
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.