Current filter:
                                You should refresh the page.
                                  • Hi,

                                    When I wrote this report using Winforms I could assign a DisplayName to a report which showed up on the printer queue .

                                    Now this report has been upgraded to use MVC WebDocumentViewer . the printer queue shows (DXXRDV.axd).

                                    How can I display the report name on the printer queue using xtrareport/MVC?

                                    See attached images for more information.

                                    Thanks

                                    Girard Good

                                • Girard Good (Telethon Kids Institute) 08.13.2019

                                  Second image.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello,
                                Due to the specifics of its printing mechanism, Web Document Viewer takes the name of the HTTP Handler Module that is used to communicate with the server. I suggest that you implement a custom IWebDocumentViewerExportResultUriGenerator service to generate a more readable and user-friendly URI. Please refer to the example I attached. The name of the HTTP Handler specified in the IWebDocumentViewerExportResultUriGenerator.CreateUri method (in this example, 'GetReportForPrintExport'), will be used as the name of the print job.

                                [C#]
                                public class ExportedDocumentService : IWebDocumentViewerExportResultUriGenerator { public string CreateUri(string exportOperationId, ExportedDocument exportedDocument) { HttpContext.Current.Session[exportOperationId] = exportedDocument; return "GetReportForPrintExport?exportOperationId=" + exportOperationId; } } ... public class HomeController : Controller { ... [HttpGet] public ActionResult GetReportForPrintExport(string exportOperationId) { ExportedDocument exportedDocument = Session[exportOperationId] as ExportedDocument; if (exportedDocument == null) { return new HttpNotFoundResult("Exported document was not found. Try to export the document once again."); } var fileResult = File(exportedDocument.Bytes, exportedDocument.ContentType); if (exportedDocument.ContentDisposition != System.Net.Mime.DispositionTypeNames.Inline) { fileResult.FileDownloadName = exportedDocument.FileName; } Session[exportOperationId] = null; return fileResult; } ... } Global.asax.cs: public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { ... DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Required; var exportedDocumentService = new ExportedDocumentService(); DefaultWebDocumentViewerContainer.RegisterSingleton<IWebDocumentViewerExportResultUriGenerator>(exportedDocumentService); ...

                                Please try this solution and let me know if it works for you.

                                By the way, would you mind if I make this ticket public? I can remove your attachments for your convenience.

                                Thanks

                                • Girard Good (Telethon Kids Institute) 08.19.2019

                                  Hi Janet,

                                  You can make this ticket public.

                                  Will try your suggested solution and let you know.

                                  Thanks

                                  Girard Good

                                • Girard Good (Telethon Kids Institute) 08.19.2019

                                  Hi Janet,

                                  I can run the dxSample ok. But I can't get it to work with my Application. I get an exception error in Gloabl.asax.
                                  Cannot register the 'DevExpress.XtraReports.Web.WebDocumentViewer.IWebDocumentViewerExportResultUriGenerator' service in the current service provider.

                                  Have a look at the image I have attached. You see each tab has by a new title in preview mode.
                                  When I print I want something like Print -  RPT-001 (Newly Diagnosed Patients List) on the tab and print page title.
                                  It will change with each report (1-38), instead of the static GetReportForPrintExport.

                                  Thanks

                                  ... Girard

                                • Girard Good (Telethon Kids Institute) 08.19.2019

                                  dxSample output.

                                • Girard Good (Telethon Kids Institute) 08.20.2019

                                  Hi Janet,

                                  I get the following error.

                                  Any suggestions?

                                  … Girard Good

                                  ---------------------------
                                  Microsoft Visual Studio
                                  ---------------------------
                                  An exception has been encountered. This may be caused by an extension.
                                  System.NotSupportedException occurred
                                    HResult=0x80131515
                                    Message=Cannot register the 'DevExpress.XtraReports.Web.WebDocumentViewer.IWebDocumentViewerExportResultUriGenerator' service in the current service provider.
                                    Source=<Cannot evaluate the exception source>
                                    StackTrace:
                                  <Cannot evaluate the exception stack trace>

                                  GLOBAL.ASAX
                                  using System;
                                  using System.Collections.Generic;
                                  using System.Linq;
                                  using System.IO;
                                  using System.Web;
                                  using System.Web.Http;
                                  using System.Web.Mvc;
                                  using System.Web.Routing;

                                  using DevExpress.Web.Mvc;
                                  using DevExpress.XtraReports.Web.WebDocumentViewer;
                                  using WANdiab.Reports.Services;

                                     publicclassMvcApplication : System.Web.HttpApplication {
                                         protectedvoid Application_Start() {
                                              DevExpress.XtraReports.Web.WebDocumentViewer.Native.WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.Required;
                                             AreaRegistration.RegisterAllAreas();

                                             GlobalConfiguration.Configure(WebApiConfig.Register);
                                             FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
                                             RouteConfig.RegisterRoutes(RouteTable.Routes);

                                              ModelBinders.Binders.DefaultBinder = new DevExpress.Web.Mvc.DevExpressEditorsBinder();

                                              DevExpress.Web.ASPxWebControl.CallbackError += Application_Error;
                                              DevExpress.Web.Mvc.MVCxWebDocumentViewer.StaticInitialize();
                                             var exportedDocumentService =newExportedDocumentService();
                                             DefaultWebDocumentViewerContainer.RegisterSingleton<IWebDocumentViewerExportResultUriGenerator>(exportedDocumentService);
                                          }

                                         protectedvoid Application_Error(object sender, EventArgs e) {
                                             Exception exception = System.Web.HttpContext.Current.Server.GetLastError();
                                             //TODO: Handle Exception
                                          }
                                      }

                                • Yaroslav (DevExpress Support) 08.20.2019

                                  Hi,
                                  All services registration that you do must be accomplished prior to calling the MVCxWebDocumentViewer.StaticInitialize method (compare your code with Jannet's Global.asax.cs file). Try reordering the corresponding code lines and let us know if it resolves the issue for you.
                                  We look forward to your results.

                                  Regards,
                                  Yaroslav