Telerik Forums
Reporting Forum
1 answer
16 views

I'm trying to build a custom report generator using the web report designer. all the data sources will be web service data sources.

now I need to impose restrictions for using the already created data sources/reports based on the logged-in user privileges.

1. How can I restrict some users from using certain Shared Data sources or accessing specific reports that are created based on their user rights? 

2. how can I get a list of all the web service data sources created programmatically?

 

 

 
1 answer
23 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
30 views

Hello,

can I disable Expressions on a TextBox? I am using Telerik Reporting in a C# Project.

I have a TextBox in my Report that has its value set to a string in the Reports code. If the string starts with an "=", the entire string is treated as an expression and is calculated in the rendered Report. Is there a way to display the raw text in the Report TextBox with a "=" at the start and without any calculations applied?

Addind Quotation marks to the string in C# code does not seem to work, as it now adds these Quotation marks to the rendered TextBox.

Thanks.

Niklas
Top achievements
Rank 1
Iron
 answered on 11 Jan 2024
1 answer
81 views

Currently, we use SSRS in our ASP.NET MVC apps to automatically generate tabular, in-memory reports based on RDLC templates against SQL Server data. The PDF produced by SSRS are downloaded to the user's browser. We don't provide any report viewer components on the page. How do you do this using Telerik Reporting?

Also, do you have beginner training videos for Telerik Reporting?

Thank you.

Dimitar
Telerik team
 answered on 26 Dec 2023
1 answer
53 views

Dear Team,

 

We have to evaluate an old project which uses Telerik Reporting Version Q3.2020. The task is to migrate and update older asp.net and Windows forms reports to newer report version.

 

Can you please share the link to download the Trial version of Telerik Report Version Q3.2020?

Thank you,

Anup

Lance | Senior Manager Technical Support
Telerik team
 answered on 22 Sep 2023
1 answer
33 views
buen dia, necesito ayuda, quiero programar un boton para que telerik me mande un reporte periódicamente, pero no se como hacerlo ayudenme porfavor 😞
Dimitar
Telerik team
 answered on 23 Aug 2023
1 answer
77 views

We have a custom report screen that uses multiple reporting frameworks to render reports as files (typically Excel). The available reports are loaded dynamically at runtime, the user picks a report which retrieves and displays the report parameters for the users to enter values, and then the report can be rendered to the file type that they choose.

We will be creating single reports (.trdp files) and report books (.trbp files) and uploading those onto the server for use with this screen. We are currently using the R1 2023 Reporting framework. Our application is written in c# and uses .NET Framework 4.8.

I have almost everything working with the Telerik framework but cannot find anywhere to create a ReportBook object from a .trbp file. The closest I found was this forum post (https://www.telerik.com/forums/reportbook-by-path-name)and this article on Deserializing from XML (https://docs.telerik.com/reporting/embedding-reports/program-the-report-definition/serialize-report-definition-in-xml). This does not work and I assume things have totally changed given the post was over 10 years old.

Using the code below gives the exception "Data at the root level is invalid. Line 1, position 1." The .trbp file that we are attempting to load was designed using the Telerik Standalone Report Designer.

var reportBook = new Telerik.Reporting.ReportBook();

using (System.IO.FileStream stream = new System.IO.FileStream(reportPath, System.IO.FileMode.Open))
{
    Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();                    
    reportBook = (Telerik.Reporting.ReportBook)xmlSerializer.Deserialize(stream);
}

Is it possible to load a .trbp file into a ReportBook object? If so, how?

Thanks,

Jason

1 answer
160 views

Hai,

I am spending hours and hours trying to get a simple Telerik Report to work in my Blazor web app.
All documentation on the website is for ASP.Net Core 6 and the ASP.Core 7 samples I can find, do not work for me...

I have a simple Blazor Web App that communicates with a Blazor Server using controllers and endpoints like. The data is stored in a SQL Server.

I have a table 'Genders' and I simply want to show a report with the fields id and name of table genders using the 'api/gender' endpoint to get the genders: 

var response = await httpDefaultClient.GetAsync("api/gender");
        if (response.IsSuccessStatusCode)
        {
            genderList = await response.Content.ReadFromJsonAsync<List<GenderModel>>();
        }

Is there a complete walkthough, thus including creating the Telerik report itself, creating the reportcontroller, in the server, adding services etc.

I am totally new to Telerik and I simply do not understand how to implement Telerik in my application.
Hope somebody can direct me to a good, working, sample or walkthrough... 

Regards, Marc

1 answer
43 views

I've got two reports, one of which is a copy of the other.  The original report prints successfully.  The copy will print but only if the "Go" button is pressed on the printer.  How can I set the copy to not require the "Go" button?  Is it a setting in Properties?  I see no differences between the two reports.

I'm using version 16.1.22.622 of report dll's.  Visual Studio 2019.

The printer is an HP LaserJet P2015.

By the way, the copy will print without intervention on a HP LaserJet P2055dn. 

 

Thanks for your help or advice.

R.D. Henry and Co.
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 06 Apr 2023
2 answers
77 views

Currently, I have two different parameters. One uses Fields.ID the other needs to use Field.ID2 However, using the code below. I am unable to rename ID to ID2. If I use ID It modifies Parameter1's ID field instead of Parameter2's ID field. I need to use dual union to be able to select all employees but when I run it with the "AS" command for renaming ID to ID2 it errors out(see below code). If I run it without the dual union. It works and renames ID to ID2. But, then I do not have the ability to select all employees which I need. How can I fix this in the report designer? is there a better way or am I using my code wrong, what would be a good solution to this?

 

How can I get this to work and rename ID to ID2 for the second source using the code below so that I can still use the dual union?

 

[Doesn't work]

SELECT TO_NCHAR('All Employees') AS FirstName, TO_NCHAR('*') AS LastName, 0 AS ID FROM DUAL
UNION
select FirstName, LastName, ID AS ID2

FROM Personnel
ORDER BY LastName NULLS FIRST

 

[Works]

select FirstName, LastName, ID AS ID2

FROM Personnel
ORDER BY LastName NULLS FIRST

 

 

Thank you!

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?