Rank: Newbie
Groups: Registered
Joined: 11/20/2017(UTC) Posts: 11 Thanks: 1 times
|
I created seal report and I integrate into MVC. I copy and past report in (Repository\Reports) folder and run my project and I got following error: Got unexpected exception: Unable to read the file 'D:\RND\SealReportDemo\Repository\Reports\Search - Orders.srex'. There was an error reflecting type 'Seal.Model.Report'. What should I do after creating report? So I need some help to integrate this report solution in my MVC solution, maybe some snippet code or some info about this it is appreciated. Edited by user Friday, November 24, 2017 6:49:21 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 11/20/2017(UTC) Posts: 11 Thanks: 1 times
|
After creating report I published report on iis and it's successfully published.
Starting Web Site Publishing... Copying files from 'C:\Program Files (x86)\Seal Report\Web' to 'C:\inetpub\wwwroot\Seal Report' Publishing Site on IIS... Web Site has been published successfully. Web Site Publishing terminated.
but when I integrate into MVC its gives the same error: Unable to read the file 'C:\ProgramData\Seal Report Repository\Reports\Dashboard - Sales.srex'. There was an error reflecting type 'Seal.Model.Report'.
my code: if (!CheckAuthentication()) return Content(_loginContent); Repository repository = Repository.CreateFast(); Report reportToExecute = Report.LoadFromFile(@"C:\ProgramData\Seal Report Repository\Reports\Dashboard - Sales.srex", repository); reportToExecute.WebExecutionGUID = Guid.NewGuid().ToString(); reportToExecute.ExecutionContext = ReportExecutionContext.WebReport; reportToExecute.SecurityContext = WebUser; reportToExecute.CurrentViewGUID = reportToExecute.ViewGUID;
//execute to output if (!string.IsNullOrEmpty(outputGUID)) { reportToExecute.OutputToExecute = reportToExecute.Outputs.FirstOrDefault(i => i.GUID == outputGUID); reportToExecute.ExecutionContext = ReportExecutionContext.WebOutput; if (reportToExecute.OutputToExecute != null) reportToExecute.CurrentViewGUID = reportToExecute.OutputToExecute.ViewGUID; }
//execute with custom view if (!string.IsNullOrEmpty(viewGUID)) reportToExecute.CurrentViewGUID = viewGUID;
ReportExecution execution = new ReportExecution() { Report = reportToExecute }; Session[reportToExecute.WebExecutionGUID] = execution; int index = Request.Url.OriginalString.ToLower().IndexOf("initexecutereport"); if (index == -1) throw new Exception("Invalid URL"); reportToExecute.WebUrl = Request.Url.OriginalString.Substring(0, index); repository.WebPublishFolder = Path.Combine(Request.PhysicalApplicationPath, "temp"); repository.WebApplicationPath = Path.Combine(Request.PhysicalApplicationPath, "bin"); if (!Directory.Exists(repository.WebPublishFolder)) Directory.CreateDirectory(repository.WebPublishFolder); FileHelper.PurgeTempDirectory(repository.WebPublishFolder);
reportToExecute.InitForExecution(); execution.RenderHTMLDisplayForViewer(); return Redirect(reportToExecute.WebTempUrl + Path.GetFileName(execution.Report.HTMLDisplayFilePath));
Error line is: Report reportToExecute = Report.LoadFromFile(@"C:\ProgramData\Seal Report Repository\Reports\Dashboard - Sales.srex", repository);
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
The error comes from the Deserialization of the report...so it is strange, you can look at the inner exception to have more detail.
check also on the web "an error reflecting type", there are a lot of answers.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 11/20/2017(UTC) Posts: 11 Thanks: 1 times
|
When I run Sample report its working fine but when I create a new report and publish the report after executing report it gives me following error: Unable to read the file 'C:\ProgramData\Seal Report Repository\Reports\Company Directory.srex'.There is an error in XML document (72, 12). Please give me any solution. Edited by user Monday, November 27, 2017 6:47:09 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 12/20/2013(UTC) Posts: 1,209 Thanks: 14 times Was thanked: 206 time(s) in 199 post(s)
|
It looks like your document has be corrupted somewhere... Check the XML generated in the file.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.