About Save and Load
About Save and Load
Hi, I save a report to string ,but how can I load it?
StiReport report = new StiReport();
string doc=report.SaveDocumentToString();
we save the string 'doc' to database,how can I load the string 'doc'?
the follow code does not work!why
StiReport report = new StiReport();
report.LoadDocumentFromString(doc);
StiReport report = new StiReport();
string doc=report.SaveDocumentToString();
we save the string 'doc' to database,how can I load the string 'doc'?
the follow code does not work!why
StiReport report = new StiReport();
report.LoadDocumentFromString(doc);
Re: About Save and Load
Hello,
The SaveDocumentToString() method save rendered report. Please try to call the Render() method before saving. If you need save/load a report template please try to use the SaveToString() and LoadFromString() methods.
Thank you.
The SaveDocumentToString() method save rendered report. Please try to call the Render() method before saving. If you need save/load a report template please try to use the SaveToString() and LoadFromString() methods.
Thank you.
Re: About Save and Load
Hi,I just want to save/load the rendered report,it does not work!
Re: About Save and Load
Hello,
Can you please send us a sample project which reproduce the issue for analysis.
Thank you.
Can you please send us a sample project which reproduce the issue for analysis.
Thank you.
Re: About Save and Load
Hi
Xaml code:
<SLControl:StiSLViewerControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Margin="0,0,0,0" Name="slview" />
CS Code:
------------------------------------------------
//slview load a report from Resource
StiReport report = new StiReport();
report=slview.Report;
report.Render();
string tmpstr=report.SaveDocumentToString();
//save tmpstr to database
----------------------
another page:
Xaml code:
<SLControl:StiSLViewerControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Margin="0,0,0,0" Name="slview" />
CS Code:
----------------
string tmpstr ="xxx"; //Getting the string from database
string reportstring=tmpstr;
StiReport report = new StiReport();
report.LoadDocumentFromString(reportstring);
report.Render();
slview.Report=report;
---------------------------------
///slview can not display the report
Xaml code:
<SLControl:StiSLViewerControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Margin="0,0,0,0" Name="slview" />
CS Code:
------------------------------------------------
//slview load a report from Resource
StiReport report = new StiReport();
report=slview.Report;
report.Render();
string tmpstr=report.SaveDocumentToString();
//save tmpstr to database
----------------------
another page:
Xaml code:
<SLControl:StiSLViewerControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Margin="0,0,0,0" Name="slview" />
CS Code:
----------------
string tmpstr ="xxx"; //Getting the string from database
string reportstring=tmpstr;
StiReport report = new StiReport();
report.LoadDocumentFromString(reportstring);
report.Render();
slview.Report=report;
---------------------------------
///slview can not display the report
Re: About Save and Load
Hi:
I want to save/load a report document, not template.
I want to save/load a report document, not template.
Re: About Save and Load
Hello,
Can you please send us a sample project which reproduce the issue for analysis.
Thank you.
Can you please send us a sample project which reproduce the issue for analysis.
Thank you.
Re: About Save and Load
Hi,I have send the sample to you.
thanks.
thanks.
Last edited by shaome on Mon Nov 25, 2013 3:16 pm, edited 1 time in total.
Re: About Save and Load
Hello.
You shouldn't call Render() method in the btnDisPlay_Click event. You create empty report and load rendered report. And when you call Render() method all rendered pages are removed and you get empty report. The right code will look like:
Thank you.
You shouldn't call Render() method in the btnDisPlay_Click event. You create empty report and load rendered report. And when you call Render() method all rendered pages are removed and you get empty report. The right code will look like:
Code: Select all
private void btnDisPlay_Click(object sender, RoutedEventArgs e)
{
if (DocumentString != "")
{
StiReport report = new StiReport();
report.LoadDocumentFromString(DocumentString);
//report.CalculationMode = StiCalculationMode.Compilation;
//report.Render();
stiSLViewerControl2.Report = report;
}
}
Re: About Save and Load
thanks