473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Run Crystal Report 10 without Crystal ActiveX Viewer

114 New Member
guys, i just wanna ask that can we run crystal report 10 in our visual basic application without using Crystal ActiveX Viewer. Infact before i had used the crystal32.ocx component for CR8 n it had worked good. but now as i have switched to cr10, i tried using CR activex viewer (CRViewer) and its really slow. So, i thought to use the crystal32.ocx component for cr10 also which i couldnt find.

the scenario i have is, have created readymade reports and saved in my application path.Then i have added the crystal report 10 from project menu in my VB application. then a screen pops up for new report or existing one in which i have selected the existing one and directed to one of my saved reports. Now in the designers column i have CrystalReport1 which i have not been able to implement. How sud i code now to open the report?
Feb 26 '08 #1
6 9828
raaman rai
114 New Member
sorry guys, i found out recently that crystal32.ocx is not supported after CR8.5. But i must ask how to go about here after. Please kindly follow the steps below.
I have already designed and created my reports and saved in my application path. Plus the backend for my vb application is sql server 2000.

[HTML]Added Crystal report 10 from the project menu
Pop-up interface comes up to ask for new report or existing report
I selected existing report and selected one of my report
then again a pop-up interface comes up to ask if a form containing crystal report viewer control to be added automatically
i selected no
Then the report is displayed with CrystalReport1 under the Designers tree in the VB application.[/HTML]

Now here after i dont know how to open the report programmatically. I just want to pass the existing connection object to the report and also pass some sql query to the report before opening it. So please help me!
Feb 26 '08 #2
debasisdas
8,127 Recognized Expert Expert
try using this sample code.

Expand|Select|Wrap|Line Numbers
  1. Public CRXReport As CRAXDDRT.Report
  2. Public CRXDb As CRAXDDRT.Database
  3. Public CRXTbl As CRAXDRT.DatabaseTable
  4. Public SlNoVal As String
  5.  
  6.  
  7. Public Sub ReportDisplay(QUERY As String)
  8.  
  9. Set CRXReport = CrystalReport6
  10. Set CRXDb = CRXReport.Database
  11. CRXReport.DiscardSavedData
  12.  
  13. inti = 1
  14. Do Until inti = CRXReport.Database.Tables.Count + 1
  15. CRXReport.Database.Tables.Item(inti).SetLogOnInfo strdblocation, "das", "debasis", "debasis"
  16. inti = inti + 1
  17. Loop
  18.  
  19. CrystalReport6.SQLQueryString = QUERY
  20.  
  21. With FrmReport
  22. .Show
  23. .CRV1.ReportSource = CRXReport
  24. .CRV1.ViewReport
  25. End With
  26.  
  27. Set CRXReport = Nothing
  28. End Sub
  29.  
Feb 26 '08 #3
raaman rai
114 New Member
thanku man, but i havent tried ur code. actually i found out the following solution and its working gud. any way thank u onceagain.
[HTML]Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
For i = 1 To Report.Database.Tables.Count
Report.Database.Tables(i).ConnectionProperties.Ite m("Password") = "123456"
Next i
Report.DiscardSavedData
Report.RecordSelectionFormula = "{tblContractor.CDBNo} ='" & FrmMain.txtcdb & "'"
CRViewer1.EnableGroupTree = False
CRViewer1.ViewReport
Screen.MousePointer = vbDefault[/HTML]

Well i need to ask how can we make the CRViewer's length and height to full (screen length & height) at runtime?
Feb 26 '08 #4
debasisdas
8,127 Recognized Expert Expert
You need to handle that in the form resize event.
Feb 26 '08 #5
QVeen72
1,445 Recognized Expert Top Contributor
Well i need to ask how can we make the CRViewer's length and height to full (screen length & height) at runtime?
Hi,
write this before ViewReport:

CrViewer1.Height = Me.Height
CrViewer1.Width = Me.Width
CrViewer1.ViewReport

REgards
Veena
Feb 26 '08 #6
raaman rai
114 New Member
Yes fren, i did as u said but cant find the difference. in fact the following code is all that i have in my form with the CRViewer Control.
Expand|Select|Wrap|Line Numbers
  1. Dim Report As New CrystalReport1
  2. Private Sub Form_Load()
  3.  
  4. On Error GoTo ErrReport
  5.  
  6. Screen.MousePointer = vbHourglass
  7. CRViewer1.ReportSource = Report
  8. For i = 1 To Report.Database.Tables.Count
  9. Report.Database.Tables(i).ConnectionProperties.Item("Password") = "123456"
  10. Next i
  11. Report.DiscardSavedData
  12. Report.RecordSelectionFormula = "{tblContractor.CDBNo} ='" & FrmMain.txtcdb & "'"
  13. CRViewer1.EnableGroupTree = False
  14. CRViewer1.ViewReport
  15. Screen.MousePointer = vbDefault
  16.  
  17. Exit Sub
  18.  
  19. ErrReport:
  20.    DisplayError
  21.  
  22. End Sub
  23.  
  24. Private Sub Form_Resize()
  25.  
  26. CRViewer1.Top = 0
  27. CRViewer1.Left = 0
  28. ' CRViewer1.Height=Screen.Height
  29. ' CRViewer1.Width=Screen.Width
  30. CRViewer1.Height = Me.Height
  31. CRViewer1.Width = Me.Width
  32.  
  33. End Sub
Then wat pobably might b wrong?
Feb 26 '08 #7

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

Similar topics

3
by: Robert Schuldenfrei | last post by:
Dear NG, I have Crystal Reports working to a file and directly to the printer with the following: private void mnuInvRep1301_Click(object sender, System.EventArgs e) {
5
by: Robert Schuldenfrei | last post by:
Hi Again, Forgive me for posting this again, but old items seem to get little review. I thought I could adjust the viewer properties without any further aid from the NG, but I was wrong. When...
1
by: James | last post by:
Hello, I have developed a reporting application w/ASP.NET on IIS v5 utilizing the Crystal Reports v9 ActiveX Viewer. Another developer has produced several reports using the client version of...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
1
by: pmkconsulting | last post by:
Hello, I am using an asp script that uses rptserver.asp to display some reports over http. It worked fine previously but now the webpages with the report display just hang. I tried switching from...
8
by: rzaleski | last post by:
I am trying to display a Crystal Report in an application I developed. I used the following tools: Microsoft Visual Studio.NET 2005 Standard Crystal Reports 10 Professional I am using the...
0
by: SwamyKarthik | last post by:
I am trying to build an app that reads crystal reports. I was able to load the Crystal report viewer as a ActiveX plugin however I'm having problems. Here's my code: Public Class Form1 ...
3
by: raaman rai | last post by:
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:...
0
by: Vincent | last post by:
We have used Crystal Report Web Viewer on ASP pages (using ActiveX), and it works perfectly on Windows 2000 machine with IIS 5 and SQL 2K. Now we already migrated the applications to Windows Server...
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,...
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,...
1
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
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?
0
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 ...
0
muto222
php
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.