Telerik Forums
Reporting Forum
1 answer
415 views

Dear supporting team,

 

First of all, I apologize for the typo in the title. I can't fix it

I used Telerik reporting to design the report. 

But I was facing a problem. I can not or don't know how to get the session value or cookie value in the ASP.NET Core Web App project.

The way I do it is:

  • Create a new report by Report Designer
  • Create an HTML page, and add the following code

 

    <script type="text/javascript">
        $(document).ready(function () {
            var au = document.cookie.split('=');
            var uname = au[1];

            var urlParams = new URLSearchParams(window.location.search);
            var rp = urlParams.get('r');
            $("#reportViewer1")
            
                .telerik_ReportViewer({
                    
		    serviceUrl: "/api/reports",
                    reportSource: {
                        report: "INV_ADJUSTMENT_DETAIL.trdx",
                        parameters: { user_name: uname, report: rp }
                    },
                    viewMode: telerikReportViewer.ViewModes.INTERACTIVE,
                    scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,
                    scale: 1.0,
                    enableAccessibility: false,
                    sendEmail: { enabled: false },
                    ready: function () {
                    },
                });
        });
    </script>

 

And in the Program.cs

.....
builder.Services.TryAddSingleton<IReportServiceConfiguration>(sp => new ReportServiceConfiguration
{
	ReportingEngineConfiguration = sp.GetService<IConfiguration>(),
	HostAppId = "Html5ReportViewerDemo",
    Storage = new FileStorage(),
	ReportSourceResolver = new CustomReportSourceResolver()
});

builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddHttpContextAccessor();
builder.Services.AddDistributedMemoryCache();
builder.Services.AddSession(session =>
{
	session.IdleTimeout = TimeSpan.FromMinutes(60);
	session.Cookie.HttpOnly = true;
	session.Cookie.IsEssential = true;
});
.....


In the report designer, how can I use the value in reportSource -> parameters?

Is there a possible solution for this? please help advise.

Visual Studio version: Microsoft Visual Studio Professional 2022

Framework: .Net 6.0

