Solved

The 'StoreType' parameter is missing a value

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

12 Experts available now in Live!

Get 1:1 Help Now