Seite 1 von 1

Reports

Verfasst: 01. Mär 2017, 15:55
von ctearney
Does anyone know if it is possible to add custom reports to the Empirum Console or modify the existing ones? In the past I had used Crystal Reports to get the custom data I needed but this time we may need multiple people to be able to easily run these custom reports from the console so CR wont work.

I don't recall seeing anything to create additional reports and guess this would be a professional services task?

Re: Reports

Verfasst: 02. Mär 2017, 20:12
von Hendrik_Ambrosius
You can modify existing reports or create new reports with the free Microsoft SQL Report Builder: https://www.microsoft.com/en-us/downloa ... x?id=29072

To add new reports to the EMC you need to run a script like this:

USE MyLocationDB;

GO
DECLARE @varCategoryDescription varChar(255), @varCategoryID int, @varReportName varChar(255), @varReportID int;
SET @varCategoryDescription = 'CustomReports';
SET @varReportName = 'MyNewReport';
SET @varCategoryID = NULL;
SET @varReportID = NULL;

SELECT @varCategoryID = ID FROM ReportCategories WHERE CategoryDescription = @varCategoryDescription;

IF @varCategoryID IS NULL
BEGIN
INSERT INTO ReportCategories (CategoryDescription, Editable) VALUES (@varCategoryDescription, 0);
SELECT @varCategoryID = @@IDENTITY;
INSERT INTO ReportCategories_Localization (Category_ID, LanguageCode, LocalizedText) VALUES (@varCategoryID, 'DE', 'Benutzerspezifische Berichte');
INSERT INTO ReportCategories_Localization (Category_ID, LanguageCode, LocalizedText) VALUES (@varCategoryID, 'EN', 'Custom Reports');
END

Re: Reports

Verfasst: 07. Mär 2017, 13:46
von Hendrik_Ambrosius
I just received another version of this script that probably works better:

/***********************************************************************
* DESCRIPTION : Adds an own report to the lists of reports
*
* NOTES: Neccessary actions:
* 1. create a new folder '..\Empirum\Empirum DBUtil\Reporting\Reports\User Defined Category'
* 2. save your own report within this directory
* 3. replace the text of ?Name? with the name of the report like 'Test Report'
* 4. replace the text ?LocalPath? with the path of the report definition file like 'User Defined Category\TestBericht.rdl'
* 5. replace the text ?LocalizedTextGerman? and ?LocalizedTextEnglish? with the appropriate title of the report
* 4. execute the script on the location database
* 5. redeploy all reports via DBUtil
***********************************************************************/

DECLARE @ReportID AS INT
SELECT @ReportID = MAX(Report_ID) + 1 FROM Reports
IF @ReportID < 1000
SET @ReportID = 1000
SET IDENTITY_INSERT Reports ON
INSERT INTO Reports (Report_ID, Name, Filtered_by_ClientId, MainReport, LocalPath, Deployed) VALUES (@ReportID, '?Name?', 1, 1, '?LocalPath?', 1);
SET IDENTITY_INSERT Reports OFF
--
INSERT INTO Report_Localization(Report_ID, Text_ID, LanguageCode, LocalizedText) VALUES (@ReportID, 'Title', 'DE', '?LocalizedTextGerman?');
INSERT INTO Report_Localization(Report_ID, Text_ID, LanguageCode, LocalizedText) VALUES (@ReportID, 'Title', 'EN', '?LocalizedTextEnglish?');
--
INSERT INTO ReportToCategory (CategoryID, ReportID) VALUES (8, @ReportID);

Re: Reports

Verfasst: 27. Apr 2017, 23:53
von ctearney
Thank you! I will give this a try.