Stored Procedure parameter (@Carrier) used in report and can't be set via code

I have a report that has regular Crystal parameters that I am setting correctly via code.  However, one report actually uses one of the database parameters from the stored procedure that the report was created from.  It is the only report like this and I'm using the same code in an attempt to set it's value.  Although no error is thown, if I look at the parameter value in the IDE it is set correctly, but the field on the report just shows up blank.  I have changed the way the report is created.  Previously, I used the report.export method to create the actual file via a stored procedure.  Now, I'm running the stored procedure first and creating a datatable.  This allows me to execute the SP only once to see if it has data, because only then do I want to create the actual report.  I'm using the SetDataSource method to pass the datatable into Crystal and then using the report.export method to create the report with data.  Everything seems to work, except this stored procedure parameter (@Carrier) is not actually being populated to display on the report.
Not sure what to look at.  Any suggestions?
Thanks.

crpe32.dll is version 13.0.5.891.  This was developed in VS2012 and VB.NET.  I'm using ADO.Net to connect to a MS SQL Server database.
MainReport.SetDataSource(DTbl)
bRC = PopulateAllSubReports(MainReport)
If Not bRC Then Throw New Exception("Received an error in PopulateAllSubReports.")
bRC = PopulateCrystalParameters(MainReport, SP)
If Not bRC Then Throw New Exception("Received an error in PopulateCrystalParameters.")
'Actually create the output file.
bRC = ExportData(MainReport)
Private Function PopulateCrystalParameters(myReportDocument As ReportDocument, SP As ReportStoredProcedureCrystal) As Boolean
     Dim myParameterFieldDefinitions As ParameterFieldDefinitions = Nothing
     Dim myParameterFieldDefinition As ParameterFieldDefinition = Nothing, ParamValue As String = ""
     Dim bRC As Boolean, Param As SqlParameter = Nothing
     Try
     myParameterFieldDefinitions = myReportDocument.DataDefinition.ParameterFields
'*********************Report Parameters***************************
     For Each myParameterFieldDefinition In myParameterFieldDefinitions
          myParameterFieldDefinition.CurrentValues.Clear()
          Select Case myParameterFieldDefinition.ParameterFieldName.Trim.ToUpper
          Case "@CARRIER"
               If SP.DBParameters.ContainsKey("@CARRIER") Then
                    Param = SP.DBParameters("@CARRIER")
                    ParamValue = NullS(Param.Value).Trim
                    bRC = SetCurrentValueForParameterField(myParameterFieldDefinition, ParamValue)
                    If Not bRC Then Return False
               End If                           
          End Select
     Next
     Return True
     Catch ex As Exception
     GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
     Return False
     End Try
End Function
Private Function SetCurrentValueForParameterField(myParameterFieldDefinition As ParameterFieldDefinition, submittedValue As Object) As Boolean
     Dim currentParameterValues As ParameterValues = Nothing
     Dim myParameterDiscreteValue As ParameterDiscreteValue = Nothing
     Try
     myParameterDiscreteValue = New ParameterDiscreteValue
     myParameterDiscreteValue.Value = NullS(submittedValue).Trim
     currentParameterValues = New ParameterValues
     currentParameterValues.Add(myParameterDiscreteValue)
     myParameterFieldDefinition.ApplyCurrentValues(currentParameterValues)
     Return True
     Catch ex As Exception
     GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
     Return False
     Finally
     myParameterDiscreteValue = Nothing
     currentParameterValues = Nothing
     End Try
End Function
Private Function SetDBSourceForSubReport(mySubReport As ReportDocument) As Boolean
     Dim myTables As Tables = Nothing, myTable As Table = Nothing, DTbl As DataTable, SP As StoredProcedure = Nothing
     Try
     myTables = mySubReport.Database.Tables
     For Each myTable In myTables
          Dim SPName As String = myTable.Location.Substring(0, myTable.Location.IndexOf(";"c))
          SP = New StoredProcedure(ConnectionString, SPName, CommandType.StoredProcedure)
          DTbl = SP.FillTable
          mySubReport.SetDataSource(DTbl)
          SP = Nothing
     Next
     Return True
     Catch ex As Exception
     GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
     Return False
     Finally
     If Not SP Is Nothing Then SP = Nothing
     If Not myTable Is Nothing Then myTable = Nothing
     If Not myTables Is Nothing Then myTables = Nothing
     End Try
