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
Ott  
#1 Posted : Wednesday, June 13, 2018 2:43:54 PM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
I need to convert localtime to utc time for any date parameters used by a report. This can be done from a pre-load script in the report designer. However we are using the Seal web server and pre-load scripts are not available in the web client. I would like to define a script at the table level in Seal Server Manager to alter any date restriction dates used to run any reports accessing this table. If this is not do-able is there a way to update the date values entered as parameters before a report is executed in a Seal Web Server environment.
epf  
#2 Posted : Thursday, June 14, 2018 5:59:17 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)
Pre-load scripts are normally executed by the Web Report Server. But you can not edit them with the Web Report Designer (the interface is simple).
Did you try to use the global 'Init Script' property:
Server Manager -> Configuration -> Configure Server... -> Init Script
You might do you job here.
Ott  
#3 Posted : Monday, June 18, 2018 11:56:20 AM(UTC)
Ott

Rank: Member

Groups: Registered
Joined: 6/9/2017(UTC)
Posts: 29
Canada

Thanks: 1 times
The init script works great for restrictions before you run the report. I need to modify the date ( add utc offset ) after the reports has executed in the web server. Where is the best place to write a C# script to modify the report data after it's been loaded but before it's displayed.
epf  
#4 Posted : Tuesday, June 19, 2018 11:37:46 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)
Yes, you might be able to use the 'Pre Load Script' of your model.

Did you consider to define the pre load script...using the init script, or do what you want for your report (e.g. always creating a task).

Here is the sample of Init Script (define in Server Manager -> Configuration -> Configure Server...) to modify your models:

Code:
@using Seal.Model
@using System.Data
@{
    Report report = Model;
	ReportExecutionLog log = Model;

	foreach (var model in report.Models) {
		model.PreLoadScript = @"@using Seal.Model 
		....DO YOU WORK HERE
		";
	}
}
thanks 1 user thanked epf for this useful post.
Ott on 6/19/2018(UTC)
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.