Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2006, 01:30 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal Reports 11 from VB to VB.net

HI,

I am converting a VB6 project into VB.Net.

I have used Crystal reports 11 in VB6. i have used CRAXDRT.application and generated report in VB6.

in VB.Net i am using CrystalDecisions.CrystalReports.Engine.reportdocum ent


Can any one please tell me how can i pass the sqlquerystring (i have used this in VB6 to pass the sql to reportto reset the sql dynamically).

please tell me exact code which would load the report, pass the log oninfo and then pass the sql string and show the report using CrystalReportViewer.

i have attached the VB6 Piece of code for the same. Please tell me the equivalent Vb.Net code

Public crApp As New CRAXDRT.Application
Public crRpt As CRAXDRT.Report
Public crTab As CRAXDRT.DatabaseTable

Set crRpt = crApp.OpenReport(gDataPath + "R101.rpt", 1)

crRpt.FormulaFields.Item(4).Text = "'" & sFromDateParm & "'"
crRpt.FormulaFields.Item(5).Text = "'" & sToDateParm & "'"


For Each crTab In crRpt.Database.Tables
     crTab.ConnectionProperties.Item("Data Source") = dbHostName
     crTab.ConnectionProperties.Item("User ID") = gDbLoginID
     crTab.ConnectionProperties.Item("Password") = gDbPswd
    Next

crRAATSRpt.SQLQueryString = sql ' sql - will have my updatedquery

crViewer.ReportSource = crRpt


Please help me. Thanks in advance.
 
Old July 19th, 2006, 06:04 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

please reply.....

 
Old June 1st, 2008, 01:58 AM
Authorized User
 
Join Date: Jun 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this one. this is about passing sql query string to crystal reports.

http://vb.net-informations.com/cryst...ery_string.htm

http://vb.net-informations.com/cryst..._tutorials.htm

lee






Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 1.1,VB.NET,crystal reports, SQl server gvi Crystal Reports 1 September 11th, 2008 02:55 AM
Crystal reports and VB.NET minnug Crystal Reports 0 May 20th, 2007 10:09 PM
exporting crystal reports through vb.net nikks9 Crystal Reports 0 May 16th, 2006 04:16 AM
Crystal Reports in VB.Net PatMcM VB.NET 2002/2003 Basics 0 January 31st, 2006 03:37 AM
Invoking Crystal Reports from VB.Net cyrilvictor Crystal Reports 0 December 1st, 2004 05:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.