SSRS - Spatial Data/Map report issue - sql-server

I'm having trouble implementing what I feel should be a fairly basic report in SSRS (SQL Server 2014 and VS2013 Shell). I work for a company based in the UK and I want to show various data using the Maps functionality. To start with I simply want to take customer sales data and plot it over a basic UK map. To that end I have constructed a query which uses the customer postcode to obtain latitude and longitude values. I have then used STPointFromText to convert these to the Geography data type as follows:
geography::STPointFromText('POINT(' + CAST(longitude AS VARCHAR(20)) + ' ' +
CAST(latitude AS VARCHAR(20)) + ')', 4326) AS Geog
This dataset contains the sales figures, so the analytical and spatial data is all in one place (assuming I've understood this part correctly!).
When I query this data in SSMS and view the results under the Spatial tab, it looks quite promising, i.e. quite clearly plots the shape of the UK:
spatialoutput SSMS
However, when I try to represent this in SSRS, it falls apart. Using the SQL Server spatial query option as my data source, and using the query I constructed and ran in SSMS previously, I keep getting a popup window which reads:
'Unable to determine the spatial data type in the specified dataset field: Geog'
From here nothing works. I don't see any maps or any points like I did in SSRS. I've been searching for hours and not really found a solution, although I did find this on MSDN:
https://msdn.microsoft.com/en-us/library/hh272532.aspx
'You cannot use the dataset designer in Visual Studio for queries that return SQL Server spatial types. The dataset designer does not support user-defined types (UDTs), to which category the SQL Server spatial types (SqlGeometry and SqlGeography) belong.'
Various articles I have read showed people simply building a query like mine and then adding it as a dataset, after which it detected the spatial column and type straight away. Many did appear to be SQL Server 2008 R2 though. The article above implies a load of messing around with files in the GAC and the creation of a Windows Form Application, which presumably requires VS Pro and additional fiddling.
If anyone could point out where I'm going wrong it would be much appreciated!
Thanks in advance.

Related

SSRS - OutOfMemory exception for Matrix report

I'm trying to design a Matrix report through SSRS to aggregate a column for a range of dynamic values in another column (i.e. a pivot). This data consists of just over 13 million rows, so it's a large dataset.
When doing a PIVOT on this data via T-SQL, it's able to aggregate all of these rows in about ~1min, however when getting SSRS to do the pivoting for me through a Matrix report, I'm getting an OutOfMemory exception when trying to preview the report on my PC.
The query returning the dataset itself isn't complicated, it's as simple as:
SELECT
ID
,Test_Ref
,Data_issue_indicator
FROM MyTable
Where we're trying to do the sum of Data_issue_indicator (which can be either a 1 or 0) for values in Test_Ref, in which there is a dynamic range of values to aggregate against; in other words we cannot use a standard Tablix report because the amount of columns can increase at any time should a new Test_Ref value be introduced into the dataset.
I'm using Visual Studio Enterprise 2019, and my PC is a Windows 10, i7-8850H, with 16GB memory.
Is there a suggestion on getting around this issue?
When using SSRS, its recommended to grab more data once in case of using the dataset multiple times. but when you have a larger dataset it needs to be a trade off between what you want to achieve against do you need all the data.
So in this situation i would suggest to use a procedure to restrict the amount of data that you are grabbing to the report.
I have gone through this sort of scenario, and i had to do the same, because its not the query that is timing out but the huge amount of data that is loaded to the report which fails the report.
If you have SQL server profiler , you would see the SQL executed and completed, but the report times out rendering.
Two ideas, assuming that you plan to deploy the report to a server that will have the memory to handle this, and that you'd prefer to do this processing on the report server rather than the SQL server for some reason:
Don't test the functionality on your PC in Visual Studio. Design the report, deploy it to your Report Server, and test it there to see if it works.
When testing on your PC, force it somehow to use a much smaller dataset: one just large enough to verify that the pivoting Matrix works, but small enough that your PC's memory can handle it.
Or better yet, do option 2, and then option 1.

SQL Server Report Models

I am currently working on a project which uses SQL Server Reporting Services 2012 to create a (large) set of reports.
We would like to enable some business users to create reports from a live Oracle database, however these are staff who have no skills around SQL or data models, nor an expectation to learn - this is repeatedly stated to be outside their remit (they are analysts recruited to be critical thinkers, not technical staff).
They require the capability of creating ad-hoc queries and reports from the database to answer questions as and when they arise but need to be able to create queries with and/or type clauses to reach record level data and generally create record sets for reading/review.
Currently the only option looks like using the legacy Report Model to pre-define the most commonly used business models on top of the live database as I can not prove that the Tabular Model provides querying capability required. We do not have data that forms into a dimensional model very easily, and even then often have questions that asks for multiple null values to be returned due to significant accepted data gaps.
Is anyone able to shed any light on how the current Microsoft BI stack would let non technical users ask the following type of query and return a single data set in SSRS Report Builder:
Select all records
where
created between two dates and match two keywords in text field 1
or
Updated between two dates and match three keywords in text field 2 and have a status of X
I know that tools such as Business Objects provide this sort of interface but I feel that I must be missing something within the MS solution as they had this so well covered with the Report Model.

text column convert to date for visual studio graph

I am writing a clickonce application in vb.net. I have sql tables linked to a Microsoft Access database, and then my application reads through the OLEDB connection.
My columns in SQL are saved as date however when linked to MS Access they convert to "text" I haven't had any issues with this until I started creating charts on my application. I need the dates on the chart to display as jan 17 feb 17 etc however no matter what formatting I use they come back as '2017-01-01' '2017-02-01'
I have tried
ChartFCR.Series(0).XValueType = DataVisualization.Charting.ChartValueType.DateTime
ChartFCR.ChartAreas(0).AxisX.LabelStyle.Format = "MMMyy"
in various forms and nothing is changing the appearance. any information or suggestion is helpful.
Thanks
The only way Access will make sense of a SQL date data type is if it is converted into 1) a datetime in SQL or 2) a date in Access.
Of course it depends on your situation, but try creating a query in Access that handles that conversion and base the chart on the query. That would give you the most control for the Access interface.

