SSRS Report Dataset Parameter format discovery when querying Tfs 2010 SSAS Cube - reporting-services

I'm very new to SSRS and Report Builder, and I'm trying to throw together a simple report that shows data for a single changeset. I've created a different report already that takes date paramaters, and thanks to some lucky googling, I learned that instead of feeding date strings to the report parameters, it was necessary to use expressions such as:
="[DATE].[Date].&[" & Format(CDate(Parameters!FromDateDate.Value),"yyyy-MM-dd") + "T00:00:00]"
Finding this post was like winning the lottery because I would have never been able to figure that out for myself. Hence, for my changeset report, I figured I could use the following expression for my changeset parameter.
="[Version Control Changeset].[Changeset ID].&[" & Parameters!VersionControlChangesetChangesetID.Value + "]"
For my report, the VersionControlChangesetChangesetID parameter is just an integer. I got the dimension names by using the "Copy" context menu item in the query designer, assuming that these would be the correct identifiers.
However, I get the following error when running the reoprt:
The Value expression for the query parameter ‘VersionControlChangesetChangesetID’ contains an error: Input string was not in a correct format. (rsRuntimeErrorInExpression)
I have two questions about this.
Why isn't the expression I wrote working?
How can I learn better how to format these values, and how they're formatted inside the cube, so that I'm not just guessing when I run into these formatting errors?
Thanks!

Related

Display Parameter in SSRS Report

When a user runs the report, they can select a multi-value parameter. I know I can use Parameters!Value.Label(0), Parameters!Value.Label(1), etc to display the each of the values based on their location within the array, but the number of the values changes based on how many values the user selects.
The report separates each value onto a separate page. I'm looking to (a) have an expression that identifies which value's info is displayed on the page, and (b) an expression that labels the tab as the value when the report is exported to Excel. I expect the same expression would work for both.
I believe I should be using Array.IndexOf(Split(Parameters!Value.Label.ToString(), ","), Parameters!Client.Label), but just get #Error as the output when the report renders. I'm not sure, but it seems like the Array... expression would only identify the location within the array.
Could someone offer some insight into where the syntax is wrong? I'm not sure if the issue is syntax or it's an issue of how to specify which dataset to use in the expression.
Thanks.
This is what you should use
=Join(Parameters!CSR.Label, ", ")

Adding Fields into an expression in an SSRS 2008 report

Thank you in advance for taking your time to answer my question.
I am having trouble with expressions in the SSRS reporting system.
The Field I am adding required fields from the dataset I provided in the report, however when I try to preview the report I get the Following message:
"A Value expression used for the report parameter ‘Policies_Total’
refers to a field. Fields cannot be used in report parameter
expressions."
This is my expression:
=IIF(Sum(Fields!policy_id.Value, "DataSet1") Is Null, 0, Count(Sum(Fields!policy_id.Value, "DataSet1")))
That was suppoed to be converted from Crystal reports which has the following expression:
If IsNull ({usp_rep_agent_cases;1.policy_id}) then
0
Else
Count ({usp_rep_agent_cases;1.policy_id})
Any help is much appreciated.
Thank you
I think it may be as simple as understand that a 'parameter' should be passed into SSRS before fields are created for the most part. If this parameter is DEPENDENT on the value of something else first being chosen you cannot list it first as the field is not yet populated to my knowledge. It appears you are trying to use an expression to count something from a field from a dataset when you just make a dataset and reference that field directly. So instead of trying an expression you may choose a few other options instead:
Choose on the left pane of your parameter 'Available Values' selected 'Get values from a query'. You may use your query which is a 'dataset', value is self explanatory, label is what the end user will see display.
The option 'Allow null' value will accept a null value
You may run into situations where multiple datasets may need to be used, multiple selects or querying objects. In my experience with SSRS it gets mad at times when you try to reference a dataset used to display data with a dataset used to determine an event or action. SSRS also gets relativity slower the more Expressions you do so doing a whole report with nothing but expressions versus taking the power of the built ins of the RDL language is not really worth it IMHO.
For SSRS expressions you need to use IsNothing for NULL checking, something like:
=IIF(
IsNothing(Sum(Fields!policy_id.Value, "DataSet1"))
, 0
, Count(Sum(Fields!policy_id.Value, "DataSet1"))
)
In fact the whole expression seems a bit odd; what are you specifically trying to achieve with your expression? Are you just trying to count non-null values?
=Sum(IIf(IsNothing(Fields!policy_id.Value), 1, 0), "DataSet1")
Also, your error seems to be saying that a parameter is referencing a field when this isn't allowed, which may not be solved by changing syntax; I think more information about what you're trying to achieve is required here.

Reporting Services problem. Forward dependencies are not valid