Telerik packages:

  • Telerik.Reporting v.17.0.23.315; 
  • Telerik.Reporting.OpenXmlRendering v.17.0.23.315;
  • Telerik.Reporting.Services.AspNetCore 17.0.23.315

    Many thanks,

    Dinh Phong

     


    Dimitar
    Telerik team
     answered on 09 Aug 2023
    1 answer
    459 views

    Hello

    First of all, I apologize for the wrong title. I can't fix it
    It's about print preview, not html5viewer.

    I was going to edit it, but the title isn't working. I'm sorry.

    I'm currently using Kendo Report for my company internal project.
    It consists of ASPNET CORE MVC, and if requested by the user, it is displayed in html5 viewer.
    I installed the font on the server where the Report Server is located and saw it as an html5 viewer because I had to change the font in a specific project, but the font was not recognized normally.
    It's actually a font called HY GunGothic, and it's automatically changed to MalgunGothic.
    I installed the HY GyunGothic font on the computer on the corresponding Report Server and even rebooted it, but the result was the same.

    In the second way, I thought that using private fonts can apply the font regardless of whether the font is on the Host Machine or not,
    I modified the web.config file of the project as follows.

    [web.config]

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <Telerik.Reporting>
        <privateFonts>
          <add fontFamily="NanumSquareRoundEB" path="~/Fonts/NanumSquareRoundEB.ttf" fontStyle="Regular"/>
        </privateFonts>
      </Telerik.Reporting>
      <system.webServer>
        <handlers>
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
        </handlers>
        <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="InProcess" />
      </system.webServer>
    </configuration>

     

    and create the StyleSheet.css file at the root of the project
    I did the following.

    [StyleSheet.css]

    body {
    }

    @font-face {
        font-family: 'NanumSquareRoundEB';
        src: url('Fonts/NanumSquareRoundEB.ttf');
    }

     

    Also, the cshtml file in Views is as follows.

    [Print.cshtml]

    @{
        ViewData["Title"] = "POP PRINT";
    }
    <style>
        #reportViewerLayout {
            position: fixed;
            left: 0px;
            right: 0px;
            top: 0px;
            bottom: 0px;
            overflow: hidden;
            font-family: 'Arial';
        }
    </style>
    <link href="~/StyleSheet.css" rel="stylesheet" />
    <div id="reportViewerLoading">
        Loading...        
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#reportViewerLayout")
                .telerik_ReportViewer({

    ...

    However, the result is that the font is broken as follows.
    It came out normally in ReportDesigner, but strangely, it comes out like that in Html5Viewer.

    [In ReportDesigner]

    I thought it was a broken phenomenon (in my case, it's Korean) in a specific language, so I changed it to English and did it again, but the font is not applied anymore.

    [Report Preview in Html5Viewer]

    [Print Preview in Html5Viewer]

    So here's the summary.

    1. ReportServer installed and booted a font file on a computer distributed with IIS, but the font was applied by replacing it with Malgun Gothic, the default Korean font for Windows, instead of the Nanum Square RoundEB font for .trdp
    2. The font file was inserted into the project by applying private fonts, but in English, the font is applied by changing to Malgun Gothic, the basic Korean font in Windows, and the letters are broken when used in Korean
    3. And for now, it looks normal on html5viewer, but I don't know why print preview is different.
    I saved it as a pdf file just in case, but the letters are saved in the same broken form.


    I bought a license and am using it now, is there any additional part I need to buy to use the font?
    I'm taking a lot of time to solve that part.

    If there is a sample project that customizes the font of the Telerik Report among the ASP NET CORE projects, please let me know.


     

    1 answer
    169 views

    I have a chart with a bar series and a line series, where I would like the line series to form a cumulative % of the total.

    My data set is a list of records with an "Injury Type" field, and the bar series counts the instances of each injury type

    The line series is a calculation of the count of instances of that type divided by the total count of the graph.

    What I would like instead, is to have a cumulative % of the line so that at the end it would = 100% like a Paredo chart would

    Screenshot attached

    Momchil
    Telerik team
     answered on 07 Aug 2023
    1 answer
    301 views

    I just migrated from building with react-scripts to vite, as it seems react-scripts is deprecated. After the change, the react report viewer is not functioning correctly. Browser console shows:

    Instantiation of Kendo TreeView as Document Map threw an exception TypeError: $kendoHtmlEncode is not a function

    Uncaught (in promise) TypeError: $kendoHtmlEncode is not a function

    I did some investigating and it seems that window.kendo has no properties/functions defined like it did before. Is there a possible work around for this?

    EDIT: using version 19.23.718

    EDIT2: For now, I've shifted to using the Html5 report viewer as described here: https://github.com/telerik/reporting-docs/blob/master/knowledge-base/how-to-use-html5-viewer-in-react-js.md

    Dimitar
    Telerik team
     answered on 07 Aug 2023
    1 answer
    109 views
    Hi All,

    I am facing an issue with creating data source for store procedure which is returning multiple table in response,
    not able to retrive all tables, currently I am getting only first table .

    please suggest any method to solve this.

    thanks in advance
    Jayesh Idnani
    0 answers
    186 views

    Hi,
    for more than one year my VS2019 sometimes, but repeatedly, crashed. Today I had enough and peeked into it. Surprisingly, at least my recent crashes are caused by Telerik Nuget package:


    Aplikace: devenv.exe
    Verze Framework: v4.0.30319
    Popis: Proces byl ukončen z důvodu neošetřené výjimky.
    Informace o výjimce: System.ArgumentNullException
       na System.Linq.Enumerable.Where[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>, System.Func`2<System.__Canon,Boolean>)
       na Telerik.VSX.NuGet.NuGetPackageService+<GetInstalledPackageAsync>d__16.MoveNext()
       na System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
       na System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
       na Telerik.VSX.ProjectWrappers.NugetPackageBasedProjectWrap+<GetMainPackageAsync>d__19.MoveNext()
       na System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
       na System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
       na Telerik.VSX.ProjectListing.NugetPackageProjectSearcherBase+<FilterTelerikProjectsAsync>d__7.MoveNext()
       na System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
       na System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
       na Telerik.VSX.ProjectListing.NugetPackageProjectSearcherBase+<GetTelerikEnabledProjectsAsync>d__8.MoveNext()
       na System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
       na System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
       na Telerik.VSX.Tracking.NuGetPackageBasedProductUsedTracker+<TrackAsync>d__8.MoveNext()
       na System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
       na System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
       na Telerik.VSX.Tracking.NuGetPackageBasedProductUsedTracker+<Session_TimeFrameElapsedAsync>d__14.MoveNext()
       na System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1(System.Object)
       na System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
       na System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       na System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
       na System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
       na System.Threading.ThreadPoolWorkQueue.Dispatch()
       na System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

    VS version: 16.11.33920.266

    Telerik packages: Progress Telerik UI for WPF 2023.2.714.61, Telerik Reporting Tools 3.44.11.0

     

    Keeps crashing at idle time mostly. It had never crashed during my work, only during idle times of VS.

    Matt
    Top achievements
    Rank 1
     asked on 04 Aug 2023
    1 answer
    268 views

    Telerik Reporting R3 2022 SP1 running with a ASP.Net MVC project(.Net 4.8), in Visual Studio 2022.

    I was able to generate reports smoothly till yesterday. I could make changes in the Visual Studio designer and restart my MVC project and see changes quickly. From today I am seeing the report generation gets stuck at :

    *** ReportProcessor.ProcessReport STARTED ***

    This is the line:

    RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);

    If I restart the system, and run my MVC project then it generates reports. However if I stop the project and re-run it, it gets stuck at the above line. And no matter what I do this error does not go away. 

    I have reinstalled Telerik Reporting but no success.

    How can I find out where its getting stuck? Can I make the Telerik Reporting print some useful debugging lines in the Output tab?

    This project has been working for over a year now in many systems, so its really surprising.

    Here is the top of the stack after control goes into Telerik:

     	[Managed to Native Transition]	
     	mscorlib.dll!Microsoft.Win32.Win32Native.SafeCreateFile(string lpFileName, int dwDesiredAccess, System.IO.FileShare dwShareMode, Microsoft.Win32.Win32Native.SECURITY_ATTRIBUTES securityAttrs, System.IO.FileMode dwCreationDisposition, int dwFlagsAndAttributes, System.IntPtr hTemplateFile)	Unknown
     	mscorlib.dll!System.IO.FileStream.Init(string path, System.IO.FileMode mode, System.IO.FileAccess access, int rights, bool useRights, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options, Microsoft.Win32.Win32Native.SECURITY_ATTRIBUTES secAttrs, string msgPath, bool bFromProxy, bool useLongPath, bool checkHost)	Unknown
     	mscorlib.dll!System.IO.FileStream.FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.SQLite.SQLiteLibraryLoader.ExtractAndLoadLibrary(string lib, string appDataPath, bool versioned)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.SQLite.SQLiteConnection.Initialize(string appDataPath)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.InitializeSQLite(string path)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.CreateProcessingContext(Telerik.Reporting.Processing.IRenderingContext context)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(Telerik.Reporting.ReportSource reportSource, Telerik.Reporting.Processing.IRenderingContext context)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(Telerik.Reporting.ReportSource reportSource, System.Collections.Hashtable deviceInfo, Telerik.Reporting.Processing.IRenderingContext context)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(string format, Telerik.Reporting.ReportSource reportSource, System.Collections.Hashtable deviceInfo, Telerik.Reporting.Processing.IRenderingContext renderingContext, Telerik.Reporting.Processing.CreateStream createStreamCallback)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(string format, Telerik.Reporting.ReportSource reportSource, System.Collections.Hashtable deviceInfo, Telerik.Reporting.Processing.IRenderingContext renderingContext, Telerik.Reporting.Processing.CreateStream createStreamCallback)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.RenderReport.AnonymousMethod__0(Telerik.Reporting.Processing.SingleStreamManager sm)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.RenderReportSafe(System.Func<Telerik.Reporting.Processing.SingleStreamManager, bool> renderCallback, string format, Telerik.Reporting.Processing.IRenderingContext renderingContext)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.RenderReport(string format, Telerik.Reporting.ReportSource reportSource, System.Collections.Hashtable deviceInfo, System.Threading.CancellationToken cancellationToken)	Unknown
     	Telerik.Reporting.dll!Telerik.Reporting.Processing.ReportProcessor.RenderReport(string format, Telerik.Reporting.ReportSource reportSource, System.Collections.Hashtable deviceInfo)	Unknown
    
     
    Nikolay
    Telerik team
     answered on 03 Aug 2023
    1 answer
    158 views
    How to set JsondataSource.Source value in Angular while Telerik report rendering report through telerik-angular-report-viewer. I tried to assign data through reportSource its not working.
    Todor
    Telerik team
     answered on 02 Aug 2023
    2 answers
    285 views

    Hi, I have master report with subreport (Report Source set as XML Markup). Everything works fine when I preview it on Report Designer, but after import file to our app I have data only from master report. In subreport section I have error:

    An error has occurred while processing SubReport 'subReportDetails':
    Unable to establish a connection to the database. Please verify that your connection string is valid. In case you use a named connection string from
    the application configuration file, make sure the name is correct and the connection string settings are present in the configuration file of your
    application.
    ------------- InnerException -------------
    Initialization string format is out of specification starting at index 0.

    It works when I save login data for report but I don't want to save passwords in XML expression.

    I wanted to try Assign connection string dynamically using report parameter and bindings - Telerik Reporting, but I don't know how to pass connection string from master report to subreport.

    1 answer
    82 views
    Hi, is there any way to access the filters used in the report viewer from a button outside the report viewer?
    Ralitsa
    Telerik team
     answered on 01 Aug 2023
    Top users last month
    Edmond
    Top achievements
    Rank 1
    Iron
    fabrizio
    Top achievements
    Rank 2
    Iron
    Veteran
    RobMarz
    Top achievements
    Rank 2
    Iron
    Fakhrul
    Top achievements
    Rank 1
    Iron
    Tejas
    Top achievements
    Rank 2
    Iron
    Iron
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?