Telerik Forums
Reporting Forum
1 answer
26 views

I created a report using Telerik Report Designer Standalone with sqlDataSource1 setup with the following ReportParameters like this:



C# coded that read that send the parameter as Int32

    var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
    // set any deviceInfo settings if necessary
    var deviceInfo = new System.Collections.Hashtable();
    var reportSource = new Telerik.Reporting.UriReportSource();
    var directory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
    var value = Convert.ToInt32(numericExportarPdf.Value);
    reportSource.Uri = "Report.trdp";
    reportSource.Parameters.Add("NRO_TICKET", value);
    Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, deviceInfo);
    if (result.HasErrors) return;
    string fileName = result.DocumentName + "." + result.Extension;
    string path = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
    string filePath = Path.Combine(path, fileName);
    using FileStream fs = new FileStream(filePath, FileMode.Create);
    fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);

I get the following error:

Telerik.Reporting.Processing.CancelProcessingException: An error has occurred while processing the report. Processing canceled. Check the InnerException for more information.
 ---> System.Exception: Invalid value of report parameter 'NRO_TICKET'.
   --- End of inner exception stack trace ---
   at Telerik.Reporting.Processing.Report.ValidateParameters()
   at Telerik.Reporting.Processing.Report.ProcessItem()
   at Telerik.Reporting.Processing.ReportItemBase.ProcessElement()
   at Telerik.Reporting.Processing.Report.ProcessElement()
   at Telerik.Reporting.Processing.ProcessingElement.Process(IDataMember dataContext)
   at Telerik.Reporting.Processing.Report.Process(Boolean processItemActions, Boolean documentMapEnabled)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessReport(Report report, IPathResolver pathResolver, IProcessingContext parentContext, IEnumerable`1 parameters, Key rootKey, Boolean interactivityEnabled, Boolean documentMapEnabled, PageLayoutInfo pageSettings, ErrorEventHandler errorHandler, List`1 documentNodes, Boolean& documentMapAvailable)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessResolvedReports(ResolvedReportDocument resolvedReportDocument, IList`1 parameters, IProcessingContext contextPerDocument, Boolean interactivityEnabled, Boolean documentMapEnabled, PageLayoutInfo pageSettings, List`1 processedReports, ErrorEventHandler errorHandler, List`1 documentNodes, Boolean& documentMapAvailable, ListSlice& tocReportsSlice)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(ReportSource reportSource, IRenderingContext context)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessReportSource(ReportSource reportSource, Hashtable deviceInfo, IRenderingContext context)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRender(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.ProcessAndRenderStateless(String format, ReportSource reportSource, Hashtable deviceInfo, IRenderingContext renderingContext, CreateStream createStreamCallback)
   at Telerik.Reporting.Processing.ReportProcessor.<>c__DisplayClass47_0.<RenderReport>b__0(SingleStreamManager sm)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReportSafe(Func`2 renderCallback, String format, IRenderingContext renderingContext)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo, CancellationToken cancellationToken)
   at Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, ReportSource reportSource, Hashtable deviceInfo)

If I remove the parameter the report works fine, I added changing to Decimal Type value as my DB engine is MS-SQL 2022 Express. I added filters and get same error. I don't know what to do anymore What I am missing

1 answer
153 views

Hello,

I've created a report in standalone report designer with custom function. And saved it in trdp format.

I added a custom function and connected the assembly as described in this manual.

In the report editor, I see my function and use it, however when I try to use this report for printing, my function becomes unavailable.

public class BaseReportBook<TModel> : ReportBook, IDisposable
{
    public virtual byte[] CreatePdf(TModel model, ReportTypeEnum reportType)
    {
        var reportPackager = new ReportPackager();
        using var sourceStream = File.OpenRead(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Reports", reportType.GetDescription()));
        var report = (Telerik.Reporting.Report)reportPackager.UnpackageDocument(sourceStream);

        report.ItemDataBinding += new EventHandler((sender, e) => Report_ItemDataBinding(sender, e, model));
        InstanceReportSource reportSource = new InstanceReportSource();
        reportSource.ReportDocument = report;
        ReportSources.Add(reportSource);

        ReportProcessor reportProcessor = new ReportProcessor();
        var instanceReport = new InstanceReportSource();
        instanceReport.ReportDocument = this;
        RenderingResult result = reportProcessor.RenderReport("PDF", instanceReport, null);

        if (result.Errors.Length > 0)
            throw new Exception(string.Join("\r\nError: ", result.Errors.Select(s => s.Message)));
        return result.DocumentBytes;
    }

    private void Report_ItemDataBinding(object sender, EventArgs e, TModel model)
    {
        Telerik.Reporting.Processing.Report item = (Telerik.Reporting.Processing.Report)sender;
        item.DataSource = model;
    }

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
        GC.SuppressFinalize(this);
        GC.Collect();
    }
}
reportType.GetDescription() returns the name of the report (e.g. test.trdp)

 