I have a problem with a Reporting Services report. My report has two datasets, one that fetches the actual report data and one that fetches translated resource strings for displaying wherever literal text is used on the report. This dataset requires three parameters, a language set id, a language code and a string to match against resource names.
Following an example I found here (the reply by Miguel Catalão) I have created a multivalue parameter #Resources that will be populated from the resource dataset and a code function that looks up specific values from the multivalue query. This function will then be called from expressions wherever literal strings are used.
I think that this should work but I have run into a problem that I can't quite figure out a workaround for. There is a dependency problem in the #Resources parameter being dependent on the Resources dataset which in turn is dependent on three parameters; #LanguageSetID, #LanguageCode and #ResourceNameLookup. I have read that the order of declaring parameters is important so I have made sure that the last three parameters appear above the #Resources one and that all three of them have default values that will result in data being retrieved by the dataset.
Yet I am still getting the following errors when previewing the report; any advice or guidance would be most appreciated.
The report parameter ‘Resources’ has a DefaultValue or a ValidValue that depends on the report parameter “LanguageCode”. Forward dependencies are not valid.
The report parameter ‘Resources’ has a DefaultValue or a ValidValue that depends on the report parameter “ResourceNameLookup”. Forward dependencies are not valid.
I had the same error but it was due to something else. What I had done was created a Parameter in my report, then linked the Default Values to a Dataset.
This in turn added the parameters needed in the Dataset. Somehow, the order of the parameters in my list were changed. This is when I stared getting the 'Forward Dependencies are not Valid' error.
I then looked at another report that used the same process to link a Parameter to a Dataset. I noticed that the order of my Parameters were different. I simply went back to my new report, and used the up and down arrows until my Parameters were in the same order as the working report. This seemed to fix the error and work fine. Apparently the the Parameter that was using the Dataset needs to be below the Parameters that are used in the SPROC.
I this helps someone in the long run.
C/N: Parameter was being filled by a Dataset(Stored Procedure). The Parameter that was being filled was above some of the Parameters that it was expecting for the SPROC.
This was all caused by a stupid error I made. I copied and modified the code function from the post I mention but neglected to change the data type of the argument from integer to string, which mine is.
It seems rather odd that the error manifested in the way it did but I have gotten past that problem now, only to run into another that I ask about in another question.

Reporting Services - translating labels into different languages

I'm finishing up my reports in my SQL Server 2008 Reporting Services project, and as one of the last steps, I need to make things translateable.
Since I have a bunch of reports, and they all share some identical labels, I decided to put all those labels I need to show into a SQL Server table, and I am surfacing that contents as a DataSet dsReportLabels in my reports.
This DataSet basically contains two fields: LabelName is the name of the label (e.g. "Count of items"), and Caption contains the text in the chosen language to be shown on the report.
But now here comes my mental block: how do I assign the dsReportLabels.Caption value to a e.g. textbox, based on the dsReportLabels.LabelName ?
So I need something like (pseudo-LINQ statement):
Textbox1.Value = from dsReportLabels
where LabelName = "some value"
select Caption;
but how do I express that in a Reporting Services code snippet?
I know how to reference things like Parameters!MyParameterName.Value and so on - but that doesn't really work here when I'm trying to extract a value from one column of the DataSet, given the value of the other column in that DataSet.
I bet this is totally easy to do in the end.... just can't seem to wrap my head around this right now.... anyone out there know how to do this?
This MSDN blog post describes one way of doing it. Essentially:
Create a lookup table with the LabelID, Language, and Caption.
Create a Stored Proc that gets all of the labelIDs and captions for a specified language.
Store the results of the SP in a dataset.
Store the dataset in a multi-value parameter.
Use the multi-value parameter in a custom lookup function.
So, the expression in your label textbox would call the custom function with the labelID, which would get the appropriate caption for the appropriate language.
Report Server 2008 also has a built-in Lookup function that may allow you to skip steps 4 and 5. If this is the case, your expression would call the built-in lookup function, which would go directly to the dataset. I don't have RS 2008, so I can't test this.

Parameter missing a value

I am new to reporting services and have a reporting services 2005 report that I am working on to use as a base report template for our organization. I am trying to place the date that the report was last modified on the report server into the page header of the report. However, I keep getting a 'ParamX' parameter is missing a value error when I try to This is what I have done:
Set up a Parameter ReportName with a default value of Globals!ReportName. It is also hidden and internal.
Set up a Dataset ReportHeader that calls a stored procedure that returns the date the report was last updated or another date, if the report is not on the report server. It has a parameter #ReportName assigned to the Parameter!ReportName.Value. The Dataset returns values when run on the dataset tab in the BI tool.
Set up a Parameter ReportVersion that has a default value Query From based on the dataset ReportHeader and picking the ModDate column. It is the last parameter in the report parameters list.
I assign a textbox to the parameter.
When I preview, I get "The 'ReportVersion' parameter is missing a value whether I place it in the report body or page header (which is where I want it). I have deleted and added the parameter again, toyed with the hidden and internal settings on it.
What does this error really mean, what I am missing, and can I even do this with parameters?
Thanks In Advance
Jim
If I understand what you're doing, it sounds like you want to be using a field where you're implementing a parameter...
You are returning the ModDate from the data source, correct? If you're doing this, you can simply throw a text box in there, and use something like this: =Fields!modDate.Value to display it.
Parameters are values that go in to the query, fields are what it returns.
Hope this helps...
EDIT:: OK so are you trying to retrieve the mod-date column value from the reportserver db? If that's what we're talking about, you'll need to add a few things to the report. Add a datasource to report db, a dataset containing the date (query below), a list object in the report linked to the dataset, and a textbox in said list object to display the field. If you hit the report server with a query like this:
SELECT MAX(ModifiedDate) AS ModDate FROM catalog WHERE name='myReportName'
That will return your modifieddate from the ReportSErvices Database as a field that you can use.