ssrs export to excel tab names on empty tablix - reporting-services

I have a report with multiple tablixes each nestled in separate rectangles I have the page break set and page name assigned in each tablix. The problem appears that if a tablix has no data the excel tab shows the table header but the tab name appears to hold from the prior tab name. For example I get Summary ta, labor tab equipment tab and equipment(2) tab because the table following equipment is empty.

So the report is pretty much a data dump with multiple tablixes that represent different data, for for example safety, quality, etc. The tablixes are inside separate rectangles.
I created separate datasets for each tablix that gets the table name. The table name is a translation for the language that name is to render, English, Spanish, etc.
I created a parameter for each table tab name that now holds the name for the table tab.
I set each tablix pagename to the corresponding parameter.
Now when I export to Excel each tab has the appropriate tab name in the appropriate language.

I had the same issue. Here's what I did to solve it:
Had a check in sql if count of rows is 0 then 'NA' will be the value for all columns; otherwise original values from table.
In SSRS, I am going to hide the text box if it has a value "NA".
You can try to hide the entire row in ssrs if the value is "NA". But its not going to work. Hiding the individual text box will work for sure.
Condition to hide: IIF(Fields!columnname="NA",true,false)
After all these steps if you export to excel it will show the group name you have given.

Related

In SSRS is there a way to use newspaper columns and still have a new page per group?

