This is a migrated thread and some comments may be shown as answers.

Store report dll in database

3 Answers 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
António
Top achievements
Rank 1
António asked on 15 Jun 2012, 06:09 PM
Good afternoon,

I'd like to request your help on something I've been trying to do but haven't succeeded yet.
I need to create a few reports and need to provide them in a website (asp.net), where we also used telerik controls (we have recently upgraded to 2012 Q1)
Not all users will have access to all reports and there will be a menu built according to the user's permissions.
I was thinking ofstoring the report in a sql server (we use microsoft sql server 2008) database, so that the project won't need to be compiled everytime a new report is created.
I suppose i would have to store the project's dll in a varbinary(MAX) field.
My biggest doubt is how i set the report viwer to load the dll i stored in the database.
I've tried this:
            string reportName = @"Colaboradores.MapasFerias, Colaboradores, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";

            
            System.Type reportType = System.Type.GetType(reportName);

            IReportDocument report = (IReportDocument)Activator.CreateInstance(reportType);
            this.ReportViewer1.Report = report;
I know this is not going to the database, but it was just an experiment.... In this case reportType allways returs null...
I have a separate project where i create my reports and, like i said, i'd like to store them  in a database.

I have no idea how to set the report viewer to open a dll... Could you please help me?
Thank you very much!

looking forward to hearing from you,
António

3 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
Iron
Veteran
Iron
answered on 15 Jun 2012, 07:25 PM
Well I have never done what you are suggesting but I find the idea interesting. Have you considered using a virtual filesystem to store your dll's in?  I know it is possible to store an entire website in a database and have its resources "virtual".  I believe you are needing to look up the "VirtualPathProvider" via MSDN.

In theory you could have a virtual site with a unlimited number of dll's.
0
Chris Gillies
Top achievements
Rank 1
answered on 20 Jun 2012, 11:19 AM
Antonio,

If your main concern is not having to recompile the project everytime you decide to add new report, then create the reports in XML (the new .trdx format generated by Telerik's standalone designer).
This way you can store the xml reports directly in your database and Telerik have given a way to get those directly from the database field. Check these: Report Sources and Serializing Report Definition in XML.

Cheers!
0
AvgurD
Top achievements
Rank 1
answered on 22 Jun 2012, 10:01 AM
Hi!

This is very interest feature fo me too. But in my scenario i need to store not only report "markup" in xml - but with data wich recived by user request. Something like log of user reports, with data "spanshot" for each - if user open old report - i don't need to refresh it with new data from db - only with "original" old data from first time request.
Now i see only one simple way -auto rendering report into PDF or other format i save it in this file type - but in this case i lost ReportViewer functionality - export to many formats, interactive elemets inside report body, etc...
Other  way - storing data "snapshot" in DB as entityes (tables) - but in reports i use very complex data from WCF RIA, many tables,many WCF RIA queries - its big working to save it in db correctly...And later if i want to modify report or entities in db - i can't to render old reports.

PS Sorry for terrible English :(
Tags
General Discussions
Asked by
António
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Iron
Veteran
Iron
Chris Gillies
Top achievements
Rank 1
AvgurD
Top achievements
Rank 1
Share this question
or