SSRS mailing labels with images - sql-server

i want to be able to display a grid of business cards with an image of an employee in SSRS SQL 2008.
For this I have created a query pulling the following data from Employee table:
EmployeeID
EmployeeName
EmployeeImage
The images are stored directly in the database.
I have created a blank report, formatted it to have 3 columns (re sized it to a fairly small size), inserted a table and deleted all the cells except for one. I have added EmployeeID and EmployeeName into the cell. When run, the report displays exactly what i want: grid of employees with their ID and Name.
In order to display the image, I have added another cell to the original one-cell table and inserted the image control into it. The "Use this field" value of the image is
=First(Fields!EmployeeImage.Value, "Employees")
The inserted image is a jpeg, thus the MIME type is set to image/jpeg.
When i run this, i still get the list of Employees details as before, however the cell, where the image is to be displayed is empty.
Does anyone have any tips on how to achieve what i am looking for?
Thanks
PS: I have googled this without a luck

Just found the answer.
For some reason, i was being offered
=First(Fields!EmployeeImage.Value, "Employees")
under "Use this field".
When i typed in EmployeeImage, it started working.
No idea why this happened though.

Related

SSRS - Can Individual Columns in a Grouped Row be Hidden Without Hiding the Entire Row?

I am using SSRS 2014, aka Report Builder 3, to develop reports at work. The one I'm currently working on requires a "user-level view" and a "supervisor-level view". The difference between the views is that non-supervisory users don't need to see the first three columns and should only see data related to themselves, not other users. Supervisors do need to see everything, but also want to be able to limit what's on-screen at any given time.
I can read the user's role and set visibility based on that. The problem is that I can't hide the columns because the option is not available for them. The option IS available for the columns I'm not grouping on, so I assume that this is because the rows are being grouped on those first three columns. Is there a way around this?
As far as I know there is no nice way of doing this. You can actually hide columns that are not on the details rowgroup even though the right-click context menu does not show the option.
If you left click on the column head to select the entire row, then use the properties panel you can set the Hidden property to an expression.
In fact, what you are actually doing is setting all the textbox's hidden properties.
Unfortunately this literally just hides the textboxes so it just leaves a blank area. This might not be too bad if its at the start or end column but if it was in the middle there would be a gap.
In my sample report with the column not hidden
and then with it hidden
Sometimes you just have to rethink how you present the data. In my example, for instance, I could move the data I want to hide (Year) to the next column across but still in the same row group, then delete the first column. Like this...
Now when I run the report with everything visible it looks like this.
Now, I set the ROW visibility of the row with the [Year] field and when I run the report I get this...

SQL Server Report Builder for Shipping Labels, One per page

I am trying to replace our outdated shipping label program with a SQL Server report, and I am very green when it comes to doing this. I am testing using an ODBC connection with some sample data. I have created a DataSource which is a simple "SELECT * FROM LABELLIST" statement. Each row in this table contains ONE label.
In the DataSet I have each column that is needed (To, From, Carrier, PO, etc) listed. I have dragged the fields onto a blank report and in the expression it is set to "=Fields!FROMADDRESS.Value". As mentioned earlier, each ROW is a new label, but when previewing, I only get the first record as a label. What do I have to use (tablix, matrix, list, grouping?) to accomplish this and how?. I'm not sure how to search for this answer online and was hoping to get a reference page to read on how to do it. Everything I've found pertaining to labels or "row to page mapping" is showing how to print multiple labels/rows to one page and not each row to a single page.
EdIt: to clarify, each label is being sent to a zebra thermal printer and follows a similar format to a UPS or FedEx shipping label. Each row in the table will be one shipping label.
The key for you to understand is how SSRS handles Page Breaks. I have a similar answer here.
Whatever formatting you have for your labels should be placed inside a Rectangle.
Place this rectangle into a table with one cell that is grouped by label ID.
Set the group to page break between instances.
This makes the report repeat one instance of the label on each page. It can be a little tricky to understand at first, but it is a very useful trick. I have used this for reports like invoices where we needed one on each page.

Unable to hide a field on an SSRS report

I've written a report on SSRS which has an initial parameter that you select from. That then shows a specific set of records from a SQL database. However, dependent on that selection I want some of the fields to show or not show in the report.
The fields are listed as Row Groups
and I've gone into the Group Properties/Visibility and written the following under "show or hide based on an expression":
=IIf(Parameters!StoreType.Value = "xxxxx",true,false)
My impression was that would hide the column if what I specified was true and display it if it was false, however it's not working, it still shows that column associated with that "Group". I tried altering to "Fields" rather than "Parameters", but that has no effect either.
There are quite a few fields I would like to apply this to, but obviously I need to get one working before I roll it out to all the rest. If anyone can shed light on what I've done incorrectly/need to do differently that would be much appreciated.
Cheers,
Chris
Put your expression on column visibility instead.
Right click the cell on top of column Store Group then select Column visibility.
You need to set the Column Visibility instead of Row.

Use a query to sort a report in MS Access

I am a beginner in MS Access and am currently stuck with a problem.
I have a database about movies and I'm currently creating a list of all the movies that I want to have sorted by popularity.
To determine the popularity of a movie I have a different table that has a history of what my customers have watched, every movie they have watched is a seperate entry in that table.
I have created a report that has 3 things, the title of the movie, the ID of the movie and a button to watch that movie. But I want to sort the report to show the movies with the most viewers first.
I have created this code in SQL Management Studio which works exactly like I want too:
SELECT [Film].[Titel], [Film].[Film_ID], COUNT([historie].[Film_ID]) as timesWatched
FROM [Film] INNER JOIN [historie] on [Film].[Film_ID] = [historie].[Film_ID]
GROUP BY [Film].[Titel], [Film].[Film_ID]
ORDER BY timesWatched DESC
I'm not that good with Access yet and have no idea how I can use this query to sort the report, I tried putting it in the row source (with everything on one line) in the report properties, which didn't work.
I hope someone has an idea on what to do, is it possible to use this query somewhere or should I use something else than a Report?
Thanks in advance for the answers!
If I'm not wrong..
First create the Query in ACCESS (Create tab -> query) There you will be able to create that query, save it, then go to your report and set its source to this query, the last step will be to set each textbox/label source to the query field, I mean if you have a textField in your report where you want to diplay "movieName", you must select data source from this text box and choose between all fields in your query (in this case, and following a good practice, let's say the field is called movieName too).

Reporting services only displaying the last row

I have built a report pretty basic just a table wiht 45 rows of data. Problem is its only showing one row of data and its the last row. It displays just fine in the dataset and proc. any suggestiosn?
The table is in the body of the report.
make sure the fields don't have first() or last() in them.
probably you have put the fields in the header of the report
build your first report with the report creation wizard and after change it the way you want it
or you can just try create a table in the detail part (not header nor footer) of your report and drag some fields from the datasource explorer into the table, after click the preview tab and you will some a table with some records. good luck
You could check if there are any filters associated with the dataset. Click on the Edit DataSet button and check the Filters tab.

Resources