Passing Additional Parameters to Report desginer services

0 Answers 35 Views
Report Designer - Web Report Viewer - HTML5
BL360
Top achievements
Rank 1
BL360 asked on 07 Dec 2023, 07:09 AM

Hi All,

I want to pass few additional parameters from the report designer to the report service each and every request.

Following is my current code.

<script type="text/javascript">
        $(document).ready(function () {

            // For a complete overview over all the options used to initialize Web Report Designer, check:
            // https://docs.telerik.com/reporting/designing-reports/report-designer-tools/web-report-designer/web-report-designer-initialization
        $("#webReportDesigner").telerik_WebReportDesigner({
                toolboxArea: {
                    layout: "list" //Change to "grid" to display the contents of the Components area in a flow grid layout.
            },

            blpermision: {
                isJson: 'Nom'
            },

                serviceUrl: "@(basePath)reportdesigner/",
                report: "",
                skipOnboarding: true,

                // Example of passing parameters to the embedded Report Viewer used when previewing documents.
                // The example below demonstrates the currently available options.
                // reportViewerOptions: {
                //    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                //    scale: 1.0,
                //    templateUrl: "https://bluelotus360.co/ReportsAPI/api/reportdesginer/resources/templates/telerikReportViewerTemplate.html/",
                //    viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
                //    pageMode: telerikReportViewer.PageModes.CONTINUOUS_SCROLL
                //    // Further explanation about how these options effect the Report Viewer can be found at:
                //    // https://docs.telerik.com/reporting/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/api-reference/report-viewer-initialization
                // }
        }).data("telerik_WebDesigner");
        
        });
</script>

Is there a way to tap each and every request to designer services .

 

Additionally i cannot over ride certain actions in report designer services. cannot override  SaveResource endpoint. any idea ?

 


  [Route("api/reportdesigner")]
  public class ReportDesignerController : ReportDesignerControllerBase
  {
      public ReportDesignerController(IReportDesignerServiceConfiguration reportDesignerServiceConfiguration, IReportServiceConfiguration reportServiceConfiguration)
          : base(reportDesignerServiceConfiguration, reportServiceConfiguration)
      {
          var m = reportDesignerServiceConfiguration;
       //  m.DefinitionStorage = new FileDefinitionStorage("~/CSR/");


      }


      public override IActionResult CreateDocument(string clientID, string instanceID, [FromBody] CreateDocumentArgs args)
      {
          return base.CreateDocument(clientID, instanceID, args);
      }

      [HttpPost("definitionresources/save")]
  
      public override Task<IActionResult> SaveResource([FromQuery] SaveResourceModel model)
      {
          return base.SaveResource(model);
      }


  }

Dimitar
Telerik team
commented on 11 Dec 2023, 12:45 PM

Currently, there isn't an option to send additional parameters to the request of the Web Report Designer. What kind of parameters do you need to send and what is the reason for this requirement?

You seem to be trying to send a blpermision object with those parameters. The name suggests that you are trying to add logic with regards to the permissions but I am unsure exactly what you are trying to disable. Please note the Web Report Designer has an out-of-the-box support for removing permissions to its functionalities per your needs - Web Report Designer Customization - Telerik Reporting.

Regarding the overridable methods, indeed not all methods of the ReportDesignerController are virtual and thus overridable but I was able to override the SaveResource method in my test project:

   public class ReportDesignerController : ReportDesignerControllerBase
   {
       public ReportDesignerController(IReportDesignerServiceConfiguration reportDesignerServiceConfiguration, IReportServiceConfiguration reportServiceConfiguration)
           : base(reportDesignerServiceConfiguration, reportServiceConfiguration)
       {
       }

       public override Task<IActionResult> SaveResource([FromQuery] SaveResourceModel model)
       {
           return base.SaveResource(model);
       }
   }

Which methods do you need to be overridable that currently are not?

No answers yet. Maybe you can help?

Tags
Report Designer - Web Report Viewer - HTML5
Asked by
BL360
Top achievements
Rank 1
Share this question
or