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
Ben_B  
#1 Posted : Tuesday, December 6, 2016 6:29:58 AM(UTC)
Ben_B

Rank: Newbie

Groups: Registered
Joined: 12/6/2016(UTC)
Posts: 4
China
Location: jiangsu

Hi
I am using sealreport in my project but I have a problom now.
Quote:

Repository repository = Repository.Create();
Report report = Report.LoadFromFile(@"C:\ProgramData\Seal Report Repository\Reports\Dashboard - Sales.srex", repository);
ReportExecution execution = new ReportExecution() { Report = report };
execution.Execute();
while (report.Status != ReportStatus.Executed) System.Threading.Thread.Sleep(100);
string result = execution.GenerateHTMLResult();
Process.Start(result);


When I use this code above, the restrictions are all missing,I want to know how can i display the restrictions by codes or setting something in the designer?

thanks!
epf  
#2 Posted : Tuesday, December 6, 2016 8:58:49 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 can configure the parameters of the main view (defined in Report.config.cshtml configuration template file) like this:

Code:
report.ExecutionView.GetParameter("information_button").BoolValue = true;


Here are some othe parameters you can configure:
Code:
   //Parameters for this template
    Template.Parameters.Add(new Parameter() { Name = "report_description", Type = ViewParameterType.Text, DisplayName = "Report description", Description = "A report description displayed in the information panel" });
    Template.Parameters.Add(new Parameter() { Name = "restriction_button", DisplayName = "Show restrictions", BoolValue = true, Description = "If true, show the restriction panel if the report has prompted restrictions" });
    Template.Parameters.Add(new Parameter() { Name = "information_button", DisplayName = "Show report information", BoolValue = false, Description = "If true, show the report execution information panel" });
    Template.Parameters.Add(new Parameter() { Name = "message_button", DisplayName = "Show execution messages", BoolValue = false, Description = "If true, show the report execution messages panel" });
    Template.Parameters.Add(new Parameter() { Name = "result_button", DisplayName = "Show view results panel", BoolValue = false, Description = "If true, show the view results panel" });
    Template.Parameters.Add(new Parameter() { Name = "converter_button", DisplayName = "Show converter buttons in view results panel", BoolValue = true, Description = "If true, the PDF and Excel converter buttons are displayed" });
    Template.Parameters.Add(new Parameter() { Name = "display_messages", DisplayName = "Display execution messages panel and button", BoolValue = true, Description = "If true, the execution messages button and panel is displayed" });
    Template.Parameters.Add(new Parameter() { Name = "force_execution", DisplayName = "Force execution", BoolValue = false, Description = "If true, force the report to be executed directly the first time even if some restrictions are prompted" });
Ben_B  
#3 Posted : Wednesday, December 7, 2016 2:09:13 AM(UTC)
Ben_B

Rank: Newbie

Groups: Registered
Joined: 12/6/2016(UTC)
Posts: 4
China
Location: jiangsu

Thanks for your reply.
I found that it has been set already:

Template.Parameters.Add(new Parameter() { Name = "restriction_button", DisplayName = "Show restrictions", BoolValue = true, Description = "If true, show the restriction panel if the report has prompted restrictions" });
But it does not work.

What I want:
1. When the user click the button on my web page,then the "seal report view" popup,then the user can click "view HTML result" or "view print result" etc.
2. Or when the user click the button , the HTML result popup immediately and the restrictions panel still be there?
How can I solve this by code or do some settings ?
Hope to get your reply.
Best regards!!
vicry21  
#4 Posted : Wednesday, December 7, 2016 5:41:10 AM(UTC)
vicry21

Rank: Member

Groups: Registered
Joined: 11/10/2016(UTC)
Posts: 14
China
Location: 江苏

Thanks: 2 times
Hi Ben,

你也是江苏的啊 ,方便留下一个联系方式吗?一起讨论下问题。我的QQ214361138
Ali  
#5 Posted : Wednesday, December 7, 2016 7:01:33 AM(UTC)
Ali

Rank: Newbie

Groups: Registered
Joined: 5/27/2016(UTC)
Posts: 1
Saudi Arabia
Location: Dubai

Thanks: 1 times
include the "/views" folder that contains the cshtml files.
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.