Page 1 of 2

Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Fri Aug 09, 2019 6:39 pm
by kubalak
I am in the process of evaluating of Stimulsoft Report.Web Version 2019.3.4. We are building asp.net mvc core application base on dotnet core 2.2 and serenity.is framework.

The intention is to have a dynamic set of reports which will be both designed and viewed within the application. I am trying to set up the viewer now. The URL to view a particular report should be https://localhost:5001/reports/viewer/{reportId} but as I struggled with the routing, https://localhost:5001/reports/viewer/index/{reportId} works with [Route("Reports/Viewer/[action]/{id}")] in the controller and RouteTemplate = "Reports/Viewer/{action}/{id}" in the cshtml view. As a side note: this was the only combination of Route and RouteTemplate which I managed to get working and that is in combination with ViewBag as somehow the id parameter in GetReport only gets "{id}" value. Is there a better way to do this?

But the main problem is that when I call the page, this is what I get:
The attachment Snap 2019-08-09 at 20.24.25, 1172x671.png is no longer available
After choosing the view mode to Single Page, I can see the report but I cannot scroll in it.

Here is my controller:

Code: Select all

namespace ArcheoLamia.Reports.Pages
{
    using Microsoft.AspNetCore.Mvc;
    using Serenity.Web;
    using Stimulsoft.Report;
    using Stimulsoft.Report.Mvc;
    using System.Data;

    // [PageAuthorize(typeof(Entities.ReportsRow))]
    [Route("Reports/Viewer/[action]/{id}")]
    public class ViewerController : Controller
    {

        static ViewerController()
        {
            // How to Activate
            //Stimulsoft.Base.StiLicense.Key = "6vJhGtLLLz2GNviWmUTrhSqnO...";
            //Stimulsoft.Base.StiLicense.LoadFromFile("license.key");
            //Stimulsoft.Base.StiLicense.LoadFromStream(stream);
        }
        public IActionResult Index(string id)
        {
            if (id != "undefined")
                ViewBag.Id = id;
            return View(MVC.Views.Reports.Viewer.ViewerIndex);
        }
        public IActionResult GetReport(string id)
        {
            StiReport report = new StiReport();
            report.Load(StiNetCoreHelper.MapPath(this, $"Reports/{TempData["Id"]}.mrt"));
            
            return StiNetCoreDesigner.GetReportResult(this, report);
        }
        public IActionResult ViewerEvent()
        {
            return StiNetCoreViewer.ViewerEventResult(this);
        }
    }
}
And here is the action/cshtml:

Code: Select all

@using Stimulsoft.Report.Mvc;
@using Stimulsoft.Report.Web;
@using Stimulsoft.System.Web.UI.WebControls;

@{
    ViewBag.Title = "Stimulsoft Reports.Web Demo";
    if (ViewBag.Id != null) {
        TempData["Id"]=ViewBag.Id;
    }
}

@Html.StiNetCoreViewer("StiMvcViewer1", new StiNetCoreViewerOptions()
{
    Actions =
    {
        GetReport = "GetReport",
        ViewerEvent = "ViewerEvent"
    },
    Server = 
    {
        RouteTemplate = "Reports/Viewer/{action}/{id}" 
    },
    //Localization = "Modules/Reports/cs.xml",
    Appearance =
    {
        BackgroundColor = System.Drawing.Color.FromArgb(0xe8, 0xe8, 0xe8),
        ScrollbarsMode = true
    },
    Toolbar =
    {
        DisplayMode = StiToolbarDisplayMode.Separated,  
        ShowDesignButton = false,
        ViewMode = StiWebViewMode.SinglePage
    }

})

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Mon Aug 12, 2019 4:30 pm
by kubalak
I forgot to mention that I am using OS X Mojave 10.14.6. Well I managed to get the designer and viewer working without the Route and RouteTemplate but the UNDEFINED problem with the viewer remains.

Just to be sure I am not doing something weird in my own code, I created fresh serenity demo site and added Stimulsoft viewer the simplest way I know of:

1. created a fresh site based on this: https://serenity.is/docs/getting_starte ... with-serin

2. added routes.MapRoute("default", "{controller}/{action=Index}/{id?}”); into StartUp.cs

3. In StartUp.cs, I disabled options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()); . This would be nice but will come back to it later.

4. added stimulsoft: dotnet add package Stimulsoft.Reports.Web.NetCore

5. copied folder Modules/Reports with viewer controller and cshtml and SimpleList.mrt (taken from the demo)

I started the web and after login in (admin, password serenity), put the url https://localhost:5001/viewer/index/SimpleList into the browser (Safari and Chrome) and the result is the same (when I change undefined to Simple Page, I can see the report):

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Mon Aug 12, 2019 4:34 pm
by kubalak
I tried to upload the sample project (zipped, 15 MB) but there is some server error parsing message. I am stuck, I think.

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Tue Aug 13, 2019 7:14 am
by Lech Kulikowski
Hello,

Please try to upload your sample on any file sharing service (DropBox, GoogleDrive, etc) and send us a link for downloading.

Thank you.

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Tue Aug 13, 2019 10:16 am
by kubalak
Here it is. Thank you!! Your product seems to be great and I hope we can make it working inside of the serenity.is framework.

https://wetransfer.com/downloads/46af3a ... 354/0b93d1

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Thu Aug 15, 2019 7:58 am
by Lech Kulikowski
Hello,

Please check the following screens.

Thank you.

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Thu Aug 15, 2019 1:13 pm
by kubalak
Thank you!! This is really embarrassing :) Stupid mistake.

I have one more problem. I cannot load designer either:
Snap 2019-08-15 at 15.08.13, 1083x532.png
Snap 2019-08-15 at 15.08.13, 1083x532.png (327.39 KiB) Viewed 10547 times
Controller and cshtml (renamed as txt) attached. Thank you in advanced! The report loads but then I get this timeout even when I set server timeout in the options. I hope it is not going to be something as silly as the problem above :)

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Fri Aug 16, 2019 3:03 pm
by Lech Kulikowski
Hello,

We have checked your code, also tried to set a different timeout, and couldn't reproduce the issue.

Thank you.

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Tue Aug 20, 2019 8:36 am
by kubalak
Interesting. I set up ubuntu 18.04 virtual on my os x and there is no problem with the designer there. So I wonder if it could be somehow related to os x GDI+ implementation which you seem to be using.

When I get the timeout, the web server (dotnet run) is shut down immediately without any warning or error.

I'd appreciate any thoughts.

Re: Viewer - paging undefined, view mode undefined, zoom undefined

Posted: Tue Aug 20, 2019 10:22 am
by Lech Kulikowski
Hello,

We need some time to investigate the issue with mac os. We will let you know about the result.

Thank you.