Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing Crystal Reports Files in Database?

I've got a UI front end which talks to and manipulates a SQL Server database, and one of the things it can do is run reports on the data in the database.

This UI can be installed on multiple computers, and so far I've just been keeping the reports in a folder with the install, but this means that any time a new report is added is has to manually be copied to every single UI install out there.

I was thinking of storing the .rpt files in the database itself (As Blobs) and having some mechanism for the UI to fetch them when needed as a way to centralize the reports and eliminate this issue.

Has anybody tried this, and did it work well? Or if you haven't, can you think of anything I should take into account before moving forward with this? Are the any tips, tricks, or caveats you can think of that might be helpful to me?

like image 635
Lawrence Johnston Avatar asked Oct 14 '22 18:10

Lawrence Johnston


1 Answers

Great Question! It's kind of coincidental as we've actually just implemented this within the last six months.

As you've suggested, we store the rpt file within the database, but do this in Server 2005 as a Image type. It works just fine and as far as the database goes, there really is no caveats that come to mind.

Obviously, the way you access this information changes with the API. If you're using C#, this translates to using a BinaryReader to load in the rpt file, grabbing a byte array. This byte array can then be passed to the database, through a stored procedure, etc.

I realize that you're asking specifically about blobs and Server 2008, but this works in both Server 2005 and Server 2008. Hope this sheds a bit of light.

If you need more specific details I'd be glad to share!

like image 85
Scott Saad Avatar answered Oct 20 '22 21:10

Scott Saad