Rank: Newbie
Groups: Registered
Joined: 1/13/2021(UTC) Posts: 0 Location: Chennai Thanks: 5 times
|
I'm integrating the seal reports with my demo website, where i load the already created seal report(BikeStore.srex). When i execute the seal report, It generate the HTML file output. I want to use this html output in <Iframe> to show charts on homepage(localhost). Issue - This HTML output is generated in random location ( C:/Users/I01810/AppData/Local/Temp/_Seal_Report.Temp/BikeStore87.html) I want to generate this HTML output in website home location(that is accessed by localhost). Please help. Below is my current code Repository repository = Repository.Create(); Report report = Report.LoadFromFile(@"C:\ProgramData\Seal Report Repository\Reports\BikeStore.srex", repository); ReportExecution execution = new ReportExecution() { Report = report }; execution.Execute(); while (report.IsExecuting) System.Threading.Thread.Sleep(100); string result = execution.GenerateHTMLResult(); string currentDirectory = HostingEnvironment.ApplicationPhysicalPath; if (File.Exists(result)) { string result1 = Path.GetFileName(result); //getting .html file name Dashboard_Iframe.Attributes.Add("src", result1); // passing htmlfile name to Iframe src } Edited by user Monday, February 1, 2021 7:34:18 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)
|
you have several options: you can recopy the result file in another fixed location, you can create a report output on a folder with a fixed file name, then just execute the output...
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/13/2021(UTC) Posts: 0 Location: Chennai Thanks: 5 times
|
I tried what you said, but it's not working, The codeline whiche generate the html output always create temp result.
string result = execution.GenerateHTMLResult();
Above code is internally calling method and creating the unique file name in unique location every time,
so even if i run below code, It don't set the output directory or path.
report.HTMLDisplayFilePath = currentDirectory+ @"\BikeStore.html"; <= don't work or report.ResultFilePath = @"C:\Users\I01810\source\repos\MyGradeSheet_10thGrade\"; <= don't work
Regards, Divyesh
|
|
|
|
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 result will always be generated in Temp, then it can be copied... so the simplest for you is: Code:string result = execution.GenerateHTMLResult();
System.IO.File.Copy(result, aNewFilePath);
|
1 user thanked epf for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/13/2021(UTC) Posts: 0 Location: Chennai Thanks: 5 times
|
Worked like a charm. :<):)
Thanks
|
|
|
|
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.