SSRS default values - sql-server

Ordinarily, this is a very simple thing. My issue is I can't seem to get multiple values, so I'm guessing it's a format issue? In my report, here are the default values:
When I preview the report in VS, it shows up exactly as it should, and obviously, I have the multi-select setup correctly:
NOTE: The values of 2 and 3 are the ID's in the query. This is done to utilize the indexing on these values as opposed to just pulling up a big list of strings, so it's finding the ID but actually displaying the "description" in the drop-down.
After the report has been deployed, I discovered that within the options of the report (click report, go to Manage, then navigate to Parameters) this is where there seems to be the hang up. I can select just 2 or just 3 and there's no problem, it will use either of them as the default. I've tried various formats to use 2 AND 3 but have had no luck and get the error The value provided for the report parameter 'Model' is not valid for its type. (rsReportParameterTypeMismatch). I'm not sure why the default values selection in my first screenshot doesn't take care of this, but for whatever reason, the last screenshot appears to override this functionality. Any idea as to how I might get my 2 values?

I figured it out. Pressing enter to go to the next line, no comma or other separator will get this to work.

Related

Reactive search Datasearch Show suggestions with default Query and/or custom query, only getting results on the first character

I have a reactive search Datasearch component that is running a default Query in order to exclude some results based on an Id. If I use the Datasearch without a default query, I am getting the suggestions just fine. But whenever I add the default query I can see the correct suggestions on the first character but after that it stops giving any suggestions.
I have been looking around in the render rawData and data variables. And I can see there are still rawData vars, but the Data input stops after the first hit. In addition, When I add a custom query, it seems that the suggestions do not really take this in account as it still shows suggestions outside of the subset created by the query.
My question is now, How to get the default query and custom query to work together with suggestions?
It seems that all the other components work correctly with my default query as in only showing results in the subset created by the custom query
Would be really helpful if someone could point me in the right direction on this one, Thanks in advance.
Update:
I want to add that when I look in the stateProvided object. Whenever I add the defaultQuery. The stateprovider stop showing the SearchState after one character in the searchbox. It seems like it's completely blocking the normal behaviour

WiX - Dataset Mismatch

