Page 1 of 1
Update MRT model with designer
Posted: Mon Apr 11, 2016 9:03 am
by NicolasM
Hello,
I create my own designer with WinForm by using StiRibbonDesignerControl. I use it to create my models (MRT files) and to test print, export... (all models use only Business Objets).
I just start to use it for test and I found a problem with my code: when I modify the model, it's not automatically updated in the report (this.stiDesignerControl.Report). So I have to close and restart application to load my new model. Can I do that by code ?
My export code for example:
Code: Select all
Stimulsoft.Report.StiReport report = this.stiDesignerControl.Report;
report.Render(true);
// Get filepath
string filepath = GetFilePath("CSV File|*.csv");
// Export document
StiCsvExportService service = new StiCsvExportService();
report.ExportDocument(service, filepath);
// Open document
System.Diagnostics.Process.Start(filepath);
Thanks in advance for your help.
Re: Update MRT model with designer
Posted: Tue Apr 12, 2016 9:21 am
by HighAley
Hello.
Sorry, we didn't understand your question.
Could you describe your issue more detailed?
Also you wrote the same code as in your other post. Is it right?
Thank you.
Re: Update MRT model with designer
Posted: Tue Apr 12, 2016 1:42 pm
by NicolasM
Hello,
Sorry, I will try to explain my problem.
I create a C# project (using WinForm) to create my own StimulSoft Designer. I use StiRibbonDesignerControl and a panel with buttons.
I launch the application, load a model and load Business Object my clicking on a button. The code behind this button is:
Code: Select all
Stimulsoft.Report.StiReport r = GetReport();
SetRefAssemblies(r);
// General
r.RegData("General", Test.General.Data);
// Columns
r.RegData("CustomerEntryColumns", Test.CustomerEntryColumns.GetEntryColumns());
// Data
r.RegData("CustomerList", Test.CustomerList.GetDummyData());
// Update report
this.stiDesignerControl.Report = r;
Now, all data is set and can work on model.
I have create others buttons used to show, print, export (see my first code for export action).
My problem is: in I modify the model with the designer and try to show or export it just after, the modification is not set. I have to quit and launch the application to "apply" it. In other word, the model is well saved but I have to reload it to update model in StiRibbonDesignerControl .Report.
When I save my model file, I would like to load it automaticaly into StiRibbonDesignerControl .Report. Is it possible ?
Thanks in advance for your help.
Re: Update MRT model with designer
Posted: Wed Apr 13, 2016 11:13 am
by HighAley
Hello.
We need more information about your issue.
What do you mean under model? How do you change it and what do you need to update?
Please, send us a sample project that reproduces your issue.
Thank you.
Re: Update MRT model with designer
Posted: Tue Apr 19, 2016 10:16 am
by NicolasM
Hello,
Sorry for this latter answer.
You can found in attachment the C# project (simplified).
By model, I mean MRT file. When I launch my app, I load “Test_CustomerReport.mrt” file. Next, I click on “Custumer” button (in left panel) to load Business Objects associate to the model. Now, I can click on “Print” to show the print preview.
But if now I modify the MRT file and save modification, “Print” doesn’t work or the modification on MRT isn’t apply.
I create this app to create and modify MRT files. For that, I need to update report when the MRT file is modified and test changes when clicked on “Print”.
Is it ok for you?
Thanks for your help.
Re: Update MRT model with designer
Posted: Thu Apr 21, 2016 12:31 pm
by Alex K.
Hello,
Please try to add the Compile() method:
Code: Select all
private void button6_Click(object sender, EventArgs e)
{
Stimulsoft.Report.StiReport report = this.stiDesignerControl.Report;
report.Compile();
report.Render();
report.Show();
}
Thank you.
Re: Update MRT model with designer
Posted: Mon Apr 25, 2016 8:44 am
by NicolasM
Hello Aleksey,
Thank you for your reply. It's works now!
Thanks to all !
Re: Update MRT model with designer
Posted: Mon Apr 25, 2016 10:51 am
by Alex K.
Hello,
We are always glad to help you!
Let us know if you need any additional help.
Thank you.