SSRS - Parameter - SELECT ALL vs ALL - How to remove ALL option - visual-studio

Please look at this ss
I am using SSRS 2008 + pulling data from a cube and made Country my parameter.
I want to keep "Select ALL" option but remove "ALL" option.
How would I go about doing that?
Thank you

You need to replace the ALLMEMBERS function with the CHILDREN function.
http://www.bidn.com/blogs/ChrisAlbrektson/bidn-blog/1452/mdx-ssrs-how-to-remove-the-all-member-from-your-parameter <-- will show you what I mean

Related

How to disable CrossTab sort order?

I have a crossTab in my report that shows:
L S XL Changes Combination Material
Shirt 10 5 something somethiung something
Pants 2 4 something somethiung something
But I need it to be sorted like this:
Material Combination Changes S L XL
Shirt something somethiung something 10 5
Pants something somethiung something 2 4
Now keep in mind that I already sort the values the way I want them to be sorted in my stored procedure the only problem is that CorssTab has its own sorting and so far I haven't found a way to disable it.
I am using Visual Studio 2013 and Crystal Reports 13.0.10 and SQL 2014 (tho i doubt SQL version matters).
I am not allowed to change the version of VS or CR or SQL that I am using.
If needed I can provide you with everything you need in order to 'test' my question if you don't believe that my stored procedure sorts the values in one way but CrossTab ignores it.
Please check this link or this
This option is available in Cross-tab popup, below the column selection there is "Group option".
Create a Select Case formula that adds the desired sort position as a number before each group value:
Material
Combination
...
Use that formula for the CrossTab column
Then, use the CrossTab Group Options dialog, Options tab, to 'Customize Group Name Field' with the option to 'Use a formula as Group Name'.
In that expression, return MID({#ColumnFormula}, 4) to throw away the number prefix.

Crystal Report not filtering SQL records based on selection formula

unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.

Parameter![paramname].label (0) = #error

im using a visual studio expression
=parameter!site.label(0)
the user can select all/ multiple values for this parameter
but the parameter is only showing the first one
say user selected all (birm,londn,leeds)
the field should say birm, londn,leeds but it only says birm
If you want to display multi parameter selections then do this
=Join(Parameters!xxxxxxx.Value,",")

Show All if parameter is null Crystal Reports

Hi everyone I use Crystal Reports with Visual Studio 2010 and have the following issue that I can't seem to solve. I have a parameter called name, and I make it so a user chooses from a drop down list of employee names. It is an optional parameter so the user can select nothing in which case I would like the report to show ALL the employees except for the rows that have field Employee name empty. Now I think I got the second part of it down, because I put a formula in the detail section that seems to hide all the empty employees. The problem is that if I leave the parameter unselected the report ONLY shows rows with field Employee name empty. I created a formula like so:
if not (hasvalue(({?Zaduzioc}))) then True
else if
hasvalue({?Zaduzioc}) then
{Inventar_Model_ReportClass.ImeZaduzioca} in {?Zaduzioc} and
{Inventar_Model_ReportClass.Status} = "Aktivno"
Now this exact same formula works for me if I use it with a different report and parameter but that parameter has no empty values so I'm guessing it equates to something like if there are empty values show only those rows if not show everything.
The problem is I can't figure out how to tell it to show everything.
Any help would be greatly appreciated.
I managed to make it work, the problem was in the edit for the parameter I didn't set optional to true, overlooked it and as soon as I did that it all worked. So to recap for anyone with this problem: Make your parameter set optional to true, and put this in the formula for record selection:
if not (hasvalue(({?Parameter}))) then True
else if
hasvalue({?Parameter}) then
{table.column} in {?Parameter}
That should be that.
If you are selecting from a dropdown, you can add an item, Value = ALL, Description = ALL. Set your default to this value. Then in the Selection Expert, add this to your selection query:
....
AND
(IF {?Parameter} = 'ALL' THEN
{databasefield} = {databasefield}
ELSE
{databasefield} = {?Parameter})

How to put a parameter into an query in SSRS 2008 R2 connected to an Oracle Database 11g

Putting a parameter into the query gets the following error:
"ORA-01036: illegal variable name/number"
The query is:
select * from t_accounts where account_number = #ReportParamter1
Without the where clause, the query runs fine
Any ideas?
thanx!
Abraham
Oracle wants its bound parameters to be denoted with colons, not # signs.
So you want
...where account_number = :ReportParamter1
O. Jones highlighted the root but didn't go into as much detail as I needed to address this same issue/question. I had created the parameter in Visual Studio and as noted it has the '#' in the format of the parameter so when applied to the Dataset I got the error message. Unfortunately in the construct of the parameter in VS (I'm using 12) there isn't anything in the various options that allows designating a : in place of the #. What I discovered was after manually adding the parameter to my query in the Dataset, I then found it listed in the parameters area of the Dataset Properties - the parameter entered in query was set to the parameter made in VS. I removed the original and preview processed without issue.

Resources