public object GetReportDesignerModel(string reportUrl) { string modelJsonScript = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices) .GetJsonModelScript(reportUrl, null, "/DXXRD", "/DXXRDV", "/DXQB"); return(new JavaScriptSerializer().Deserialize <object>(modelJsonScript)); }
public ActionResult GetReportDesignerModel(string reportUrl) { string modelJsonScript = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices) .GetJsonModelScript( reportUrl, // The URL of a report that is opened in the Report Designer when the application starts. GetAvailableDataSources(), // Available data sources in the Report Designer that can be added to reports. "DXXRD", // The URI path of the default controller that processes requests from the Report Designer. "DXXRDV", // The URI path of the default controller that that processes requests from the Web Document Viewer. "DXXQB" // The URI path of the default controller that processes requests from the Query Builder. ); return(Content(modelJsonScript, "application/json")); }
public object GetReportDesignerModel([FromForm] string reportUrl) { Dictionary <string, object> dataSources = new Dictionary <string, object>(); SqlDataSource ds = new SqlDataSource("SevenR"); // Create a SQL query to access the Products data table. SelectQuery query = SelectQueryFluentBuilder.AddTable("GN_EMPRE").SelectAllColumnsFromTable().Build("GN_EMPRE"); ds.Queries.Add(query); ds.RebuildResultSchema(); dataSources.Add("Northwind", ds); string modelJsonScript = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices).GetJsonModelScript(reportUrl, dataSources, "/DXXRD", "/DXXRDV", "/DXXQB"); return(new JavaScriptSerializer().Deserialize <object>(modelJsonScript)); }
public ActionResult GetReportDesignerModel(string reportUrl) { Response.AppendHeader("Access-Control-Allow-Origin", "*"); string modelJsonScript = new ReportDesignerClientSideModelGenerator() .GetJsonModelScript( reportUrl, // The URL of a report that is opened in the Report Designer when the application starts. GetAvailableDataSources(), // Available data sources in the Report Designer that can be added to reports. "ReportDesigner/Invoke", // The URI path of the controller action that processes requests from the Report Designer. "WebDocumentViewer/Invoke", // The URI path of the controller action that processes requests from the Web Document Viewer. "QueryBuilder/Invoke" // The URI path of the controller action that processes requests from the Query Builder. ); return(Content(modelJsonScript, "application/json")); }
public ActionResult PostReportDesignerModel([FromForm] DesignerModelRequest request) { var info = _reportGeneratorService.GetReportInfoFromUrl(request.ReportUrl); if (info.Mode != ReportMode.Edit) { throw new System.Exception("This endpoint can only be called from designer (edit mode)"); } string modelJsonScript = new ReportDesignerClientSideModelGenerator(HttpContext.RequestServices) .GetJsonModelScript( request.ReportUrl, // The URL of a report that is opened in the Report Designer when the application starts. _reportGeneratorService.GetDataSourcesForTemplate(info.PrintType, info.CustomerId.Value, info.LanguageId), // Available data sources in the Report Designer that can be added to reports. "DXXRD", // The URI path of the default controller that processes requests from the Report Designer. "DXXRDV", // The URI path of the default controller that that processes requests from the Web Document Viewer. "DXXQB" // The URI path of the default controller that processes requests from the Query Builder. ); return(Content(modelJsonScript, "application/json")); }