SQL Server & Mappoint/Spatial Table/Long&Lat

I am trying to map some data out of MS SQL Server 2008 (express) and Mappoint with the Mappoint addin for Sql server. The only issue i have is this spatial table stuff. I think i understand what a spatial data is now but i just need an example of how to go about cross referencing my states table with its spatial data. so i have a table with Vendor names, states they perform work in, type of work they do etc. States listed e.g (Florida, Montana, Puerto Rico, all 50 states) what is going to be their spatial reference. Or can i just add a Long and Lat to the table to reference the states. At this point i am giving up on the whole spatial table or query stuff. Can i just have a long and Lat colum in that table? Would Long&Lat be 2 in 2 different colums on the table?
I do not understand what you are trying to do - can you please restate. Give the overarching question you are trying to solve.
It may be worth moving to full version of SQL Server with its geospatial extensions.
Or do as you suggest use data columns for longitude & latitude. Then you'd drop using the MapPoint add-in completely, and simply use MapPoint's Data Import Wizard. (you may need to create a udl connection to SQL Server).

How to use 3rd dimension in MDX query (ON PAGES syntax)

I have a problems with 3rd dimension in MDX Query (on MS SQL Server 2005). I can use 3rd dimension in Visual Basic (I have a cube there, using browser I can make 3 dim. queries -- owing to ON PAGES). I snooped it via MS SQL Profiler (it records databases queries). But when I tried to put the query into MS SQL SERVER, only thing what I've received was:
Executing the query ...
Obtained object of type: Microsoft.AnalysisServices.AdomdClient.CellSet
Formatting.
Results cannot be displayed for cellsets with more than two axes.
Execution complete
I tried a few different ways to implement query, but this^ answer, was an only answer from a server.
The question is: What I need to do to use third dim in my OLAP?
When you query Analysis Services with SQL Server Management Studio (SSMS) you get an ADOMD.NET Cellset object. This object represents your query results in a multidimensional fashion, laying out the information in several axes: Axis 0 for columns, axis 1 for rows, axis 2 for pages, etc.
Although your query may be correct with three axes, SSMS can only render bidimensional restults, hence the error message you get. You need to build an application using ADOMD.NET to consume the cellset, or use a third party tool.
You say you "put the query into MS SQL SERVER" - what exactly do you mean? Did you try the cube browser that comes with Analysis Services? It's pretty rubbish.
I think the problem is as simple as the error message you got - "Results cannot be displayed". In other words, the viewing software can show tables (i.e. 2D info) but doesnt have a way to display 3D info (whether it be in multiple tables, or whatever).
You need to find software that can present cube data more elaborately.

Resources