Getting started with Codegato Viewer and Scheduler (Codegato Report Manager)
Unzip the Codegato Report Manager installation zip file in a folder and run setup.exe. It will install Codegato Report Manager and all of its required components.
Installation will create 2 icons on the Desktop and 2 shortcuts in the User’s Programs Menu.
To start Codegato Viewer and Scheduler please use the icon for Codegato Report Manager:
You can create new folders and organize the reports however you want. To create a folder, select the parent folder and click the “Add folder” button.
You can also right click the parent folder and select the “Add folder” menu.
Insert the name of the folder in the “Add folder” dialog and click “OK”.
To add a new report, right click the folder where you want to add the report and click the “Add report” menu.
Another way is to select the folder and press the “Add report” button in the toolbar.
The report wizard window will guide you through the process of adding a report. For the purpose of this example, we are going to add the “Employee Sales List” report, which is copied by Codegato Report Manager setup. Path to the report is usually: C:\ProgramData\RTManager\SampleReports\EmployeeSalesList.rpt
1.Select Crystal reports type.
Codegato Report Manager supports all Crystal reports versions starting with Crystal Reports 7. The latest supported version at the time when this document is created is Crystal Reports 2020. However, a new version of Codegato Report Manager is released with any new Crystal Reports version so the latest Crystal Reports is always supported. Click “Next” to go to the next step.
2.Select the report file to add using the button in the upper right corner.
Codegato Report Manager will load the report information including the database connection.
If your report is using a connection (or multiple connections) with integrated security and you don’t want Codegato Report Manager to modify the existing connection info, press the “X” button. This will clear the connection info and Codegato Report Manager will ignore the connection since it will be handled by Crystal Reports.
If you would like to change the connection to use another server, database, different connection type (OLEDB instead of ODBC and vice versa) or to provide username and password, click the “Modify” button with the 3 dots.
You will then see the “Connections” dialog, showing all the connections used by the report.
Sometimes you may see multiple connections pointing to the same server and database using different usernames or with lower/upper case differences. Use the button with the 3 dots for each connection to set the corresponding connection you want to be used by Codegato Report Manager. Choose the desired connection and press “OK”. The screen bellow shows tabs for “Connection Data”, which will be the equivalent of single time used connection, and “Saved Connections”, which will be reusable connections, which can be used in multiple reports, jobs etc. We highly recommend to use “Saved Connections” option to avoid creating a separate connection for each report.
Codegato Report Manager supports multiple connection types. Most of the time you will use Regular, ODBC or partial.
-Legacy connection is using the standard System dialog to create a database connection. By default, it will select MS SQL Server connection, but you can change the connection type using Change button
-Regular connection will allow you to set the server, database, and user information. The screen may differ based on the database type. Here is how the screen looks like for SQL Server:
-ODBC shows the standard ODBC dialog. If you cannot see a specific connection please check if you created it in 32- or 64-bits ODBC. The connection type should match Codegato Report Manager installation type. The 32 bits Codegato Report Manager will be able to see just 32 bits ODBC connections and the 64 bits Codegato Report Manager will just be able to see 64 bits ODBC connections. This is how ODBC works and there is nothing we can do to show all connections.
-Partial connection is usually used to replace the username and password. For most of the databases you will also be able to replace the server and the database.
While Regular and ODBC connections will set the whole connection and possibly will replace the connection type from ODBC to OLEDB and vice versa, Partial connection will only provide information about the login. The connection type will be the same as the one in the report. That being said, if you don’t need to replace the whole connection, Partial connection would be preferred. It will be a smaller change and will run faster. You can create a connection, save it and reuse it. This approach will allow you to switch all you report to a new username/password just by updating the connection. Once the connection is set, click “Next”. Codegato Report Manager will check if the provided connections are valid and will go to the next step. You will need to fix the connections if they are not valid.
1.Setting a parameter’s default values.
You can select each parameter, default values, and the way you want the parameter to be processed. There are multiple ways to select a default value for each parameter, you can use relative dates, hardcoded data, formulas and C# code. Default values are explained in this document Use formulas and dynamic variables
The “Format” section is used to set the presentation of the parameter. Choosing “Value List” will allow you to present the parameter as a combo box.
And you will be able to select the source of the combo box data:
•Discrete value: Could be either inserted manually or imported from the report
•SQL Command: You can connect to a database and retrieve the values using SQL command
•Report parameters values: This option is rarely used since it will require Codegato Report Manager to run the report just to get the parameter values and show them before you to run the report
Once you are done configuring parameters, click “Next”.
1.Rarely used helpful screens for specific scenarios:
•Before run actions:
This screen will be useful if you need to define a SQL command or C# code, which will be executed before Codegato Report Manager to run the report. A SQL Command might be useful to prepare some data in the database (generate or modify records, clean a temp table, etc.). C# code might be useful in case you want to run some code and to clean folders, move files instead of overwriting them, and etc.
•Set Report Data Source from an external command:
This screen might be useful when you want to provide the report data using an external command. Codegato Report Manager will run the command and will use it for the report. The report connection will not be used. The report will just show the information provided by the external command. This method might be significantly faster for reports with many sub-reports, since it will retrieve and set the data in one pass while Crystal reports will execute a separate command for each subreport.
•Report output:
This screen will be useful in case you want to export the report or send an email each time the report is run. This is normally what is used when you need a copy of the report for compliance reasons.
•Report events:
This screen might be useful if you want to do some checks or processing at certain events. For example, you can add C# code to the “Before run” event to check if the report's parameter’s values are correct. If the check fails you can show a message and not run the report. This might save a lot of time especially for slow running reports. Instead of waiting for the report to finish and then notice that the parameters were wrong you can handle it before running the report.
•Replace record selection formula:
This screen might be useful if by any reason you would like to replace the current record selection formula of the report with a new one.
1.Report permissions. Using this screen, you can tell Codegato Report Manager what each of the available roles can do with the current report
Codegato Report Manager security is based on Roles and assigned users. Each user might be a member of multiple roles and the user’s permissions will be a combination of roles permissions. To manage Roles, open Settings either by clicking the small gear icon on the top of the screen or by clicking Commands -> menu “Settings”.
Select Security -> Roles on the left and edit or create a new role.
The “Roles” dialog will provide you to allow or deny available features
There are 3 options for each feature:
•Allow (as it is shown for feature “Reports.Run” on the screen-shot above) will allow the role to use the feature
•Deny (as it is shown for feature “Reports.Add” on the screen-shot above) will deny access to the feature. Deny has priority over Allow. So, if the user is a member of a role, which denies the feature, no matter how many of users’ roles allow the feature the feature will still be unavailable for the user.
•Unknown (as it is shown for feature “Reports.Edit” on the screen-shot above) will not make any changes. If the user is a member of another role which allows the feature and a member of a role which denies it, the feature will be available for the user.
Here is a table showing how combined permissions work:
Feature |
Role1 |
Role2 |
Role3 |
Result |
Note |
Sample feature 1 |
Allow |
Unknown |
Unknown |
Allow |
Allowed because Role 1 allows the feature and no role denies it |
Sample feature 2 |
Allow |
Allow |
Allow |
Allow |
Allowed because Role 1,2 and 3 allows the feature and no role denies it |
Sample feature 3 |
Unknown |
Unknown |
Unknown |
Deny |
Denied because no role allows the feature |
Sample feature 4 |
Allow |
Allow |
Deny |
Deny |
Denied because at least one role denies the feature. All “allows” will be ignored |
Sample feature 5 |
Deny |
Deny |
Deny |
Deny |
Denied because at least one role denies the feature. All “allows” will be ignored |
The rule is that in order for the feature to be enabled, at least one role should allow it and there shouldn’t be a role which denies it.
The permissions screen looks like this:
For each of the roles you can set permission to “Run”, “Edit”, “Edit Layout” or “View history” of the current report. Note, that some permissions are available both on the role and report level. For example, you can allow a role to run reports in general, but you can stop the role from running the current report. So, the role will be able to run reports, but you can specify which reports will be available for it. For example, you can allow each department to have access to different reports. Even if there are no security reasons to restrict access to reports, if a user needs access to 5 reports there is no reason to show 400 reports in the tree and make finding the report harder.
In the upper left corner, you can see buttons to save and load permissions templates. Often you have to set the same or similar permission combinations. You can save the current combination as a template and load it for other reports.
1.Report Instructions.
This screen can be used to create a document providing help, instructions or other information related to the report.
You can load an existing or create a new Word file using the WYSIWYG editor. The document will be available to the end user through the right click menu “Show instructions”.
To run a report:
1.Select the report you want to run. Report information will be loaded and you will see the available parameters with loaded default values
2.Set parameters’ values (if necessary)
3.Select the desired output format. There is an option to set the default output for each report. You can also choose to use internal or external viewers for PDF, Excel, Word and other file types. Codegato Report Manager supports al these files and no external software is required in order to preview them.
4.Press the “Run” button in the upper left corner to run your report
Sometimes you may need to apply some extra logic when running reports. For example:
run multiple reports and combine them in a single output file
run different reports based on some criteria.
Export the same report to a different file (PDF, XLSX, CSV etc.)
To handle these and other scenarios, Codegato Report Manager provides the option to create jobs. There are 3 job types and they are demonstrated with samples:
This job type is useful when you want to run one or more reports, export them to files and send them by email. Exports are possible on report and job levels. Codegato Report Manager samples contain a sample job titled Multiple Reports, which contains 2 reports and 1 PDF file.
When the job is executed, the reports Chart and Cross Tab and the PDF Grouping Data will be exported to a single PDF file with bookmarks for each part. Note that you can combine files exported from reports with existing files. The files should be the same type. In case you export to Excel. Codegato Report Manager will create a single Excel file with separate worksheet (tab) for each item (report or existing file)
This is a special job used with Crystal Reports. The report should contain at least one group. Values from each group item can be used to set file and folder names, email addresses, subject line, as mail merge fields in the email body etc. Codegato Report Manager will separate and export the report to multiple files, one for each group item. Codegato Report Manager samples contain a sample job titled Bursting Job Employee Sales List. This job is using the report “Employee Sales List" and runs it for all employees. Then Codegato Report Manager parses the report and generates a separate PDF file for each employee in the report. The sample also exports data for each employee to a separate worksheet in an Excel file. The result is a single Excel file with multiple worksheets, one for each employee.
This job type allows you to get some data from a database using a SQL query and then run one or more reports for each record returned by the query. Values from the query record can be used to set reports’ parameters, file and folder names, email addresses, subject line, and mail merge fields in the email body etc. Codegato Report Manager samples contain a sample job named Data driven Job Employee Sales List. This job is running a query to get a list of employees with their ID’s and email addresses. For each record returned by the query, Codegato Report Manager will run the report “Employee Sales List” and will use the current value in field ID to set the value for the report's parameter “EmployeeID”. Report will be exported to a PDF. Data driven query field “Name” will be used for file name and the file will be sent to the email address retrieved from field Email. In a similar way as for Bursting job, this job also will generate an Excel file with multiple worksheets, one for each employee. Data driven job will execute the data query before any of the reports is run. You can use fields returned by the data query to decide which report to run or which connection to use. In order to use a specific connection, you have to provide its id in the data query
The provide Id should match Saved connection ID
Another powerful feature available explicitly for data driven jobs is reports workflow. You can create “Condition Before” and “Condition After” for each report. For example, you can add a field “Preferred Language” to your data query and run the report just if the “Preferred Language” is “English”. Then add another report and create a “Condition before” if the “Preferred Language” is French and so on. Eventually Codegato Report Manager will run just one of the reports, the right one for the current data query row. You can read more about this feature in the blog post for reports’ localization
Jobs support the same folder structure as reports. To create a new folder, you can right click on the parent folder and click the “Create folder” menu or use the “Create folder” button from the toolbar. To create a job, right click on the folder and click the “Add Job …” menu or select the folder where you want to create the job and click the “Add Job” button on the toolbar.
•The first screen on the Jobs dialog is “Job data”. Here you need to set the job name, job type and database connection. Database connection is required for backward compatibility and will not be used. You can choose any database connection. Job ID will be assigned by Codegato Report Manager and is a read only field. This ID can be used by custom software or batch files to run the job if you want to run it without using the Codegato Report Manager interface.
•The next screen is “Parameters”. Here you can add job parameters and define their default values. Here is an example of how jobs’ parameters might be useful. Let’s say you have five reports which you need to run with the same set of parameters every day. Instead of running the reports one by one and setting parameters for each report, you can add all 5 reports to a Simple job, define the job parameters matching the reports parameters and link them so each report parameter will be linked and will receive a value from a job parameter. You will be able to set the job’s parameter values and these values will be propagated to the corresponding report’s parameters for each of the reports. In such a way you will be able to run all 5 reports faster and easier, setting the parameter values one time only.
•The “Actions before” screen is the place where you can define SQL or C# commands. SQL commands can be used to prepare data, C# command might be used to run some code to delete existing files or folders, etc.
•The “Steps” screen is the place where you will add your reports, files, commands and conditions. Conditions are available for Data driven jobs only and will allow you to move to another step conditionally.
For example, let’s say you have reports in English and French to print invoices. You can add both reports to a data driven job and based on the customer preferred language field returned by the query you can print one or the other report.
When adding a report, you will see a dialog box to select the report and set parameters’ default values. Using the button you can assign values from data driven query fields, job parameters or C# functions.
Selecting “Start Date” under the “Job Parameters” node in the screen above will assign the value of the job parameter “Start Date” to the report parameter “Start Date”. This is how the job and report parameters can be linked.
•The next screen is “Output”. On this screen you can add tasks to export and email files. The “Output” screen is available on both the report and job level. The difference between the 2 outputs can be explained by this example. Let’s say a job contains 2 reports, outputs from each report will export just the corresponding report, both reports will be exported to 2 separate PDF files, each PDF file will contain one of the reports. Job output will combine both reports in a single PDF file. Job output is restricted to PDF and Excel since these are the only file types, which support merging multiple files. When an Excel file is created in the job output each report will be exported to a separate worksheet.
•The next screen is the “Actions After” screen. This screen is similar to “Actions Before” and can be used to define SQL and C# commands for cleaning.
•The “Security” screen is very similar to security used for reports. Permissions for reports and Jobs differ, and for this reason, templates for report’s security are not compatible with job’s security. However, logic and roles are the same.
Select the right permissions and click “OK” to save the job.
To run a report:
1.Select the job you want to run. Job information will be loaded and you will see the available parameters with loaded default values
2.Set the parameter values (if necessary)
3.To start the report, press the “Run” button in the upper left corner
Codegato Report Manager provides 2 separate schedulers
Scheduler is a pretty simple calendar interface, similar to Outlook, which allows creating scheduled tasks and running jobs at a specific time.
Scheduler can work in 2 modes:
•Front end application. This mode will require the Codegato Report Manager application to be started. It is convenient when you are testing the software, but since a user interface is involved, it is not as reliable as Windows service. This mode also requires somebody to login to Windows and start Codegato Report Manager, so in a power outage or Windows restart for update or any other reason, Codegato Report Manager Scheduler may be not active.
•Windows service. This is the preferred method to use Codegato Report Manager in production. Instructions how to enable Codegato Report Manager Windows service are available in this document: Activate Codegato Report Manager Scheduler Windows Service
This scheduler is available through “List view”. List view will show the list of all scheduled tasks. When you create a new task, it will create a short-term task, which will run in short periods and will be not visible in the calendar. There is no point to have on the calendar a task, which will run every 3 minutes. You can restrict it to work during specific hours and exclude weekends, but these tasks are designed to work in in scenarios where you need periodically to check conditions and run some jobs. You can check the blog post for “Continuous processing”
If you would like to just test a report or job you can switch the current mode from Normal to Test.
This will cause all emails to be sent to the email of the user who is running Codegato Report Manager instead of the recipients set in the job. The user’s email is set on the user’s screen.
Keep in mind that this mode is just a temporary state and only works for the manual runs in the front-end. If the Codegato Scheduler service is configured and working in the background and the job is scheduled to run, it will be started in Normal mode and all emails will be sent to the email addresses configured in the job.
Sometimes you may have an existing instance of Codegato Report Manager, which has been already configured and working on a computer, which you need to migrate to a new machine. To test the new computer, without sending the configured emails, you can use the “Test environment” option. This option will work for the Codegato Scheduler service too. You need to restart Codegato Report Manager to activate it.
Report and Job usage history (journals)
You can right click on a report, job or folder and click the menu “Show Journal Data”.
`
Codegato Report Manager will show a filter screen so you can refine your search.
The result will show details about usage. When and who ran the report/ job, what were the parameters, how much time it took etc. Please review the section SQL Server database and advanced features of this document for advanced journal features.
SQL Server database and advanced features
Codegato Report Manager supports 2 database types:
1.Local database is installed and used by default. This is a SQL Server CE database and it will be fully configured and ready to use when Codegato Report Manager is installed. This database is good for testing some basic features like running and scheduling reports. All the features covered in this document are supported by this database.
2.SQL Server database supports some advanced features but requires additional installation and configuration. You can find instructions how to install it in this document Installing SQL Server database for Codegato Report Manager. Here is a list of features supported when Codegato Report Manager is using a SQL Server database:
-Multiuser and multi-computer environment
You can install Codegato Report Manager on multiple computers, connect them to the same SQL Server database and manage reports, jobs, roles, permissions, etc. centrally. When you add a new report, you can make it instantly available to multiple users in the company. Since the Local database is on the user’s machine, if you have multiple users using the Local database you will need to add the report on each machine.
-Document management (Context management)
Codegato Report Manager has an internal Document management system, which requires the use of a SQL Server database. When Document management is available, you will be able to export file to Document management
Once the file is added to document management you can define rules to make it visible in different folders. Document management can also preserve emails and other documents generated by Codegato Report Manager. Since the documents inside are linked to the reports and jobs you can get very detailed historical information (journal) for report and job usage. Here is a screenshot of job activity for a specific job run:
This was a data driven job. The query returned 6 records. For each record, Codegato Report Manager ran the Employee Sales List report and saved the exact parameters in the history.
Each report was exported to a PDF, the exported PDF is available in the Documents tab for each row.
If you double click the document it will be opened from Document management and you can review it.
During the execution, Codegato Report Manager also sent an email and attached the generated PDF. There is a record for the email including Address To, CC, BCC, Subject and Body information. In addition, you can ask Codegato Report Manager to save a copy of the email in Document management, so if you double click the record, you will open the email message as it is sent to the recipient (including attachments, pictures etc.)
1.Version control and Documentation and Search
Codegato Report Manager has modules for Codegato Version control and Documentation and Search for Crystal Reports. These modules simplify the development process
-Codegato Documentation and Search
Provides a way to search report metadata and structure. You can find specific text in text fields, SQL Expressions, Formulas, Commands, Connection info, tables, stored procedures, parameters, running totals, report properties …. the list continues. This module is able to compare reports so you can finally find what was changed when ReportA was saved as ReportA_old and ReportA_April2018. You can find more information about this module on this page: http://codegato.com/Pages/CrystalSearch.aspx
-Codegato Version Control
Provides a way to keep track of the changes in reports. You can add notes for each change and attach documents and emails requesting the change so eventually you will have information about change history for each report and who requested each change and request documentation. You can find more information about this module on this page: http://codegato.com/Pages/VersionControl.aspx