• mkostadinovic (6/22/2012)


    Whenever I try to render/preview report I got:

    The spatial data for layer 'PolygonLayer1' in the 'Map1' is not valid. Specify spatial data that is data type SqlGeometry or SqlGeography.

    Any hint what is wrong? I am using data from AdventureWorks2012 and tl_2011_us_state databases.

    Hello mkostadinovic,

    If you followed the steps and instructions discussed in the article, the report project was "MapDemo Report", you should not have had the issues as you encountered. A valid SQL spatial data type can be either Geometry or Geography.

    It is possible that you created your own project, and somewhat there was error in your configuration, settings, or loading spatial data steps. In sample demo project, AdventureWorks2012 is used as business model data source, MapDemo is the the database for holding spatial data tables, tl_2011_us_state is the original spatial data table, and StateMap is the table for holding valid spatial data for map presentation.

    For invalid spatial data in layer PolygonLayer1 (main map), you may try execute command,

    such as,

    UPDATE dbo.[StateMap]

    SET Geog = GEOGRAPHY::STGeomFromWKB(@Geom.MakeValid().STAsBinary(), 4326)

    this will help you validate the geography data on the spatial data table. Again, don't forget change the table name to the one you used.

    Hope this would help you solve the problem. 🙂