Solved

The 'StoreType' parameter is missing a value

Posted on 2014-10-29
4
160 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

717 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