logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jones  
#1 Posted : Tuesday, March 24, 2020 4:13:20 AM(UTC)
Jones

Rank: Newbie

Groups: Registered
Joined: 3/24/2020(UTC)
Posts: 1
United Kingdom
Location: London

When I am trying to integrate the reports in Visual studio using c#,MVC.

public ActionResult About()
{
ViewBag.Message = "Your application description page.";


Repository repository = Repository.Create();
Report report = Report.LoadFromFile(@"C:\ProgramData\Seal Report Repository\Reports\Customers.srex", repository);
ReportExecution execution = new ReportExecution() { Report = report };
execution.Execute();
while (report.IsExecuting)
{
System.Threading.Thread.Sleep(100);
}
string resultPath = execution.GenerateHTMLResult();
Process.Start(resultPath);

return View();
}

After calling the execution.Execute() its throwing error like "Unable to find view template named Report".

Please let me know how to fix it.
epf  
#2 Posted : Tuesday, March 24, 2020 7:38:51 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
This is because the repository folder is incorrect or not installed (here the file Views\Report.cshtml is missing).
Normally by default, it should be in 'C:\ProgramData\Seal Report Repository' however if you compile the source code in debug mode, it tries to find the repository beside a parent folder in order to use the repository of the project.

Check the code in public static Repository Create() (Repository.cs).

For production/release the repository path is specified in the .config file, so for the web.config:
Code:
  <applicationSettings>
    <Seal.Properties.Settings>
      <setting name="RepositoryPath" serializeAs="String">
        <value />
      </setting>
    </Seal.Properties.Settings>
  </applicationSettings>



Users browsing this topic
Guest (4)
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.