visibility expression in report builder with multiple hidden values - sql

I have an image that i would like to hide based on a value. This value can have 3 possible returns. "AP02", "AP16", "" (blank). I want the image visible only if the value is "AP16"
Currently i am using this code:
=First(Fields!LastMPClientName.Value, "ClientSummary")="AP02"
The above works if the value is "AP02" however i am seeing more and more blank values for my clients.
How can i make this image hidden for both "AP02" and "" values?
I am using report builder 3.0 from a SQL 2008R2 instance.

Cant you use an OR?
=First(Fields!LastMPClientName.Value, "ClientSummary")="AP02" OR First(Fields!LastMPClientName.Value, "ClientSummary")=""

Related

How to mimic values in multi page SSRS Report

I need a lab report that has several pages. Each test has a unique reference number and I would like it to appear in the header according to what I have on the page. At the moment I only see one reference number and it remains unchanged after switching to another page. See attached image.
If possible, I would like to get rid of the SampleNo column so that its value is only in the header
The easiest way to do this is to reference the the textbox in your tablix that contains the "Sample No.".
Click the textbox that you have highlighted in the tablix, show the properties window (F4 in Visual Studio - can't remember in Report Builder, I think View/Properties).
Find the Name property of the textbox, this is often the name of the field it contains but not always.
In the example below the textbox name is 'oYear`
Next, set the expression in your header to be something like
=FIRST(ReportItems!oYear.Value)
Change oYear to whatever textbox name in your tablix is.
ReportItems refers to the rendered object name so here we just get the first on each page.
Here the first two pages from a small sample of data which groups by year.

Passing Query Expression through Naviagtion Form

I have been practicing the use of building expressions through query design. I have created a custom search query using textfield's and a listbox from a form. Now if I run the query through the form it works. But when I run the query through the form after its been placed within navigation form it does not work. I receive the pop up window to input parameter values manually. I am trying to adjust the expression but cant seem to get the syntax correct.
Below is amended expression but still does not work
[Forms]![Navigation Form Main]![Reports Form]![customerListBox]
For clarification the report form is a tab within my navigation form and yes the expression is being called only when the reports form tab is selected.
Instead of [Reports Form], try [NavigationSubform] which is default name of container holding [Reports Form].

Report ,subreport pentaho

Iam using Pentaho report designer and we want to hide a subreport if there is no data .
I have tried to use this formula :
not(isemptydata())
in the visible expression but it does not seem to work .
So how to hide a subreport if no data .
Pentaho Report Designer elements have "attributes" and "style" sections. In style section there is a field "Visible". If you don't want to make the sub-report visible, it must be set to "false".
When want a function to disable it, the expression must return a "FALSE()" value.
You don't specify how the sub-report is generated and where is it placed (Details, Report Footer, etc), but, I'm gonna assume you have defined a function that has the count of rows for a group "TOTAL_ROWS" (and this is gonna be the field you are gonna compare), so, to hide the sub-report when 0 rows are present:
=IF([TOTAL_ROWS] = 0; FALSE(); TRUE())
"if the total number of rows is zero, return false, else return true".

How to get dynamic created table's total column and row using Request.Form in vb.net

I am doing my project in Vb.net using MVC 4.0
I have created dynamic table and in that textboxes in td using javascript and now i want to get that table's total row and column as well for further process in Controller function.
How I can get using above using VB.net?
I have used Request.Form but the id of the textboxes in table is created uniquely so first I want to find the total column and row so based on that I can move further and check using for loop.
It seems like if you are generating your table through javascript you should also be able to set the value of a hidden field to the value you are outputting to your totals column. If you created a hidden field with the value set you should be able to access it from the Request collection. If it is not actually in a field that gets posted back you will only be able to access the value from the client-side.
document.getElementById("myInput").value = "Value you are outputting to your "total" cell
[Solved]
I got all the controls on code behind by it's name by using FormCollection just i need to do is post back the form using form action method because with using ajax i am not getting the formcollection in code behind but directly using form action method i can get all the controls name.
These are the textbox ids by which i can get the value just need to do further process like:
For Each _formvalues As String In formcol
formcol(_formvalues)
Next
fomcol is an object of FormCollection,_formvalues is used for moving one by one name coming in formcol and to take the data inside means name just write formcol(_formvalues) that's it.

BIRT result set values in specific cells

My query returns location_cd(string) and item_count(int). I only need certain rows from the result however and I need them to display in specific places in my layout so I don't think the table solution is going to work. Can I determine where I place the value for a particular row of the result set?
I am using a grid to display values for a number of fields. I cannot seem to be able to get the values from the results to show. The grid is bound to the result set. I even tried binding the cells to the result set but that didn't work either.
I checked in the query editor and there is a result set shown in the Preview so I know the query works. The complete and correct result set shows if I put a table on the page.
I tried inserting a Dynamic Text or Data object in a cell and used the expression:
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:""
This returns a blank and does not seem to evaluate. I tested it with :
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:"BLANK"
and got 'BLANK' to appear in that cell.
dataSetRow["location_cd"] and dataSetRow["item_count"] will display the location_cd and item_count from the first row of the result set. row.outer[] did the same thing. Obviously I am just hacking at this report at this point.
A co-worker suggested that she uses a JAVA if-statement in places like this but I could not get that to work either.
Any ideas or suggestions that will get me on the right road??
Thanks
An elegant option would be to use a HashMap storing the result of the dataset.
Declare a report variable named "values", with a new hashmap as default value (see image below)
Fill values in the onFetch script of the dataset: vars["values"].put(row["location_cd"],row["item_count"]);
Insert new data elements at any place of the report with expressions such: vars["values"].get("myFavoriteLocationCD");
Though it is important to note the dataset should be triggered by the report before these data elements.
The particular row you want to display you specify in a "Text" field inside your grid. Just drag and drop a "Text" field inside your grid. If you bound the fields you want to display to your grid, the "Text" field inside the grid inherits the bindings of its parent (the grid), so you can access the bindings automatically in the "Text" field.
You could try following steps, maybe that works.
Don't use "Dynamic Text" field, instead use a regular "Text" field
Ensure the fields of your query which you use, are bound to the grid (you sayed you already did)
Open the "Text" field
Change preselected pull-down entry "Auto" into "HTML"
Change preselected pull-down entry "Formatting" into "Dynamic Text"
Wrap your code in <value-of format="HTML"> your code goes here... </value-of>
Note: You should check in the "Expression Builder" of your "Text" field if you are able to access the fields you bound to the grid. If they are not available sth. went wrong with your binding. Avoid binding query records to cells this will drive you crazy.
If you want to display a list, ensure you didn't set a constant height in the row of your grid. Set the height to 100% than the row takes its height dynamically.
What about the idea to optimize your query, that only get the results you want are displayed, than you don’t need to filter them with java script? If you don’t need the filtered results in another place this would be the cleaner solution in my opinion.