My dataset is grouped by customer then itemtype and then the details are the itemcodes and descriptions.
I am using the Newspaper column setting so that the list of items continues on to the right side of the page instead of moving on to the next page.
My problem is that I want to start a brand new page for each customer. Since SSRS treats each column as a page break, I get a page where one column belongs to one customer and the next column belongs to another.
I have tried the page break setting on the different group and the tablix properties to try and force a double page break to happen with no luck. I have also tried to drop a rectangle into the table and use the page break setting there, also no luck.
Any help would be appreciated.
Thanks,
Jessica
I've not used the multi-column layout so I can;t directly comment on that but what you could potentially do is use a subreport.
If the following does not help, post a sample of your data and your current report design and I'll post a full answer.
In short, create a report that only handles a single customer, so it will need to have a parameter passed into it that identifies each customer such as a CustomerID.
Once you have the report working with a single customer, create another report.
On this report create a dataset that just contains a list of customers you want to report on (so a list of CustomerID's for example).
Add a table to the report and remove all but a single "cell". Expand this cell to be roughly the width of your subreport (it does not have to be exact).
Set the dataset property of this table to the dataset containing your list of customers.
In the remaning cell, right-click then Insert >> Subreport. This will fill the cell with a subreport control. Right-click the subreport control and set the subreport to be the sub-report we created earlier that handles 1 customer. In the parameters, set the CustomerID parameter to the field from your customer list dataset.
Finally, right-click the 'details' rowgroup and set page breaks to 'between each instance'.
This will generate one subreport per customer and put a page break between each.

Can you link multiple tablixes on a key field in a single SSRS report?

I am creating a report in SSRS to show evaluation scores. It has three sections, and I need to link them all together on the PreceptorID field (2108 in this case). The top two sections are from the same query. I am filtering the results in each one to separate the counts because they have different column names. The third section is a subreport showing comments from evaluators. It also has the PreceptorID field in the data but is not displaying it. It has two parameters that should be populated by the main report query, but that does not appear to be happening. The report is returning all comments instead of only the ones with the matching PreceptorID.
This first image is from Crystal Reports showing how the finished product should look.
This is what I am getting from SSRS. It is showing counts for multiple people at the top. The counts in the middle are actually correct. They are all for the one person. The next person's counts are on the next page. The comments at the bottom are also not filtering on the one PreceptorID.
This image showing the subreport parameter that should be linking it back to the main query.
How can I tell all three sections to only return data for the same person on one page, and another person on the next page?
I would redesign the report structure slightly. This is only my personal preference, there are several ways to achieve this but I find this way easier to manage and maintain.
You'll need two subreports and a master report.
You already have the 2nd subreport so no extra work required there.
I would take you current report, strip out the link to the current subreport and change it so it only processes a single person (just like your existing sub report).
So SubReport1 will have the two tables from your current main report only. It will only accept a single person as a parameter (or pair of parameters in your case)
SubReport2 will be your current subreport. Again it only accepts a single person.
Next create a new report. This will be the master report.
Add a dataset that contains just enough info for list of people you want to report over. So the dataset query might be as simple as
SELECT PreceptorID, ClerkshipID FROM myTable ORDER BY PreceptorID
Add a table to this report and set it's dataset property to the dataset you just created.
Change the default (details) row group to group and order by whatever makes each record unique (maybe both the two columns listed above, may only one will be required, only you will know this).
Right-Click on the row header to the left of your table and do "Insert Row => Inside Group Below".
Remove all but one column
You should now have a table with 2 rows per group.
Right click the top cell in the group and do "Insert => Subreport", go to the subreport properties and point this to SubReport1 (or whatever you called it) and set the parameters has you have done previously.
Repeat this for second row, this time pointing to your second subreport.
In the row group properties, set page breaks to "Between each instance"
That should be it. This was done from memory so might not be 100% but based on the info in your question you should be able to work it out from here.
Things to check if this is not working
Open each subreport and test it by passing in parameters manually. Each subreport should only be returning data for a single person.
The master report should have a dataset that returns each person once i.e. if there are 10 people in total this dataset should only contain 10 rows.
The table in the master report should contain only two rows
Both rows must be EITHER within the same row group, or, if you have no other row groups, they will both be in the detail row group.
The report design should look something like this if you have a row group by person
or like this if you only have detail rows.
Finally, make sure the parameters you pass to your subreports are the Field values from your master report's dataset, NOT your master reports parameters.

Generate single report for multiple user using SSRS

I need to create student certificate using SSRS. I created new .rdl file did designed and associated with data source.
It works for single student as expected. But it does not creates report with multiple certificate while my data source returns multiple student details.
I am new for SSRS, please help me out to achieve this.
If you want to generate a certificate for each row of your dataset in the same report, you can do this with a tablix:
Add a Tablix to you your report that lists your dataset data
Drag a Rectangle into one of the Details row cells
Make the cell you dragged the Rectangle into large enough to hold all your
certificate report items
Select all your certificate items and move them into the Rectangle
Update any references to your dataset to not include a 'scope'
ie: Change =sum(Fields!ColName.Value, "Your Dataset") to =sum(Fields!ColName.Value)
Run the report
You should now have a certificate for each row in your dataset.
If you want to export multiple separate certificates, you will need to set up a data driven subscription on your report, that runs it once for each row of a returned dataset. Obviously you will need to adjust your report to be able to receive which student to generate the certificate for as a parameter.
Another way is.. if your data set is returning one row per student, then all you need to do you on your tablix is to add a parent row group.. group on StudentID.. or something unique per record.. go to group properties and add a page break at end of group. This should generate one certificate page per student..
You may need to adjust group headings and footer and things like that appear.. You will figure it out... alternatively.. watch a youtube video on how to do a basic ssrs report.
I have a subreport call StudentSub.rdl. This is linked with DataSet (stored procedure) Sp_GetStudentName(#ClassNo int). This works fine it gives always only one certificate.
Since I wanted to generate class wise certifiacte, in that case I wanted to get muliple report page wise in one PDF file. Followed below steps:
Created new RDL file called StudentReports.rdl
Linked with same data set stored procedure Sp_GetStudentName.
Drag a table from tool box to design body.
Set visibility False for table Header and some columns except one td.
Right clicked in that box (td) and inserted sub report
Right clicked sub report properties selected StudentSub subreport.
In the sub report properties added parameter ClassNo then clicked Ok.
Now When I am previewing this StudentReports by passing class no. I am getting correct number of pages.
Hope this will help others.
Thanks!

SSRS Create Tabs Dynamically

I've created many SSRS reports with multiple tabs, and am able to name the tabs at will using the page break/page name section of the properties window for a given tablix.
What I'm trying to solve for now, and can't find any good answers on the web for, is to create new tabs based on the result of my dataset.
The simplest example of which would be a new tab for each year of data, so now that we are in 2017 I would expect the report to add in a new tab for 2017 data (this is just a hypothetical example).
Is this possible in SSRS-2014, or do I have to settle for manual updates/additions every time I want a new tab?
You can do this. What you need to do is put the controls in the body of your report into a List control. In the Details group properties of that List control, group by year and set it up to page break between each group.
The basic steps are in the answer here below.
Create a new report with an empty body.
Add the Data Source(s), Parameter(s), and Dataset(s) that are needed. Make sure to include Year in your main dataset.
Add a List object to the body. Drag and drop it into the body from the Toolbox.
Set the Dataset for the list to the main data that has the year in it.
In the Row Groups pane of the Visual Studio report designer, right click on the Details row, and choose Group Properties. On the General page, click the Add button under Group expressions, choose Year from the Group on dropdown. This assumes you are getting this in the data.
While in the same dialog, go to the Page Breaks page and check the Between each instance of a group option. Click OK.
Add a Tablix inside the List. This is what will show your data.
Add some fields to the Tablix.
Run the report.
If your data returned information across more than one year, upon export to Excel, you will have one sheet for each year.
To set the sheet labels, you set the PageName property on the List detail properties pane.
Click the List control
In the Row Groups pane of the Visual Studio report designer, click on the Details row
Find the Page Name property in the Properties Pane, and set the expression to the Year value from the dataset =Fields!Year.Value
Now the sheets should be labeled with the year.
Per alejandro zuleta's comment, Set the desired group properties to page break between each instance of the group, when the report renders to excel it should interpret this as a sheet break.
If your group is dynamic, so too will the number of sheets.
You may also consider having a nested table (one table inside the other) where the "parent" table has no header and a single group (and cell) that controls your pagination. for instance; in your hypothetical, you could set the grouping to be something like =YEAR(fields!date.Value). then the "child" table contains the headers and groups that make up the report.

Create report base one number of records dynamically in SSRS

Let's say I have the following data:
In my SSRS report I have a parameter that prompts for MainID.
Now If I put MainID as 1, I should get one report. If I put MainID as 6, I should get 3 reports. Is there a way I can generate these reports dynamically using SSRS? Thanks.
I would approach this by creating a report that uses a List control, and has a page break between each item that you use to group by within that List. One report, a different page for each item of interest, SubID in this case.
Create a new report with an empty body.
Add the Data Source(s), Parameter(s), and Dataset(s) that are needed.
Add a List object to the body. Drag and drop it into the body from the Toolbox.
Set the Dataset for the list to the one you are using to return the data you have listed in your question.
In the Row Groups pane of the Visual Studio report designer, right click on the Details row, and choose Group Properties. On the General page, click the Add button under Group expressions, choose SubID from the Group on dropdown.
While in the same dialog, go to the Page Breaks page and check the Between each instance of a group option. Click OK.
Add a Tablix inside the List. This is what will show your data.
Add some fields to the Tablix. Add Detail and Notes, for no good reason on my part.
Run the report. If you have setup the data source and data set to properly run and filter base on your parameters, you should see something. Maybe an empty report.
Now (based on the data you provided), if you choose 1 for your MainID parameter, the report will display one page, but if you choose 6, you will get 3 page3, or however many records there are related to the parameter value for MainID in the database.
One report, multiple pages depending on the parameter/data. It's not a 3 different reports solutions, but something that could work for your situation.