Looking up Data from a table in SSRS - reporting-services

I need help please. I'm sure it is simple to do, I just can't get it right! I need to pull data from a table based on a field in my current table and a field in a different table.
I have a table that stores different codes like this:
category grp code description
ACT TAKEN 1 10 Control
ACT TAKEN 2 20 Locate
ALM METHOD 2 20 Phone
Image:
The code is what is stored in my data. I need to pull the description based off of the code and the category. For instance, for the Actions taken code of 10, I would look at the table in the category and find 'ACT TAKEN' and the pull the description for the code 10 with that category.
I will also need to pull the grp field in some cases based off of the code and category.
Help!!

Related

SSRS Count Fields in DataSet for Map Report

So I have these 2 lists in SharePoint i.e. Producer & Movies.
Now I need to create a single dataset with information about a producer (Name & Nationality) and a count of his/her movies. So an example record from the dataset should look like this for example: Steven Spielberg | USA | 20
I have been looking for way to do this but I couldn't find anything. Everything I tried resulted in an error on the report at runtime. Like when I tried to use a LookUpSet-function that should have worked if it were allowed to use a LookUpSet-function in a DataSet.
Does anyone know how I would be able to achieve something like this?
Sorry if I'm not clear with the title but I didn't know how else to describe it, so any suggestions are appreciated as well. :)
Kind regards
Gravinco
By default, we can only get values from one list in one query, which means we can only have one list in one dataset. Even you can create a calculated fields to return the related movies of the producer, it's still not supported to use aggregation function in it to get the count value. So for your requirement, You have to create two datasets and do the aggregation on producer group level in table.

Gathering a count of something specific from mysql

I am trying to gather some specific info from mysql.
Main table is called db_items
Now in db_items there is multiple fields but the one i am focused on is named "types"
Now i want to get the total count of a unique items from that.
There is 5 different types in there. But i just want to focus on the one named "album" How would i do this ?
then also in the same mysql query be able to also grab the last 5 added to the Album field.
So then in php i can just Display the total count of albums. then show the last 5 added.

Access 2013 Web App - How to select the first record in a table using expression builder?

I am using Access 2013 Web apps to build an application. I have one table containing a list of organisations, and another table containing comments about the organisations. One organisation can have many comments.
I am trying to write a query that will select the organisation and the first comment about that organisation from the comments table. However, this is proving quite difficult with the limited Web App functions (that is, I do not know how to select only the first comment - it is selecting all of the comments associated with the organisation). I have looked high and low how to achieve this. Any help would be much appreciated. Thanks.
The way you can do this is build a query that joins in all the child records but in a SORTED order. Say like this:
Note how in above the sort order is by DESCENDING comment date. In your case you could sort by DESCENDING PK [ID] of the CHILD table. So you can sort by any column, and just sort descending on the column you want the most recent row. As noted, if you don't have a comments date column, then just sort by PK [id] of the CHILD table.
Once you have the above, then you can write a data macro that returns the FIRST row, which will thus be the most recent based on the last row.
So the data macro can look like this:
And in a form, your macro code to “fetch” the most recent comments and stuff results into a un-bound text box can look like this:

Grouping does not create in master details rdlc report formatting

I want to create a rdlc report using Microsoft Report Designer. Due to complexity of my data (the given below is just an example) I do not use View on Database side. So, I have to use seperate tables (data sources) for my report design. Now, as it can be seen the example below I have one report page and I want to show PERSONAL, FAMILY and JOB INFO for each person.
There are Textboxes on PERSONAL INFO section. The data is come from table_Personal,
There are a Table on FAMILY INFO section. The data is come from Table_Famiy,
There are a Table on JOB INFO section. The data is come from Table_Job
and all the three tables contain Person_Id column.
PERSONAL INFO
Name : Christof
Surname : Robin
Age : 45
FAMILY INFO
No----- Name----- Age----- Birt Place
1------ Sarah----- 12------ London
2------ Albert----- 16------ Manchester
3------ David----- 23------ NY
JOB INFO
No------ Company----- Start Year
1------- Xyz----------- 2005
2------- T Mobile------- 1999
3------- Day Inn------- 1993
My question is;
1) I do not want to use Subreport and do not combine these tables in db side by using view (I have searchhed, but for 3 or more tables it is impossible I think).
So, is it possible to create a master-detail report like above by grouping items (table, list, etc.) and without using subreport on rdlc? If so, could you explain a little bit please?
2) I have tried to create such a kind of report like that; I use a List and inserted all the textboxes and three tables above
to this list. I assign all the three tables as Report Data Sources. I make List.DataSetName = Table_Personal and List.Grouping settings
select Group on : Person_Id and some other combination. But, unfortunately I have not managed to create such a kind of report group like above.
Could you help me please by giving some advice and if you have some sample rdlc page source please? ...Shohel
Yes it is possible but I'd done it like 6 months ago, so I don't have any sample code right now.
I have done a lot of similar cases. One such case is there are a list of students and each student has a list of marks, a list of achievements, etc.
If I remember correctly I used one storedprocedure to get all the details of all the students. One dataset. And put 'em all in one tablix and grouped 'em.
The sub-lists (like the list of marks) are separate tablixes themselves and are inserted in textboxes of the main tablix.
Hope it helps! :)

Microsoft report - how to have two tables with grouping that should shown different records from the same set based on exclusive condition

Maybe the question title is a little confusing, so I'll try to clarify things
In a report I receive a dataset with a datatable which contain records to be shown. I cannot change that (it's not under my control).
The records have a field, RetirementDate, which can be filled or null. Based on this, the records must be shown on two distinct tables on the same report.
Both reports have the same grouping (two groups, on Department an Category, and Category is included inside department).
So reports should looks like this
Table 1 - Non retired (RetirementDate is null)
Department 1
Categ 1
Details ....
....
Categ n
Details ....
Department 2
Categ 1
Details ....
....
Categ n
Details ....
Table 2 - Retired (RetirementDate is not null)
Department 1
Categ 1
Details ....
....
Categ n
Details ....
Department 2
Categ 1
Details ....
....
Categ n
Details ....
What I was tried was to set Filter for table 1 Trim(RetiredDate&"")="" and for table 2 Trim(RetiredDate&"")!=""
But that didn't worked. Table 1 wasn't even shown (even if 90% of records have RetiredDate=null), it just show grand total band, and most records were shown in table 2.
Obvious I missunderstand how Filter on table works
I managed to temporary sort of workaround by setting condition above on Hidden prop on details band of each table, and it kinda worked (except it shows me Department Header / categ header for all dept / categs combinations, no matter they have or no details records - which, obvious, is not good).
Can anyone tell how can I accomplish what I needed? I thought Filter on table should work, but obvious it didn't the way I thought of.
I'm using SSRS 2005, and actually the report is used in offline mode, where the dataset is "pushed" in report before opening by client app and report is loaded in web-based viewer. That's why I cannot change what data I get.
Thank you
You have the right approach. Try using the IsNothing function. In 2008, you can apply a filter to a table. I think there is similar functionality in 2005. If it is like 2008, where you can set multiple formulas (versus the one formula in visibility) then I usually set both formulas to return a string and compare those. So the first formula would be
=IIF(IsNothing(Fields!RetiredDate.value), "Show", "Hide")
Then the second would be ="Show" and I would require that they match.
To debug something like this, you can add the formulas (temporarily) as fields in your table. This will let you see if things are evaluating as you'd expect.
Actually I made it finally by creating a new group, outermost, on IsNothing(RetirementDate), and gathered all data on the same, single table