I have a website for my Theatre Institute and on the homepage, I have a Slideshow with Two Repeaters on two different slides connected to two different datasets. I use them to display event information/status from my database collection.
Slide1: recentRepeater <-- recentDataset <-- myCollection (For Recent Events)
Slide2: upcomingRepeater <-- upcomingDataset <-- myCollection (For Upcoming Events)
The Problem
While loading, the dataset2 data is shown in repeater1 i.e. RECENT EVENTS gets displayed in the UPCOMING EVENTS section and it gets corrected after fully loading. Being the first thing to be shown on the site, I do not want it to get messed up. This is a negative impact on my website
How It Works
I have stored dates of the Event in the database as a number in YYYYMMDD format. For example:
20-April-2019 ---> 20190420
I have properly connected the datasets to the repeater elements, set the dataset result limit to 2
I sorted the results to be produced based on the YYYYMMDD number
Ascending for upcomingDataset
Descending for recentDataset
I generate the YYYYMMDD format number for that day and filtered the results produced by the dataset by the .setFilter() function
$w("#recentDataset").setFilter(wixData.filter()
.lt("dateNumber", YYYYMMDD_today)
)
$w("#upcomingDataset").setFilter(wixData.filter()
.ge("dateNumber", YYYYMMDD_today)
)
How can I prevent this from happening..?
Thanks in Advance
It's hard to say what's going on without actually playing with your site. I think both of your datasets are connected to the same collection. I would guess the problem is that the dataset is only being filtered after the page is loaded. You can verify this by turning the console to verbose mode in preview.
If that is indeed the problem, I can think of three possible fixes/workarounds:
Set the filter's in the dataset settings instead of setting them programmatically. (This is the easiest option.)
Hide the repeaters until the filters are set. (This is a bit of a hack.)
Store the promises returned by the setFilter functions and return them using Promise.all() from the onReady(). (This is the fanciest option. I think it will work, but if you don't need to set the filters programmatically, you might as well do option 1 instead.)

How to change SSRS default multi-value parameter

I have a multi-value parameter for States that is populated by a string passed from SQL. The default in SSRS is for the State parameter to look like this:
AL, AR, AZ, CA...
Is there a way to change this so that the default shows just one value, such as "All" instead of listing the entire string? I was able to do this years ago when our SSRS system was built on a .NET framework, but I don't see how to do this straight out of SSRS.
Thanks.
I did this before but you kind of have to play tricks. I cant remember the exact syntax but hopefully this can get you started.
First I had to add an option of all to the datasource query
Select State From StateList
Union
Select "All"
Then there was something that I did to make sure that the all check box was mutually exclusive to checking individual entries. Also it would only work if the All option was checked not if all states were individually checked.
Then in the report query change
Where State In (#StateParam)
To
Where (#StateParam = 'ALL') Or State In (#StateParam)
I hope this helps. If someone knows an easier or more straightforward way I would love to know how.

Report Builder 2.0 Create a dataset with Parameters

I cannot get my dataset to recognise a parameter supplied to it.
I have created a report parameter "ProjectID".
(In Report Parameter Properties, Name="ProjectID", Prompt="ProjectID").
In Dataset Properties|Parameters, Parameter Name="ID", Parameter Value="[#ProjectID]".
When I click on the Filter button in Query Designer, the "Projects with" panel says:
"? ID equals (unspecified)".
But when I run the query I'm not prompted to enter a parameter value, and multiple rows are returned.
I should stress that I'm simply trying to replicate the functionality of a pre-existing report where all this works exactly as expected.
When I diff the rdl files of the two reports there are obvious differences, and I can hack the xml (of the semantic query) so that it works, but I don't really have the understanding of why it's working, or how to replicate the necessary changes via the GUI.
Can someone please give me some pointers - preferably without referring me to the documentation as I've been through this numerous times as well!!
Thanks in advance,
Peter.
p.s. I can post some of the rdl differences if that will help, but wanted to keep my initial post clear and to the point.
OK, so what you need to do is when in the Filter screen of the Query designer, assuming you've already specified a filter in the main pane, such as:
"ID equals (unspecified)"
You need to click on "ID" and a context menu appears with "Edit as Formula", "Prompt" and "Remove Condition".
Select "Prompt", and there you go.

SQL server reporting services: how to stop a report firing when opened

We have some SQL server reporting services reports. I didn't write then but I have to take care of them.
These reports fire when opened in the browser, and with the default parameters (search terms and restrictions are blank) they retrieve a lot of data, which is slow. The client would prefer that the report is not generated until the user enters parameters and presses "view report"
Unfortunately I don't know SSRS at all well - how do I stop the report from firing when it is opened?
The details of how to do it on a deployed report (as per Rihan Meij's answer) is as follows:
Click on a report, click on "properties" at the top. You may have to wait a bit, because the slow report may be running now. Then click on "parameters" on the left.
For each parameter, make sure that "Prompt User" is checked, and for at least one parameter, "Has Default" is not checked. Click on "View" again at the top left (or go back to the folder and click on the report name) to view the report, and note that the report does not fire right away.
In the report builder, you can do this via the "Filter" menu. De-select values from at least one filter, and save the report.
Is it also possible to stop reports from firing on loading when the report has no parameters?
I found that I had to set at least one of the report parameters to not have a default to keep the report from autorunning.
I had to use this configuration (notice that all 3 of the parameters I left without defaults accept Nulls so the users can just click the Null checkboxes):
[screenshots missing]
to get the users to see this and to keep the report from autorunning:
[screenshots missing]
I set the default value of one of my parameter selections to a value of -1 which does not exist (not a valid parameter value). This did not generate an error. It simply set the parameter drop down box to and prevented the report from running. I couldn't use a default value of NULL because NULL selects everything, and I wanted the user to purposefully make the selection of ALL (NULL) before the report runs. It takes several minutes for the report to render if ALL is selected.
I know this post is a bit old, but since I have another solution here to, I just posting it in case someone need it.
If you are using ReportViewer its posible to set the property ShowBody="False". Then on the OnSubmittingParameterValues event, change the ShowBody property to true. Then you do not need any extra parameters or parameters without default value in the report.
<rsweb:ReportViewer
ID="rv"
runat="server"
Width="100%"
Height="100%"
SizeToReportContent="false"
ZoomMode="PageWidth"
KeepSessionAlive="true"
ProcessingMode="Remote"
PromptAreaCollapsed="false"
InteractivityPostBackMode="AlwaysAsynchronous"
AsyncRendering="true"
ExportContentDisposition="AlwaysInline"
ShowReportBody="False"
ShowPrintButton="false"
OnSubmittingParameterValues="rv_SubmittingParameterValues"/>
And then in the rv_SubmittingParameterValues method:
this.rv.ShowReportBody = true;
I have done that by changing my query slighlty to require parameters when it is run.
I have then after I have published the report on the report site, specified that the parameter, should prompt the user. This does have the effect that the report does not pull the sql server to its knees when users just open the report to see.
I found a nice trick for this when working with reports that have optional fields, but pull a huge amount of data if the optional fields are blank.
Step 1: Prevent Auto Firing
Make sure "Allow null value" is not enabled for the optional parameters
Make sure there is no default value for the optional parameters
Step 2: Make parameters optional without using 'null'
Enable "Allow blank value" for the optional parameters
Modify your where clause for the optional parameters to
WHERE (#param="" OR column = #param)
With this method there is are extra fields for the end users to worry about, the report will not fire until it is requested, and the conditions in the where clause will not be evaluated if the text box is left empty.
note: if the report specifies Available Values then any value that is not valid for your table structure may be used instead of "", you can also use with other data types (non-string) this way
I found the best way was to add in a parameter that does not allow nulls, but is not used by the report. This stops it from rendering at the start, but does not affect the report.
The only down side is if you are displaying the report in a report viewer you have a box at the top which looks a bit strange. I'm sure you could use some C#/CSS to hide it though.
As I'm not using a report viewer to display, only to render at the back end this doesn't affect me.
Even if you are using a report viewer it's helpful when developing!
I did this by just supplying a default value to the key parameter that doesn't return any results.
I added this in my query:
where 'Start' = #Start
and made a parameter with only available value 'Start'. The report is waiting for input.

Resources