If you have been working on a custom report and after saving it you get an unhandled exception error when you try to reopen it, you probably want to know if there is a way to fix that error.
The answer to that question depends on whether you know the last few operations before saving the report. In other words, do you have a good idea of what broke the report? If you know the cause of the error, you can fix it. Otherwise, the report may be corrupted and unrecoverable.
If you know what operation broke the report, here is the procedure to get access to the report in the Report Designer.
Open the factory database using the Microvellum SQL CE Viewer. Double click on the ReportTemplates table to open it. In the Name field, find the report that throws the exception. In the field named ReportFile for that row, right-click on the cell containing the "ByteArray" data and click "Save File to Disk." In the Save As dialog box, navigate to where you want to save it, give it a name, and an .MRT file extension and click Save.
Open a known good report in the Report Designer (Toolbox or Production). Click the Open button, as shown in the attached screenshot. Navigate to the location you saved the MRT file, select it, and click Open.
This will open the report in the Designer without any dataset connection. What that means on a practical level is that you won't be able to Preview the results of your work after revising the report. You will need to know what action broke the report, undo that action by setting it back to what it was before, or fix it. Then save the report and continue with the procedure below.
Once the MRT file has been repaired, the next step is to import that file back into the factory database. If the Microvellum SQL CE Viewer is not already open, open it, and double click on the table ReportTemplates to open it. In the Name field, again, find the report that throws the exception. In the field named ReportFile for that report, right-click on the cell containing the "ByteArray" data and click "Import File from Disk." Navigate to the location of the MRT you exported above, select it, and click Open.
If the repair was successful, you will now be able to reopen Toolbox or Production and work with the report.