HTMLExport and UnauthorizedAccessException

edited 9:49AM in FastReport .NET
There is html export from report on my website. When I try to call method Export, an UnauthorizedAccessException is thrown.

This is snapshot of my code:
FastReport.Utils.Config.WebMode = true;
Stream report = ....
FastReport.Report freport = new FastReport.Report();
freport.Load(report);
freport.Prepare();
ExportBase exporter = new FastReport.Export.Html.HTMLExport();
System.IO.MemoryStream result = new System.IO.MemoryStream();
freport.Export(exporter, result);    
freport.Dispose();

Detail of the exception:
System.UnauthorizedAccessException: Access to the path 'html.files\' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj)
at System.IO.Directory.CreateDirectory(String path)
at FastReport.Export.Html.HTMLExport.Start()
at FastReport.Export.ExportBase.Export(Report report, Stream stream)
at FastReport.Report.Export(ExportBase export, Stream stream)

Could you help me?

Thx

Comments

  • edited 9:49AM
    Hello,

    It's not possible to export to stream with HTML export because it produces many files (.css, pictures, .html for each page). You may use MHT export instead, it produces single file and can be exported to a stream.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.