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
div  
#1 Posted : Monday, February 1, 2021 7:33:29 AM(UTC)
div

Rank: Newbie

Groups: Registered
Joined: 1/13/2021(UTC)
Posts: 0
India
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

epf  
#2 Posted : Monday, February 1, 2021 7:45:11 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)
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...
div  
#3 Posted : Tuesday, February 2, 2021 9:25:33 AM(UTC)
div

Rank: Newbie

Groups: Registered
Joined: 1/13/2021(UTC)
Posts: 0
India
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
epf  
#4 Posted : Tuesday, February 2, 2021 9:53:06 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)
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);
thanks 1 user thanked epf for this useful post.
div on 2/3/2021(UTC)
div  
#5 Posted : Wednesday, February 3, 2021 5:02:14 AM(UTC)
div

Rank: Newbie

Groups: Registered
Joined: 1/13/2021(UTC)
Posts: 0
India
Location: Chennai

Thanks: 5 times
Worked like a charm. :<):)

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