Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old May 11th, 2006, 05:29 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all,
Can i link Crystal report10 with VB6? Is this new version of crystal report solve these problems:
1.when i want to print a report which is in Persian(Farsi)it omitt the last alphabets of the words in crystal report7.0
2.when i use a complex code which has number,alphabet and (/,?.!,etc)together it disarrange the code(in crystal report7.0)
Thanks for answering me as soon as possible,
Regards,
Leva

Reply With Quote
  #12 (permalink)  
Old May 16th, 2006, 01:23 AM
Authorized User
 
Join Date: May 2006
Location: Chennai, TN, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Prashu
Default

Here is a solid answer DRock that i took from another forum

Project > Components, add a reference to the Crystal Reports ActiveX
Designer Run Time Library (CRAXDRT.DLL)

From Project > Components, choos the Crystal ActiveX Report Viewer
library 10.0 (crviewer.dll)

Create a form with a CR Viewer object on it. Resize as needed.

Here's the absolute minimum code neede to run a report

Dim crxApp As CRAXDRT.Application
Dim crxRpt As CRAXDRT.Report

Set crxApp = New CRAXDRT.Application
Set crxRpt = crxApp.OpenReport("C:\MyReport.rpt")

'To View the report
CRViewer.ReportSource = crxRpt
CRViewer.ViewReport

'To print the report straight to the printer, prompting _
the user for the # of pages
crxRpt.PrintOut False


Reply With Quote
  #13 (permalink)  
Old May 16th, 2006, 05:22 AM
Authorized User
 
Join Date: May 2006
Location: Chennai, TN, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Prashu
Default

I have the following code to pass parameter field from vb6 to the crystal report developed in CR10 but I get an error message

"details: 01000:[microsoft][odbc driver manager] the driver doesn't support the version of ODBC behavior that the application requested(see SQLsetEnvAttr)."

Can anyone tell me how to solve this?

VB Code:

    Private Appl As New CRAXDRT.Application
    Private Report As New CRAXDRT.Report

Private Sub Command1_Click()
  Set Report = Appl.OpenReport("C:\Documents and Settings\prashanth_d01\Desktop\project1\Prjt3.rpt" )
        Report.EnableParameterPrompting = True
        Report.DiscardSavedData
        Report.ParameterFields(1).ClearCurrentValueAndRang e
        Report.ParameterFields(1).AddCurrentValue "0"
        Report.ParameterFields(2).ClearCurrentValueAndRang e
        Report.ParameterFields(2).AddCurrentValue "0"
        Report.ParameterFields(3).ClearCurrentValueAndRang e
        Report.ParameterFields(3).AddCurrentValue "0"
    With CrystalActiveXReportViewer1
        .ReportSource = Report
        .RefreshEx True
        .Refresh
        .ViewReport
   End With
        Appl.CanClose
        Set Appl = Nothing
End Sub


Reply With Quote
  #14 (permalink)  
Old May 18th, 2006, 10:27 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by ahmed_hammam70
 You Can Use the following code after adding the component : Crystal ActiveX Report Viewer Library 10.0
-----------
Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport("d:\Report3.rpt")
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
----------

where CRViewer1 is the name of the added component to your project

Tnx Bro!
Workz Fine for me using MS Access Database

How bout using SQL Server 2005?
Here's Your Code (ahmed_hammam70)

Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport(App.Path & "\Reports\Report1.rpt")
Report.DiscardSavedData
CRViewer1.ReportSource = Report
CRViewer1.ViewReport

...It sends me an error message
Login Failed for 'sa'
.. I suspect it requires password

Reply With Quote
  #15 (permalink)  
Old May 23rd, 2006, 12:50 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Set the Database Logon Info and check.