End Function
Private Function PopulateAllSubReports(myReportDocument As ReportDocument) As Boolean
     Try
     Dim mySections As Sections = myReportDocument.ReportDefinition.Sections
     For Each mySection As Section In mySections
          Dim myReportObjects As ReportObjects = mySection.ReportObjects
          For Each myReportObject As ReportObject In myReportObjects
               If myReportObject.Kind = ReportObjectKind.SubreportObject Then
                    Dim mySubreportObject As SubreportObject = CType(myReportObject, SubreportObject)
                    Dim subReportDocument As ReportDocument = mySubreportObject.OpenSubreport(mySubreportObject.SubreportName)
                    Dim bRC = SetDBSourceForSubReport(subReportDocument)
                    If Not bRC Then Return False
               End If
          Next
     Next
     Return True
     Catch ex As Exception
     GmcLog.Error("ReportKey = " & Me.ReportKey.ToString & ", " & ex.Message, ex)
     Return False
     End Try
End Function

Similar Messages

  • Modified Stored Procedure Doesn't Refresh In Report

    Hello --
    I modified a stored procedure to add a new table and field. The new field doesn't show up in the field explorer after selecting "Verify Database". If I create a new report with the stored procedure, the new field appears as expected. Any ideas?
    Thanks,
    Bob

    Hi Bob,
    Odd, Try adding a field or removing a field and then verify again.
    You could try logging onto the database first and then open the report and set location to the DB and then verify.
    Thank you
    Don

  • I have an Ipad 2 and here is what I am trying to accomplish.  On my laptop I connect to a remote desktop connection to access a shared program we use for reporting.  How do I set up my Ipad to access this remote server?  Thanks for the help.

    I have an Ipad 2 and here is what I am trying to accomplish.  On my laptop I connect to a remote desktop connection to access a shared program we use for reporting.  How do I set up my Ipad to access this remote server?  Thanks for the help.

    Close ... before going for a specific Cisco app ... lets find out some details:
    Host we need more details:
    What is your server environment (Windows Server, or Mac OS X Server, or Linux)?
    What security is implemented in your environment - as what is restricted (RDP for all or specifc credentials on all machines? Are you part of local admin group to the server you wish to connect)?
    Does your environment Support CISCO IPSec connection? If so use Settings> VPN and IPSec tab to enter VPN details, if not then go with above suggestion. IF your restricted to RSA then either built in VPN settings or 3rd party app for RSA would suffice.
    Finally, there are many RDP applications out there I use "Mocha RDP Light" (free minimal ads when launched not when connecting).

  • I have an old IPOD Touch and just bought a new Nano.  If I download the latest version of Itunes for my Nano, will I lose all of my songs stored in my old version of Itunes and can I still use my Touch with the new version?

    I have an old IPID touch and just bought a anew Nano.  If I downoload the latest version of Itunes for my Nano, will I lose all of my osns stored in my old version of Itunes and can I still use my Touch (with my current songs on it) with the new version of Itunes?  In the past when I downloaded a new version, I lost my songs on my Touch.  Thank you for any help any one might offer.

    i am no shure but go on Itunes store in shortcuts and try to find 'purchasse'
    good luck

  • Where are my designs stored when using Adobe CC and can i access them if i cancel ?

    where are my designs stored when using Adobe CC and can i access them if i cancel ?

    This is answered in the CC FAQ: http://www.adobe.com/products/creativecloud/faq.html

  • Just starting to use InDesign CS2 and can't pull up my previous Pagemaker files; what do I do?

    Just starting to use InDesign CS2 and can't pull up my previous Pagemaker files; says "damaged and cannot be recovered"
    How can I retrieve those?

    I have no idea what "diagnostic recompose" is...
    Step 3 in this linked technote will show you how to do a diagnostic recompose - on a Mac. Instructions for doing it on Windows are out there somewhere, I'll try to find 'em if you can't. The technote tells you to remove graphics from master pages; I'd also unembed graphics (make sure all graphics are linked, not stored in the PageMaker doc) in order to try to get it to open up in ID.
    I'm sure there are more things you can try, if that doesn't work, but my broken-PageMaker-doc skills are pretty rusty.
    Also, you may want to edit your response on the forums webpage, and delete it from your future email-replies, so your email address and phone number aren't preserved for all to see on the forums, forever.
    Edit: Step 3, not step 4

  • I am using Dreamweaver CS4  and can no longer connect to Device Central - Can you help me with this?

    I am using Dreamweaver CS4  and can no longer connect to Device Central - Can you help me with this?

    Device Central was discontinued April 23, 2012.
    http://www.adobe.com/products/devicecentral.html
    And replaced with Adobe Edge Inspect CC (for Cloud subscribers)
    http://html.adobe.com/edge/inspect/
    Nancy O.

  • Bought a used Mac Mini and can't get past security password Seller refuses to answer emails. is there a keyboard command to take it back to factory settings or do I need to buy a Disc set and OS???

    bought a used Mac Mini and can't get past security password Seller refuses to answer emails. is there a keyboard command to take it back to factory settings or do I need to buy a Disc set and OS???

    You can bypass the password and wipe the drive and return to the original facory installation if the seller included the orginal install DVDs with the Mac mini. If not you will need a retail version of Mac OS X.  To boot from the Install DVD restart the mini, immediately slip in the DVD and press and hold the C key.

  • About a year ago we purchased a used macbook pro and can not get music to transfer from iPhones to mac

    about a year ago we purchased a used macbook pro and can not get music to transfer from iPhones to mac

    how can i get All music transferred? even non purchased

  • My mum is always using my iPad and I want to set mode if you like that she can log in as some one different and use apps she likes and I can use a diFferent log in and use different apps and stuff

    My mum is always using my iPad and I want to set mode if you like that she can log in as some one different and use apps she likes and I can use a diFferent log in and use different apps and stuff

    iOS 7 does not support multiple user accounts like you want.
    If all the apps are different, you could set her up with her own page of apps, then just show her how to get to her apps page, or just buy her an iPad for herself.

  • Installing photoshop using creative cloud and it comes up with error code 50

    installing photoshop using creative cloud and it comes up with error code 50, what is this?

    Scannella please see Error Code 50 where this topic has been discussed.

  • I use Windows 7 and can't get itunes to start due to msvcr80.dll missing.

    I use Windows 7 and can't get itunes to start due to msvcr80.dll missing.  I downloaded and installed latest version of itures and can't get it to start.  Any suggestions?

    Hi, I followed others yesterday with the same problem and removed all Apple Inc programs, rebooted and reloaded iTunes appears to of sorted this issue but as others have found OUTLOOK now takes ages to load and open ??

  • Using Windows 8 and can't authorize my computer to upload apps and play music on my new laptop.  What do I need to do to fix problem.

    Using Windows 8 and can't authorize my computer to upload apps and play music on my new laptop.  There is no "authorize computer" in a drop down menu as suggested in iTune store or its support page. What do I need to do to fix problem?

    MY personal thinks to Radez29. Yes, it is now authorized. BUT, I have an obvious question and an obvious statement.
    Question......why, in my many emails to/from Apple support, was this simple solution not given to me?
    Statement.......Apple should consider "terminating" the present employees and hiring Radez29. He obviously knows a LOT more than the Apple support team.
    AGAIN, my sincere thanks to Radez29 for this solution.
    Ron

  • I am using OS X and am trying to set up a HP ENVY 5660 e printer and the drivers are not listed.  I read somewhere not to use the install disk.  What do I do?

    I am using OS X and am trying to set up a HP ENVY 5660 e printer and the drivers are not listed.  I read somewhere not to use the install disk.  What do I do?

    Your suggestion was a good one and what I found was that to use this and any other printer I looked at is that I need to update the operating system to a later version.  I have been reluctant in the past to do this after reading update horror stories and since this computer does what I need and very well.  Was glad I moved over from windows and this is the first problem I have had.  Thanks for your help and any other suggestions you may have.

  • I am using windows 7 and can't get the print drives to load for F2210 printer

    I am using windows 7 and can't get the print drives to load for F2210 printer and I keep receiving different fatal error codes.

    Hello @Imvertical 
    Welcome to the forums!
    I read about how you're attempting to install your Deskjet F2210 on your Windows 7 system and receive Fatal Error codes. I will do my best to help and make some suggestions for you to try. 
    To being, try a standard copy from the unit to see if it will copy. If copies work, continue troubleshooting. If not, let me know what happened when you made a copy.
    Next:
    Perform a Level 3 uninstall.
    There are 2 ways you can run the uninstall:
    From Original installation CD:
    1. Insert CD into drive, and then cancel the installer
    2. Click Start and open 'Computer', and then right click on the CD drive and open
    3. Open folder Util
    4. Open folder CCC
    5. If you have an HP computer run the L3uninstall.exe. If you have a non-HP computer run the L4uninstall.exe
    6. When the uninstall has completed restart the computer
    7. Run Disk cleanup from Accessories\ System Tools
    8. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    9. Download the full feature software and drivers: HP Deskjet F2200/F2224 All-in-One Printer series Full Feature Software and Driver
    10. Run the download to reinstall the printer
    If software was downloaded and extracted to your system:
    1. Click Start and type %temp% in the run field
    2. Look for, and open the folder starting with 7z (Example: 7zS2356) (If there is more than one, choose the most recent folder)
    3. Open folder Util
    4. Open folder CCC
    5. If you have an HP computer run the L3uninstall.exe. If you have a non-HP computer run the L4uninstall.exe
    6. When the uninstall has completed restart the computer
    7. Run Disk cleanup from Accessories\ System Tools
    8. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    9. Download the full feature software and drivers: HP Deskjet F2200/F2224 All-in-One Printer series Full Feature Software and Driver
    10. Run the download to reinstall the printer
    Please let me know if the installation worked after the Level 3 uninstall.
    Good luck and have a nice Wednesday!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

Maybe you are looking for