The report is successfully generated, but it does not see my function. Although they are in the same assembly.


When viewing the preview in the editor, the function works:

 

Here is the function itself:

public static class CustomFunctions
{
    [Function(Category = "Images", Namespace = "Extension", Description = "Images")]
    public static Image GetLogo() => new Bitmap(Properties.Resources.logo);
}


Dimitar
Telerik team
 answered on 29 Dec 2022
1 answer
323 views

I want to create a report which includes one section (likes multi-column report) and another section (like one -column report), more detail on the attached file.

After researching, I haven't found the solution yet.

So Could Telerik builds this kind of report??

Thanks!

Dimitar
Telerik team
 answered on 24 Aug 2022
1 answer
118 views

Dear Sir

i have a  Net 5  Blazor app with Server and Client how to add blazor reporting with this scenario? 

actually how to apply this example  with balzor page and blazor report viewer 

https://docs.telerik.com/reporting/embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/how-to-use-html5-report-viewer-in-an-asp.net-core-in-.net-5-application

0 answers
103 views

Hi Team ,

After updating version of Telerik assemblies, Itemdatabound event[I have attached one screenshot for reference (its written in .vb file)]  is getting called while creating report as well while printing report. but I don't want it to get called while I am printing report. Is there any way that I can set autopostback(in telerik report) to false in telerik report ? Or any other solution will be appreciated to call Itemdatabound event only while creating report and not while printing.

Anyone can help me ? 

Kind regards, 

Payal

1 answer
780 views

Hello,

I'm using the Reporting Tool with an Angular Frontend and have a question how the authentication works.
The report is created with the standalone ReportDesigner and contains one SubReport.

In the frontend the authentication token is assigned:
<tr-viewer 
...
    [authenticationToken]="authenticationToken"
</tr-viewer>

In the Designer a 2-step authentication is configured - only for design purpose.

The desired behaviour is that the authenticationToken assigned in the frontend is used when accessing the backend controller. But the observed behaviour is that the report requests multiple times (3) new tokens by calling the login URL assigned to the 2-step authentication config. 

How can I configure the Report so that no new tokens are requested and the one assigned on the frontend is used (via Bearer xxxx). Nevertheless the Controller Entry-Point for data retrieval for the report dataSource must be protected. And what is the report auth behaviour by design?

Todor
Telerik team
 answered on 04 Feb 2022
0 answers
59 views

Hi, 

I am using telerik embedded angular with standalone telerik reporting.

I am editing using the standalone telerik and then attach it to the visual studio, then display it on angular.

However,  every time I edit design in the standalone telerik, I need to reattach it to the visual studio everytime.

Can someone guide me on how to make all the edits in the standalone telerik is autoupdated into the visual studio as well as angular?

Thank you.

Azman
Top achievements
Rank 1
 asked on 11 Jan 2022
1 answer
710 views

Hi,

I have a problem when I  try to print report in controller. The thing is; it is working locally but when I deploy the project to iss I am getting error message says; "System.InvalidOperationException: No or invalid printer error on IIS server."


// Obtain the settings of the default printer
                System.Drawing.Printing.PrinterSettings printerSettings
                    = new System.Drawing.Printing.PrinterSettings();

                // The standard print controller comes with no UI
                System.Drawing.Printing.PrintController standardPrintController =
                    new System.Drawing.Printing.StandardPrintController();

                // Print the report using the custom print controller
                Telerik.Reporting.Processing.ReportProcessor reportProcessor
                    = new Telerik.Reporting.Processing.ReportProcessor();

                reportProcessor.PrintController = standardPrintController;

                    Telerik.Reporting.TypeReportSource typeReportSource =
                        new Telerik.Reporting.TypeReportSource();

                    //// reportName is the Assembly Qualified Name of the report
                    //typeReportSource.TypeName = reportName;

                // Create a new report source pointing to report definition
                var reportSource = new UriReportSource();
                reportSource.Uri = entity.ReportName;



                foreach (var i in entity.Parameters)
                {
                    reportSource.Parameters.Add(new Parameter(i.Key, i.Value));
                }


                    reportProcessor.PrintReport(reportSource, printerSettings);                    

                return null;

 

Please suggest,

Thanks

1 answer
497 views

We use the Report Designer to design a report that we want to access through the browser.
Does the Telerik Report service support Linux installation? What if I could include a link in my reply?

 


Eric R | Senior Technical Support Engineer
Telerik team
 answered on 23 Jun 2021
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?