Page 1 of 2

[resolved] Save the file mrt in the database

Posted: Wed Sep 09, 2009 3:49 pm
by Leandro
Which the best option, to save in disk or in the database?

Did anybody already develop some option to save the file mrt inside of the database sql server?
Is it later as to do for you carry it of the bank for StiWebViewer?

[resolved] Save the file mrt in the database

Posted: Thu Sep 10, 2009 8:02 pm
by Edward
Hi,

There is two methods for storing of the report template into string and loading report from that string later. Here they are:

string report.SaveToString()

and

report.Load(string reportstring)

Thank you.

[resolved] Save the file mrt in the database

Posted: Fri Sep 11, 2009 5:58 am
by Leandro
Thank you.

[resolved] Save the file mrt in the database

Posted: Fri Sep 11, 2009 6:25 am
by Ivan
Hello,

We are always glad to help you.
Let us know if you need any additional help.

Thank you.

[resolved] Save the file mrt in the database

Posted: Fri Sep 11, 2009 7:21 am
by Leandro
I'm having doubts as to save the file to disk mrt in the database.
Saving to disk is easier to manipulate when you need to make a change in Desginer
Saving the database is easier to back up
What would be more appropriate? What is more used?



Another doubt, I need to buy the license Stimul Report, but the owner of the company would like to know who uses this tool here in Brazil.
Could I pass a list of customers?

[resolved] Save the file mrt in the database

Posted: Fri Sep 11, 2009 3:27 pm
by Jan
Hello Leandro,
leandro wrote:I'm having doubts as to save the file to disk mrt in the database.
Saving to disk is easier to manipulate when you need to make a change in Desginer
Saving the database is easier to back up
What would be more appropriate? What is more used?
Your decision depend from your task. If you can't decide what choose create both variants.
Another doubt, I need to buy the license Stimul Report, but the owner of the company would like to know who uses this tool here in Brazil.
Could I pass a list of customers?
Unfortunatelly we can't provide this information. This is private information. Some of our customers give to us testimonials. You can see it at http://stimulsoft.com/Testimonials.aspx

In this list you can find customers from Brazil.

Thank you.

[resolved] Save the file mrt in the database

Posted: Mon Sep 14, 2009 7:08 am
by Leandro
Thank you.

[resolved] Save the file mrt in the database

Posted: Mon Sep 14, 2009 2:09 pm
by Leandro
I made an option to save the mrt in a table in the database.

Code: Select all

// Mrt = Control FileUpload
            if (Mrt.HasFile)
            {
                // Verificar se o arquivo já existe no diretório tmp, Se existir apagar
                String UploadedFile = Mrt.PostedFile.FileName;
                if (File.Exists(Server.MapPath("tmp\\") + UploadedFile))
                {
                    File.Delete(Server.MapPath("tmp\\") + UploadedFile);
                }

                // Salvar o arquivo mrt no diretório tmp do servidor
                int ExtractPos = UploadedFile.LastIndexOf("\\") + 1;
                String UploadedFileName = UploadedFile.Substring(ExtractPos, UploadedFile.Length - ExtractPos);
                Mrt.PostedFile.SaveAs(Server.MapPath("tmp\\") + Path.GetFileName(Mrt.PostedFile.FileName));

                // Cria um report e carrega o arquivo mrt que já esta no diretório do servidor
                StiReport mrt = new StiReport();
                mrt.Load(Server.MapPath("tmp\\") + Path.GetFileName(Mrt.PostedFile.FileName));

                // Passa a string do mrt para o campo do banco de dados
                tb.Mrt = mrt.SaveToString();

                // Apaga o arquivo mrt do diretório temp
                if (File.Exists(Server.MapPath("tmp\\") + UploadedFile))
                {
                    File.Delete(Server.MapPath("tmp\\") + UploadedFile);
                }

            }



This other routine executes to exhibit the mrt in StiWebViewer

Code: Select all

 StiReport mrt = new StiReport();
mrt.LoadFromString(tb.Mrt);
string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["Tester"].ConnectionString;
Stimulsoft.Report.Dictionary.StiSqlDatabase sti = new Stimulsoft.Report.Dictionary.StiSqlDatabase("Conexão", "Conexão", connString, false);
mrt.Dictionary.Databases[0] = sti;
StiWebViewer1.Report = mrt;
if somebody has some thing to increase, please sends

Re: [resolved] Save the file mrt in the database

Posted: Fri Jul 12, 2019 8:24 am
by arunkrsharmaa
Hi Is this feature available with Stimulsoft.JS also.

We have some existing report saved in xml format and i want to retrieve those mrt files and load in Stimulsoft.js designer\Viewer.

Or there is some other technique for backward compatibility
Thanks
Arun

Re: [resolved] Save the file mrt in the database

Posted: Fri Jul 12, 2019 9:38 am
by Lech Kulikowski
Hello,

You can use save, load events of the designer to work with reports as you need
https://www.stimulsoft.com/en/documenta ... events.htm

Thank you.