Telerik Forums
Reporting Forum
1 answer
175 views
I have a report that has a report a grouping.  In that report grouping, I want to only display specific fields based on the page number. The page number is resetting for that group. However, the Items in the group header do not seem to see the page number change, so I can't use that.  I thought about using a field in the result set, but that is not either.   This is a pretty complex report, and I could use some help on this, as I don't write reports all the often.
Todor
Telerik team
 answered on 11 Jan 2023
1 answer
308 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
575 views

Hi Support team, 

Currently, Telerik reads the appsettings.json file to get the connection string. Here we have 3 different servers for DEV , staging and production environements and we also have Multiple appsettings files. see attached screenshot. 

For Code, we have already written code that for the DEV server, all configs are read from the appsettings.Dev.json file and for the staging server all configs are read from appsettings.staging.json.

 

Now, what happened when we are creating a pdf file from Dev server from Code, It read appsetting.json file for the connection string that's wrong connection string for DEV server. so, Wrong data occupied and report is not made properly.

Could you please share any solution for my issue? 
Please note that we can't edit appsetting.json file each and every time we deploy code. 

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

Hello,

I have one table and I am getting values to display from sql data source.

I am displaying only some of values using filter and grouping of data, but I am getting wrong sum as it is taking from data source.

what should I do to get sum of only displayed values.

 

Thanks in advance.

1 answer
206 views

I am trying to add HtmlTextBox to my report. After double clicking on the HtmlTextBox, instead of opening the html editor, an error message appears (0dCthJrV8O.png).
And after that it is not possible to delete any element of the report (see screenshot Telerik.ReportDesigner.Net_t7UHZP4wr4.png).

Also, after closing the editor, another error appears (see screenshot IpCUql4RY4.png).

Version: 16.2.22.1109

Dimitar
Telerik team
 answered on 28 Dec 2022
1 answer
256 views

Hi,

Arabic reports work well on Windows, but when the app is published to Docker, the report viewer shows the correct report, but when printing or exporting PDF, the report is drawn from left to right with incorrect format and layout.

Here is an example of a Docker PDF

, but this is the correct report on the Report Viewer

Todor
Telerik team
 answered on 22 Dec 2022
1 answer
132 views
I am a SixBit user and the program uses Telerik reports. I want to switch out the current subreport for another one that I made. How can I accomplish this?
Dimitar
Telerik team
 answered on 21 Dec 2022
1 answer
558 views

I have one table in sql server and I am fetching it in standalone report designer using stored procedure but I need distinct values to be displayed only.

Is there a method in standalone report designer to show only distinct values because I can't do it in sql server for some reasons.

 

Thank you in advance.

Todor
Telerik team
 answered on 21 Dec 2022
1 answer
207 views
I have a report that can potentially contain multiple pages.  I have a crosstab in the detail section that contains a total that I would like to display on only the last page of the report.  My plan was to make the grand total row of that crosstab not visible until the last page.  I know that in the footer, I would need to check PageNumber and I believe CurrentPage to see if they match to determine if its the last page.  The issue I'm having is that you can only access PageNumber from the report header and/or footer, but you cannot put a crosstab in a footer.  Is there a way to display a crosstab on only the last page?
Momchil
Telerik team
 answered on 20 Dec 2022
1 answer
287 views
How change default margins in WebDesigner? 
Dimitar
Telerik team
 answered on 16 Dec 2022
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?