Solved

The 'StoreType' parameter is missing a value

Posted on 2014-10-29
4
154 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 33

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trying to get PDF to open as "Open,Save,Cancel" instead of as a pop-up. 6 31
Error in page 3 45
Split in Javascript 5 30
Advice on Xojo as a development tool over VB. 4 35
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

912 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now