In my database i have columns with information that are match togheter with a column named MsgNumber this column looks like this:
Where if it´s 1 1 the two rows have some coherent information. 2 and 3 3 3 and 4 4 4 4 and so forh all the rows are aligned that way. My goal is to get the query to order the cells by color as show in the next pictur:
I tried with condition formation but then i needed to do a seperate "report" i need to edit the rows directly in the query. (doing it manually is not an option). Can it be done? Thanks
I'm attempting to copy a query result from SSMS to excel. I selected "copy with headers" and pasted it into Excel. My data set has 9 columns. When I paste the data into excel, information from column 9 ends spread across columns 9, 10 and 1 It looks like this:
A B C D E F G H I -Column Heading
A B C D E F G H I I -Data
I
(blank row)
I've reviewed the query results in SSMS and this is not occurring in the original data. When the value in column F is NULL the additional row and information in column 10 do not occur. Thus far I have tried the following:
-When I remove column 9 from the query then copy & paste, column 8 is spread across 8, 9, and 1.
-I've also created a brand new spreadsheet, made sure to clear any formatting and tried the copy & paste.
-I saved the query results as a .csv file and imported it into Excel. I still got the same result.
-I copied the columns individually one at a time. The the information in the 8th column ends up on two lines paired with the other columns of the next row. So each item in column 8 becomes another row offset downwards until there are many more values in column 8 than other columns. Where the value in column 8 is NULL, this does not occur.
-I removed all the other items from the query result so that only the values of columns 8 and 9 are returned. All information from column 9 ends up in column 8 followed by a blank row.
Returning 8 alone, each item returned ends up on two rows.
Returning 9 alone, the data is pasted correctly.
The headers are always in the right place. From what I can surmise, the data in column 8 is the culprit here. The data type is a varchar(max) which allows nulls. The information included is in the following format,
(TC Date & Time, Last Name, First Name) Comments
Moving SSMS query results into Excel to make tables is something I do frequently. However I have never before encountered this result. Hopefully my explanation is thorough enough so someone can tell me how to correct this error. Thanks!
Replace feed and Carriage returns from your dataset before you can paste into Excel, Try something like this on the columns you are having issues and then try to paste it in excel:
SELECT REPLACE(REPLACE(yourcolumnname, CHAR(13),' '), CHAR(10),' ')
FROM table
This is probably due to using 'Text to columns' recently in Excel. That splits columns using some rule. Columns need to be set back to 'tab delimited'.
For the offending column:
Data → Text to Columns
Original Data Type: Check Delimited
Click Next
Delimiters: check 'Tab', uncheck anything else.
Click Next
Click Finish
SSMS copy-paste does not preserve data types. Excel tries to parse the string and splits it into additional columns or even lines.
I develop SSMSBoost add-in and we have covered this in our video, which explains 3 different ways of exporting the data into Excel without data loss (data type information is preserved): (Copy-Paste in native excel format, XML export, .dqy Query) https://youtu.be/waDCukeXeLU
I am creating a SSRS report. I am using 2 datasets. I use 1 dataset to show a dropdown list of paramets and the 2nd dataset to show a relevant table. This is working great.However, I am trying for my report to show first column from Dataset1 (that i use as a parameter for dropdown) and the remaining columns from dataset 2 that are related. I have added column and inserted the expression for lookupset but that does not seem to help (it returns a blank column). I would appreciate any feedback to include 2 datasets in 1 report.
What I have right now:
Dataset1 - pulls a list of unique providers - shows that as a dropdown list.
Dataset 2- pulls 2 random clients related to that unique provider in dropdown list and gets displayed in a table form.
I am trying to create a report where the user will have the ability to pick "all" from the provider parameter dropdown and then the report will show entire list of distinct providers and 2 random clients that are related to the provider.
cloumn 1(dataset1) Column 2 (Dataset2)
Provider1
random client 1
random client 2
Provider2
random client 1
random client 2
provider3........
I'm using SSRS to build reports. The design is being done using VS2015 and the database server is SQl Server2014.
Here is my issue:
The report I'm building uses a tablix control to display records hold in a dataset. There will be only a max of 5 lines displayed in the tablix. However if the dataset has 3 records in it I would like to add 2 blank lines in the bottom of the tablix in order to always display 5 lines.
I could this at a database level by adding blank records but I would like to do it at a report level using properties/ expressions of the tablix control.
Any help?
Thanks
Regards
You will have to add 5 blank rows in the tablix outside the details group, since you won't know how many rows are supposed to be in the dataset initially. You will then want to change the Visibility property of each blank row to an expression. The first row will have an expression that looks at the count of the dataset and if its = 1, then False. That code looks like =IIF(CountRows() = 1, False, True). You will put that as the expression in each of the blank rows, but increasing the number for the subsequent row.
I'm all about recycling-)
I have report that user want to run for selected number of month back (let say from 1 to 12).
If they selected 6 month back (Jul-13 thru Jan-2104, then I need to produce 6 pages with monthly report on each of them, and sp is the SAME for all reports just different time params.
How I can reuse my code??
For now I have 12 Tablix(s) with New Page=START, Hide condition set based on datediff(m,startDate,endDate) individually for each Tablix.
Then I need to run same sp with diff params, can I add some dynamics into it? or I better to have 12 sp(s)?
Thanks
Mario
You can achieve this with a single dataset and a List Report Item with an embedded Tablix:
Set the List Grouping to Group/Sort first by: =Year(Fields!YourDateField.Value) and then by =Month(Fields!YourDateField.Value).
Set the Page Breaks on the List Grouping to "Between each instance of a group".
Drag your Tablix inside the List Report Item.
Let me know if you need more detail.