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 June 7th, 2007, 05:34 PM
Registered User
 
Join Date: Jun 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to vbMarky
Default VB + Crystal Reports + Store Procedure (SQL)

Hi, every body...

I've got a problem. I'm making a report (in Crystal Reports 8..5). This reports executes a Store Procedure. I have an application in VB 2005 from where I send the parameters to the report. One of these parameters is the one I need to execute the store procedure in the report but, when I send the parameters, all of them are shown in the report but the one of the SP doesn't take the value. I have no errors in the VB code. It just does not show any data because this parameter doesn't take any value.

Here's the part of my code.



Dim myReport As New ReportDocument
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim mySubRepDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent

myReport.Load(Application.StartupPath & "\reportes\CONTROL_ACCESOS_X_SISTEMA.rpt")

Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues

crParameterFieldDefinitions = myReport.DataDefinition.ParameterFields

' Here I set the values to the parameters of the report.
crParameterFieldLocation = crParameterFieldDefinitions.Item("@sistema") 'This is the Store Procedure parameter
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = sistemaID
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

crParameterFieldLocation = crParameterFieldDefinitions.Item("dcsidName")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = generatorName
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldLocation.ApplyCurrentValues(crPara meterValues)

' Here I send the parameters in order to get the connection
For Each tbCurrent In myReport.Database.Tables
    tliCurrent = tbCurrent.LogOnInfo
    With tliCurrent.ConnectionInfo
        .ServerName = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlServerProd")
        .UserID = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlUserProd")
        .Password = decript.desencripta(System.Configuration.Configura tionManager.AppSettings.Item("sqlPassProd"))
        .DatabaseName = System.Configuration.ConfigurationManager.AppSetti ngs.Item("sqlCatalog")
    End With
    tbCurrent.ApplyLogOnInfo(tliCurrent)
Next tbCurrent

Me.CrystalReportViewer1.ReportSource = Nothing
Me.CrystalReportViewer1.ReportSource = myReport
CrystalReportViewer1.Show()



Could you pls help me? I'm getting desperated.

See you

---------------------
Thanks to everyone





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 11 from VB to VB.net koushik_b2002 Crystal Reports 2 June 1st, 2008 01:58 AM
MS SQL SERVER STORE PROCEDURE and schedulling kumiko Classic ASP Basics 2 June 8th, 2007 01:03 AM
vb crystal reports please help! [email protected] Forum and Wrox.com Feedback 0 August 31st, 2005 06:54 AM
Pass parameter to store procedure & Crystal Report quinn Classic ASP Professional 0 March 10th, 2004 02:16 PM





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