SSRS - Add an existing SSRS report to the 'reports' menu in Dynamics GP

The task here is to launch an existing custom SSRS report from inside of Dynamics GP. This code was tested against GP2010.

The screen shot above shows the Sales desktop with the Report List option selected. The Sales Report Summary report was added using the technique outlined below.

                       

To achieve the results shown above, I added a line to the Dynamics..sySrsReports table, as shown below. I don't know if there's an easier way; I'm a humble developer. If anyone knows of a simpler way, could you start a thread and post it?

Edit 6/22/2015 My original script missed a the sySrsReportDataSources table and sometimes didn't work. Mariano has it right, so I just copied his script with the missing table reference

 

declare @ObjectID uniqueidentifier;
declare @BinaryBlob varbinary(max);
declare @ReportName varchar(255);
 
-- custom report name information
set @ReportName = 'Sales Report by Month by MSA';
select @BinaryBlob = Content from ReportServer.dbo.Catalog where Name = @ReportName;
 
-- setup a new GUID for the custom object
set @ObjectID = NEWID();
 
-- adds record for custom SRS report
insert into sySrsReports(ObjectID , LanguageID, DictionaryID, ObjectType, ObjectDescription, FolderName , DisplayName , TableName , CurrentVersion, MinSrsVersion, IsKpi, IsIsv, IsMultiCompany, IsCRM, IsConfigurationFile, BinaryBlob)
values                  (@ObjectID, 0         , 0           , 2         , ''               , 'Sales'     , @ReportName, 'SOP10100', '12.00.1295'  , ''           , 0    , 0    ,  0            , 0    , 0                  ,  @BinaryBlob)
 
-- add data source information with the following DataSourceType and DataSourceID values
-- DataSourceType DataSourceID
---------------------------------------------
-- 1   DataSourceGPSystem
-- 2   DataSourceGPCompany
-- 3   Custom data source name
-- 4   DataSourceCRMOrganization
 
insert into sySrsReportDataSources(ObjectID , DataSourceType, DataSourceID         , ModelID)
values                            (@ObjectID, 2             , 'DataSourceGPCompany', '00000000-0000-0000-0000-000000000000');
                    

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences