SSRS CSV export - Removing blank row between report elements - reporting-services

When exporting a SSRS report to a (custom made, delimiter = ';', no header) csv file a blank row appears between different report elements. I have a textbox which is serving as a header and a table with the data rows. Like this:
isvexport_300123_000000
data row 1,
data row 2
...
The desired output (a strict format) is
isvexport_300123_000000
data row 1,
data row 2
...
The textbox and table elements are placed exactly under each other. When exporting to Excel, there is no blank row between the elements.
Is there a way to prevent the csv export from putting a blank row between the different report elements?
I already tried putting ExcelMode = False as rendering option, but that just fills the textbox (header) on every row, which is not desirable.
isvexport_300123_000000, data row 1,
isvexport_300123_000000, data row 2
...

Related

SSRS 2008 R2 export to Excel leaves row one as blank

In an SSRS 2008 R2 existing report, I want to change the report so the users have the option to hide headers when they export the report to excel. By allowing the users to hide headers when they export the SSRS 2008 report to excel, they can sort and filter the data. This avoids allowing excel to display an error in a popup window saying there are merged cell.
My question is when I hide the headers and export the report to excel, there is a blank line in excel before the data and column headers appear.
Basically row # 1 in cell in blank and data and column headers show up starting in column #2.
Thus can you tell me how to remove the blank row in row #1 when the data is exported to excel?
I believe I have been able to duplicate your issue. Be sure that there is no space between your table and the report header. I find that setting the location property of the tablix to 0,0 is the best way to ensure that there is no space there. By removing the space, you should get your tablix headers as the first row in excel.
Here's an article I wrote giving screen shots and step-by-step instructions.
http://jaysonseaverbi.blogspot.com/2013/11/ssrs-exporting-options-for-excel.html
Use render format in an expression , to toggle the visiblity of the text box so the header appears empty
=iif(Globals!RenderFormat.Name = "EXCEL" , true, false
Note the EXCEL should be in caps for Excel 2003 (xls) and EXCELOPENXML for Excel 2007-2010 (xlsx) if using SQl 2012
There could be another reason for the blank first row:
The existence of a page header in the report.
Solution: right-click on the grey area under the report and choose "Remove Page Header"
When exporting to Excel, the first row shows the headers (if existing)
Changing the tablix location to 0cm, 0cm , will fix the problem.

import csv & use cell values one row at a time in loop

I am trying to write a piece of code in python that will access the data in a csv file, take the values by row and iterate through these in a loop using the values in an expression before moving to the next.
My csv file has two columns and 298 rows, the first of which is the header.
I want to write something that says: for each row except the first (one at a time), set var1 to cell 1 and var2 to cell 2, then use these values to do something. After doing some research it doesn't seem as if I am able to do this directly from the csv file so I wrote an empty local array to hold the data. So far I have:
import csv
filename=open("pathway/filename.csv",'rb')
datareader=csv.reader(filename)
datareaderList=[]
for data in datareader:
datareaderList.append(data)
This gives me an array populated with the data from the csv file contained within. When I print datareaderList I get [['Min',;Max'],['0','1'],['0',2'] etc.
I now want to be able to work through the list of data and access cells within a row to add them to a variable to use within an expression. I can't work out how to do this - in fact, I can't even work out how to get the values from individual positions within the data.
In text, what I want to code is:
for each row in the list of data:
set var1 to cell position 2,1 (ie. 1st cell below header), var2 to cell position 2,2
run con expression using var1 and var2 as variables
#iterate through each row of data in the list moving onto the next once the con expression is completed,
#i.e. next run var1 will be cell position 3,1, var2 will be cell position 3,2 etc.
If anyone has any ideas for how to do this I'd be really grateful as I am well and truly stuck! If you need more information or clarification let me know. Thanks in advance.

SSIS package - extract data from first n rows and import data from n+1th row from a flat file

I have a flat file with the following structure (first 3 lines are information about the file content and data starts at 4th row):
ImportSourceId,ReadTime,Location
ColumnHeader1,ColumnHeader2,ColumnHeader3,ColumnHeader4,ColumnHeader5,ColumnHeader6
Unit1,Unit2,Unit3,Unit4,Unit5,Unit6
DataForColumn1,DataForColumn2,DataForColumn3,DataForColumn4,DataForColumn5,DataForColumn6
I would appreciate suggestions to import this data to a target SQL Server table using SSIS. I am thinking on these lines:
Add a connection manager. 3 columns will be created based on the
number of values in first row (ColumnHeader3 thro ColumnHeader6 are all
being treated as one column by the connection manager at this point). As I want to extract information from the first row, I can't set 'Header Rows To skip' (?).
Add a script component to read first 3 rows to a string variable and extract the data as required.
(not sure how to split the 3rd column to 3 columns at this point)
Regards,
Mohan.
Assuming the column names are always static:
When importing the file, use a flat file connection.
Skip the first 3 rows with "Header Rows to skip"
Uncheck "column names in first row"
Click "Advanced" and manually set your column names.

SSRS 2008 CSV Export appending column names to each row

I am trying to export CSV in SSRS 2008. I am getting my data, but on top of that the column names are being appended to the front of each row.
So if my report is this:
ColA ColB ColC
1 1 1
2 2 2
3 3 3
My CSV Export looks like this:
ColA,ColB,ColC,1,1,1
ColA,ColB,ColC,2,2,2
ColA,ColB,ColC,3,3,3
Where is this coming from? I have never had this issue in an SSRS report before.I have tried setting some of the output properties for these columns, but when I do that, I lose the entire column.
The .csv export will include each groups fields with rows underneath. Sounds like you have these labels in a group total row. If the labels are just in headers they shouldn't be included in the data of the report.
One indicator of header rows versus Group total rows are the icons on the left side of the tablix when a cell is selected. Header rows will have a blank gray square. Group Totals will have part of a bracket/parenthesis.

Display data in SSRS

I have two tables on the SSRS report which displays data depending on the results returned by a single dataset.
The second table displays a subset of data which is displayed on the first depending on some parameters.Now I would like to implement a functionality which displays "no rows" in the second table if the countrows=0 (subset returned from first table) and display the data(subset of data in the first table) if the countrows>0
How can I implement this?
There is a property on the table called "NoRows" that allows you to enter any text you want to show if there are no rows returned.
you can also use this solution:
for your dataset2 click the tablix and at the bottom you shall have Row groups. Click on each of the row groups. So if you have 1 child and 1 parent you will have to do this on both.
1) Right click group_child->group properties->filters and put the following expression "=IsNothing(Fields!Group_Child.Value)="True"" "; set it as boolean expression and 'value'='False' and you will have to do same for Group_parent1 thru n.
This will display NO rows if you have NO data for bottom dataset. If this is the same thing you want to do with Tablix 1 go for it.