Solved

The 'StoreType' parameter is missing a value

Posted on 2014-10-29
4
156 Views
Last Modified: 2014-11-04
I have a ssrs that run fine when I run it from the report project.  When I run it from the application, I am getting the error The 'StoreType' parameter is missing a value.   The StoreType parameter is not required and I set a default in the  code behind.  What am I missing?

code behind to run the report and push the parameters to the report viewer
 Protected Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdGetReport.Click
        Dim colRP As New System.Collections.Generic.List(Of Microsoft.Reporting.WebForms.ReportParameter)
        colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("Userid", Membership.GetUser(My.User.Name).ProviderUserKey.ToString()))
        If IsDate(txbgn.Text.Trim) Then
            Dim dteStart As Date = txbgn.Text.Trim
            colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("Begin", Right("0" & dteStart.Month, 2) & "/" & _
           Right("0" & dteStart.Day, 2) & "/" & dteStart.Year))
        End If
        If IsDate(txend.Text.Trim) Then
            Dim dteEnd As Date = txend.Text.Trim
            colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("End", Right("0" & dteEnd.Month, 2) & "/" & _
            Right("0" & dteEnd.Day, 2) & "/" & dteEnd.Year))
        End If
        If lbStoreType.Items.Count > 0 Then
            Dim stStoreType As New List(Of String)()
            For Each item As ListItem In lbStoreType.Items
                If item.Selected Then
                    stStoreType.Add(item.Value)
                End If
            Next
            colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("StoreType", stStoreType.ToArray()))
        Else
            Dim stStoreType As String = "-1"
            colRP.Add(New Microsoft.Reporting.WebForms.ReportParameter("StoreType", stStoreType))
        End If
        rv1.ServerReport.ReportServerUrl = New Uri("http://localhost:80/reportserver")
        rv1.ServerReport.ReportPath = "/POSReports/DepositReport"
        rv1.ServerReport.SetParameters(colRP)
        rv1.ServerReport.Refresh()
        rv1.Visible = True
    End Sub

Open in new window

0
Comment
Question by:rcowen00
  • 3
4 Comments
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 40412753
i had a similar problem with my application. I fixed it by (in SSMS):

IF OBJECTPROPERTY(object_id('dbo.spAddCustomerWithOneOrder'), N'IsProcedure') = 1
DROP PROCEDURE [dbo].spAddCustomerWithOneOrder

GO

CREATE PROCEDURE [dbo].[spAddCustomerWithOneOrder]
     @FirstName varchar(30)
    , @LastName varchar(30)
.
.

I originally had an output parameter. I removed it and ran Alter Procedure but for some reason it was not working for me. I hope this is also applicable in your case. Let me know.

Mike
0
 

Author Comment

by:rcowen00
ID: 40414282
I don't think the problem is with the stored procedure though.   The naming and case is correct, I think that the problem is my code behind not pushing the parameter correctly.  Or am I misunderstanding?  Thank you.
0
 

Accepted Solution

by:
rcowen00 earned 0 total points
ID: 40414457
I found the problem.  The parameter allowed for multiple selections and I had it flagged for allowing blanks.  It looks like the allowing blanks didn't work, because the report viewer was still requiring it.  I changed the options to allow "All" and assigned a value.  Then the problem was resolved.  Thank you for your assistance.
0
 

Author Closing Comment

by:rcowen00
ID: 40421192
The expert did try to help, but the issue was not the same and I resolved on my own.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question