Archive for January, 2013

Fixing the “This report requires a default or user-defined” error in SSRS

I was running a Reporting Services report through a WinForms application and I started getting an error when the ReportExecutionService.LoadReport method was called. The error was:

This report requires a default or user-defined value for the report parameter ‘ParkName’.

I looked at my ParkName parameter definition, and here is what I had:

<ReportParameter Name=”ParkName”>
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>Select All</Value>
</Values>
</DefaultValue>
<Prompt>Park Name</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>ParkNameDataSet</DataSetName>
<ValueField>FullParkName</ValueField>
<LabelField>Name</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>

All looked well, but obviously something was not. I looked through similar reports that were not having parameter issues and found that when I pulled the default value from a DataSet, then all was hunky dory. So I modified the parameter definition to pull from a DataSet:

<ReportParameter Name=”ParkName”>
<DataType>String</DataType>
     <DefaultValue>
       <DataSetReference>
       <DataSetName>ParkNameDataSet</DataSetName>
     <ValueField>FullParkName</ValueField>
   </DataSetReference>
</DefaultValue>
<Prompt>Park Name</Prompt>
<ValidValues>
<DataSetReference>
<DataSetName>ParkNameDataSet</DataSetName>
<ValueField>FullParkName</ValueField>
<LabelField>Name</LabelField>
</DataSetReference>
</ValidValues>
</ReportParameter>

This did the trick. I also modified the query populated the ParkNameDataSet to return “Select All” as the default value.

Advertisements

1 Comment

Visual Studio DLL name, why won’t you change?

So I decided that my project name sucked, and I wanted to change it into something different. I went ahead and renamed all the references in my KimKardashian project to EngelbertHumperdink. Everything – class references, project and solution names – you name it, I changed. Yet when I build my project, I continued to see the KimKardashian.dll file in the bin directory.

So I had to think outside the normal “Replace All” paradigm, going for a win-win  and synergize with myself. What I came up was is a healthy disgust of office buzzwords. But what I also came up with that the csproj file was what I needed. I went into my EngelbertHumperdink.csproj file and found two elements, RootNamespace and AssemblyName, and they had my nemesis:

<RootNamespace>KimKardashian</RootNamespace>

<AssemblyName>KimKardashian</AssemblyName>

A quick name-change and rebuild and all was well. Long live Engelbert Humperdink!

Leave a comment