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

Run Crystal Report 10 without Crystal ActiveX Viewer

114 100+
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 9822
raaman rai
114 100+
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 Expert 4TB
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 100+
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 Expert 4TB
You need to handle that in the form resize event.
Feb 26 '08 #5
QVeen72
1,445 Expert 1GB
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 100+
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...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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: 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
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.