(If CR is needed with SQL 2005, then i recommend you to use .net (VB/C#) which
comes with CR as part of it and you can really use those fuctionality very well)

Hope this helps

With Regards,
Raghavendra Mudugal

With Regards,
Raghavendra Mudugal
Reply With Quote
  #16 (permalink)  
Old May 24th, 2006, 10:56 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tnx...
Raghavendra
but im Just trying to upgrade MSAccess->SQLserver 2005 and CR7->CR10 my with my old progz(in VB6)
Anyones got an idea?

Reply With Quote
  #17 (permalink)  
Old May 25th, 2006, 12:43 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are planned for upgradation then, put one more item in your list
VB6->VB.NET
Because CR10, they actually say it was for .NET, If you want to use CR with VB6,
CR7 or CR8 is fine, and intercepts for CR10, I guess needs CLR.

http://support.businessobjects.com/c...win_en_sp4.pdf

Anyway,


for the error "Login Failed for 'sa'", for the report which you want to show,
the Report Document object has a method SetDatabaseLogon (uid, pwd, servername,
and dbname). try checking this, might fix your problem.

Hope this Helps,


With Regards,
Raghavendra Mudugal
Reply With Quote
  #18 (permalink)  
Old May 28th, 2006, 09:54 PM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey big tnx...
u guys help me a lot!!!
ive already upgraded to vb2005, vb6->vb2005 much simpler than
vb6->vb.net and faster...tnx anyway

anyway heres the soln i made for those who still having probz

Dim Appl As New CRAXDRT.Application
Dim Report As New CRAXDRT.Report
Set Report = Appl.OpenReport(App.Path & "\Reports\report1.rpt")
With Report.Database.Tables(1)
.ConnectionProperties("User ID").Value = "sa"
.ConnectionProperties("Password").Value = "pass"
.ConnectionProperties("Initial Catalog").Value = "MyDatabase"
.ConnectionProperties("Data Source").Value = "MyServer"
End With
Report.DiscardSavedData
CRViewer1.ReportSource = Report
CRViewer1.ViewReport


Reply With Quote
  #19 (permalink)  
Old June 8th, 2006, 12:56 AM
Authorized User
 
Join Date: May 2006
Location: Chennai, TN, India.
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Prashu
Default

I have a VB6.0 application that calls reports developed in CR4.6. my new requirement is to get all these reports to CR10 and view from VB6.0. I just opened the rpt files saved them in CR10 and tried to view it using a simple code below

    Private Appl As New CRAXDRT.Application
    Private Report As New CRAXDRT.Report
    Set Report = Appl.OpenReport("C:\Documents and Settings\prashanth_d01\Desktop\project1\csisbcsa.r pt")

Report.Application.LogOnServer "P2SODBC.DLL", "mntst2.world", , "MN06U", "GANESH"

        With CrystalActiveXReportViewer1
          .ReportSource = Report
          .viewreport
        End With

This one returns me the below error
"IM006:[microsoft][odbc driver manager] driver's sqlsetconnectattr failed"
However evevrything goes fine if i develop a new report on CR10 and run the above code. It cribs only when i try to save reports developed in 4.6 to CR10 and then try to view it.
Crystal reports gurus plz help!!



Reply With Quote
  #20 (permalink)  
Old June 8th, 2006, 01:36 AM
Friend of Wrox
Points: 687, Level: 9
Points: 687, Level: 9 Points: 687, Level: 9 Points: 687, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Chennai, Tamilnadu, India.
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Prashu,

I too had same same problem while converting to CR4.6 to CR8.5.
But I opened the report in CR8.5 and re-reffered the ODBC database link
and refreshed the reports and saved the report with same name in diff location.

By doing this it fixed the problem.

If the above will not fix your problem then, check this link
http://support.businessobjects.com/c...v_dbissues.pdf

and go to the page 4. These are some kbarticles of CR, hope that will def helps you to fix your CR problem.

And make sure when you refresh the report, you are seeing the report data in the
preview window of the CR editor.

Hope this helps


With Regards,
Raghavendra Mudugal
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB6 wont display crystal Reports 10.0 cnobles VB How-To 2 September 7th, 2014 10:21 AM
About Crystal Report 10 Suhas VB How-To 2 April 10th, 2007 12:27 AM
Vb6 with crystal reports 10 Eleakim Cribe Pro VB 6 0 June 22nd, 2006 10:20 AM
good book for crystal report 10 swati_joshi ASP.NET 1.0 and 1.1 Basics 1 April 20th, 2006 04:09 AM
crystal report 10 santwan Classic ASP Professional 0 December 16th, 2005 05:58 AM



All times are GMT -4. The time now is 03:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.