Viewer - paging undefined, view mode undefined, zoom undefined

Stimulsoft Reports.WEB discussion
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

Viewer - paging undefined, view mode undefined, zoom undefined

Post 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
    }

})
Attachments
Snap 2019-08-09 at 20.24.25, 1172x671.png
Snap 2019-08-09 at 20.24.25, 1172x671.png (86.23 KiB) Viewed 9046 times
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

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

Post 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):
Attachments
Snap 2019-08-12 at 18.29.12, 1280x314.png
Snap 2019-08-12 at 18.29.12, 1280x314.png (89.52 KiB) Viewed 9027 times
Last edited by kubalak on Mon Aug 12, 2019 4:34 pm, edited 1 time in total.
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

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

Post 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.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

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

Post 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.
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

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

Post 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
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

Please check the following screens.

Thank you.
Attachments
photo_2019-08-15_09-57-12.jpg
photo_2019-08-15_09-57-12.jpg (55.35 KiB) Viewed 8991 times
photo_2019-08-15_09-57-07.jpg
photo_2019-08-15_09-57-07.jpg (44.91 KiB) Viewed 8991 times
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

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

Post 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 8988 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 :)
Attachments
DesignerIndex.txt
(423 Bytes) Downloaded 114 times
DesignerPages.cs
(1.66 KiB) Downloaded 139 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

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

Thank you.
Attachments
photo_2019-08-16_17-03-08.jpg
photo_2019-08-16_17-03-08.jpg (100.38 KiB) Viewed 8972 times
kubalak
Posts: 17
Joined: Fri Aug 09, 2019 4:22 pm

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

Post 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.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

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

Post 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.
Post Reply