Report.Export raises an exception "The path is not of a legal form" when exporting to stre
Hi,
I get the exception "The path is not of a legal form" when I try to export a report to stream. ( Export to file works O.K. )
Here is the code that I'm using:
Report rep = new Report();
rep.Load(Request.PhysicalApplicationPath + "MyRep.frx");
rep.RegisterData(... some data ... );
rep.Prepare();
FastReport.Export.Html.HTMLExport export = new FastReport.Export.Html.HTMLExport();
MemoryStream St = new MemoryStream();
rep.Export(export, St); // this line causus an error
Any help will be appreciated,
Trebor
Comments
HTML export output can't be saved to a stream because it may contain several files (.html file per each report page + image files).
Thanks,
I changed the HTML export filter with RTF filter, but now I'm facing another error
( "Cannot start process because a file name has not been provided.") when exporting to stream:
Report rep = new Report();
rep.Load(Request.PhysicalApplicationPath + "MyRep.frx");
rep.RegisterData(... some data ... );
rep.Prepare();
FastReport.Export.RichText.RTFExport export = new FastReport.Export.RichText.RTFExport();
MemoryStream St = new MemoryStream();
rep.Export(export, St); // this line causes the error "Cannot start process because a file name has not been provided."
Any help ?
Thanks,
Now, the stream length is OK ( the same with the file length when exporting to file ), but the stream content is emtpy .
( When I read the stream content into byte array, the whole array is filled with bytes with value = 0 )
FastReport.Export.RichText.RTFExport export = new FastReport.Export.RichText.RTFExport();
export.OpenAfterExport = false;
MemoryStream St = new MemoryStream();
rep.Export(export, St);
Byte[] buffer = new Byte[St.Length];
St.Read(buffer, 0, (int)St.Length); // all the elements of the buffer are bytes with value = 0
Any help ?