Problem with default values for Reporting Services parameters - sql

I have a SQL 2005 Reporting Services report that has several report parameters. One of them is called IsActive and is of type Boolean. The parameter is hidden and set to allow null values. For its default values settings, I have it set to null. In my application that has the reportviewer control, I have logic that decided whether or not to set this parameter to a value (true or false). There are conditions that require it to be not set at all. For some reason, if I do not pass a value, the parameter defaults to TRUE. It operates fine when a value is passed. Is my problem stemming from the simple reason that it is a Boolean parameter? Would changing it to a string be better?
Thanks!

Changing it to a string is only necessary if there's no way to get it to take the NULL value because of a bug or "feature".

Don't know if this is related...
I had a problem where I could not get the default value to be selected when viewing the report from outside of the BIDS after making changes to the report.
It turned out that the parameter settings was not updated when deploying the report.
Changing the settings manually via the Report Manager or removing and re-deploying the report solved the problem.

IIf(IsNothing(Fields!BooleanField.Value) , "-- Any --" , IIf(Fields!BooleanField.Value = True , "Yes" , "No"))

Related

SSRS 2016: Can't set a default parameter value

I’m having a problem selecting a default parameter based on previous cascading parameters.
My report has the following parameters, all required:
• Start Date (Defaults to yesterday)
• End Date (Defaults to yesterday)
• District (Where they worked)
• Field Reps (Who worked)
When the user selects one or more Districts, a stored procedure fills the FieldReps parameter selector with a list of workers who worked in that district during that date range. That list can change from day to day, which makes it hard to set up a subscription to this report.
My solution was to add a field rep with a code of 'ANY' to the FieldReps data set and set it as the default. That way, the report will only include any workers who worked during the date range. This option makes it possible to subscribe to this report. If the user selects 'ANY', the report will return a valid list of workers for the default date range, which is 'yesterday.'
But: I want 'ANY' to be selected by default. But it doesn’t work!
My source dataset provides available values for the FieldReps parameter. (Value is FieldRepCode, Label is FieldRep) An ‘ANY’ entry is added to the top of the list by the stored procedure.
If I specify 'AL06' as the default value (that field rep is in the list), it is selected by default. But if I specify 'ANY', no default is selected.
I’ve checked to ensure 'ANY' has no leading/trailing spaces. I even suspected case sensitivity, so I ensured the case matched. I used an expression (="ANY") to set the default value. None if it made a difference.
Any ideas why this isn’t working?
Thanks!

Filter lookup inside a Dialog- CRM 2015 Online

How can we filter a lookup that is in a page of the dialog process.
E.g. I have a lookup to "incident" on Prompt and Response, I would like to filter it based on the value of a field in incident entity.
I tried:
Creating new views, also setting it as default.
addPreSearch and addCustomFilter on the field on the form(Not sure how to use these scripts inside the Dialog)
Any Ideas ?
Thanks you
Unfortunately this is not possible.
As an alternative you could consider adding a query to the dialog and a page with a prompt having an Option Set (picklist) response type.

In InstallShield, how to change the value of my Property before it is used by SQL Text Replacement?

What I want to do
In InstallShield I want to set the value of a Property before it is used by the SQL Text Replacement feature. I want the new Property value to come from an Edit control that I've added to a dialog.
What I've done so far
I have added SQL Scripts to my InstallShield project, which include placeholders for InstallShield's Text Replacement feature. I've used the Text Replacement tab to find and replace a placeholder in the SQL script with the value of a Property that I've added to the Property Manager. This works correctly, but only for the Property's default value.
Where I'm stuck
The problem is that I want the new value to come from an Edit control in my custom Dialog, but I can't find a way to do this. Text Replacement always uses the Property's default value.
What I've tried is the following InstallScript, which runs when the user clicks Next on my custom Dialog:
CtrlGetText("MyDialog", EDIT_VALUE_FROM_USER, svValueFromUser);
MsiSetProperty ( hwndDlg, "EDIT_VALUE_FROM_USER", svValueFromUser);
Where EDIT_VALUE_FROM_USER is my Property. This runs without error, but the value doesn't come through to the final SQL script.
Why isn't the new value for EDIT_VALUE_FROM_USER being used by SQL Text Replacement? How can I diagnose why it's not working? Should I be doing this in a completely different way?
This turned out to be because I wasn't using the system property ISMSI_HANDLE.
So the correct code to write a Property from an Edit control in a custom dialog is:
CtrlGetText("MyDialog", EDIT_VALUE_FROM_USER, svValueFromUser);
MsiSetProperty (ISMSI_HANDLE, "EDIT_VALUE_FROM_USER", svValueFromUser);
I'm guessing your property isn't listed in the SecureCustomPublicProperties property and is getting set back to it's default value when the installer transitions to the install execute sequence. A log file of the installation would give more data to work with.

how to get the modified value of property after the feature is installed?

I have used a dialog in OnFirstUIBefore() for users to input some information,
and stored them in property USERINF.
However, when I want to retrieve the value of USERINF inputted by user in feature_installed(),
what I get is a default value.
I have added the USERINF to SecureCustomProperties property, but still cannot get the modified value.
How can I fix the problem?
I've always written values like these to the registry, then used appsearch to get them out into the property again.
There is no built in way to persist values like these built into MSI.

Set Reporting services parameter value in subscription as current date

In reporting services SQL server , when I created a subscription for a report with parameter as date time type, I don’t know how to set up value of the parameter as current date (wherever the subscription is running).
I tired Today(), Today, today, #ExecutionTime. But none of them worked for me. Only a specific date worked eg: “11/11/2010 00:00:00”.
I also tried to hide the parameter but the subscript still required to fill the parameter. For the "default value” textbox did not allow the value “Today()”, “Today”, etc.
Thanks in advance!
Helen
You need = to make it an expressions
= Today()
You can't put "=today()" in the text box prompt at runtime. You have to setup the parameter's default value as "=today()" in visual studio.
Try Data Driven subscription and pass a SQL Statement to return the current date for the parameter value.
The following code worked on my case:
parameter1.Value = Date.Today()
Actually I did that in visual studio and it worked well in preview (display the current date by default for the parameter and allow people to select other date) .
But for some reason, the subscription setting still asked me for the parameter value (as in the early post "Report Parameter Values").
On the report parameter configuration (on development time, not on the subscription creation), add a default value for the parameter. If you do, you will have a check box called "use default value" when creating the subscription
I tried it as well but it did not work for the subscription.
Sorry I can not attach the screen shot in the post currently.
In Subscription screen shows:
Report Parameter Values
Specify the report parameter values to use with this subscription.
Date To = Today()
Regards,
Helen
If you want to default the report parameter to the current date in the short format, you can set the default value of the parameter to the expression:
=CDate(FormatDateTime(Now, DateFormat.ShortDate))