Telerik Forums
Reporting Forum
1 answer
537 views

Back in 2017 version of Telerik Reporting, I could create a .NET Web API with Telerik Reports where the report viewer is a series of js files that would realize any report I gave it.

In the MVC Model I'd have code (C#) like

        public static Telerik.Reporting.TypeReportSource [Report Source Name]()
        {
            Telerik.Reporting.TypeReportSource oReportSrc = null;

            try
            {
                oReportSrc = new Telerik.Reporting.TypeReportSource();
                oReportSrc.TypeName = typeof(MyReports.[Report Name]).AssemblyQualifiedName;
            }
            catch (SystemException ex)
            {

            }

            return oReportSrc;
        }

In the MVC View (CSHTML) I would have code like

@section scripts
{
    <script src="ReportViewer/js/telerikReportViewer-[version].js"></script>
    <!--kendo.all.min.js can be used as well instead of kendo.web.min.js and kendo.mobile.min.js-->
    <script src="~/Scripts/kendo/[version]/kendo.web.min.js"></script>
}

@{
    var typeReportSource = [My App].Models.[Report Source Name] ();   
    typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("[variable name]", ViewBag..[variable name]));
}

          

@(Html.TelerikReporting().ReportViewer()
       .Id("reportViewer1")
       .ServiceUrl("/api/reports/")

       .ReportSource(typeReportSource)
       .ViewMode(ViewModes.INTERACTIVE)
       .ScaleMode(ScaleModes.SPECIFIC)
       .Scale(1.0)
       //.PersistSession(false)
       )

I'm a bit stymied by all the current examples and logic of Telerik Reporting where it all seems generic (not specific to the actual report) up until the report viewer is HTML containing javascript with hardcoded values specific to a single report (such as report: "Barcodes Report.trdp")

This is tedious and makes the product much less desirable because it (a) forces the developer to know/work with JavaScript and (b) adds an additional layer of complexity and development to every report.

I see the older style js in the install

Program Files (x86)\Progress\Telerik Reporting R2 2022\Html5\ReportViewer\js

Are the any demo/documentation on how to use what i would call the "older style" - for a Web API - where the report and properties are not hardcoded?

Al
Top achievements
Rank 1
Iron
 answered on 11 Aug 2022
0 answers
556 views

Hello everyone, 

I keep bumping into this issue that if I use conditional format to make something visible it is not working. 

So basically I have tables / texbtoxes etc. that are invisible  and they should become visible if some fields have a certain content. 

It is working if I set the box on visible and then in the condition set it to visible false but not otherwise.

I know that you can use bindings on the visibility but if there is a conditional feature it is far more simple to use that.

 

I attached an exampel - if you set the parameter to 1 or 0 either of the textboxes should be visible.

(p.s. I attached a trdx file, just renamed the ending.)

Best Regards Alex

Alexander
Top achievements
Rank 1
Veteran
 asked on 11 Aug 2022
1 answer
312 views

[ReportViewer]

[Print Preview]

[ReportViewer - When Image Picture]

[Print Preview - When Image Picture]

This is Print.cshtml code.

<style>
    #reportViewerLayout {
        position: fixed;
        left: 0px;
        right: 0px;
        top: 0px;
        bottom: 0px;
        overflow: hidden;
        font-family: 'Arial', 'Courier New';
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        $("#reportViewerLayout")
            .telerik_ReportViewer({
                // The URL of the service which will serve reports.
                // The URL corresponds to the name of the controller class (ReportsController).
                // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
                serviceUrl: "/api/reports",

                // The URL for custom report viewer template. The template can be edited -
                // new functionalities can be added and unneeded ones can be removed.
                // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
                // templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-16.1.22.511.html',

                //ReportSource - report description
                reportSource: {
                    // The report can be set to a report file name (trdx report definition)
                    // or CLR type name (report class definition).
                    report: '@Html.Raw(ViewBag.PopReportFile)',
                    parameters: {
                        ...Reportparameters
                    }
                },
                // Specifies whether the viewer is in interactive or print preview mode.
                // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
                // INTERACTIVE - Displays the report in its original width and height without paging. Additionally interactivity is enabled.
                viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,

                // Sets the scale mode of the viewer.
                // Three modes exist currently:
                // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
                // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
                // SPECIFIC - Uses the scale to zoom in and out the report.
                scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,

                // Zoom in and out the report using the scale
                // 1.0 is equal to 100%, i.e. the original size of the report
                scale: 1.0,
                enableAccessibility: false,

                //If set to true shows the Send Mail Message toolbar button
                sendEmail: { enabled: false },
            });
    });
</script>

I want to match the ReportViewer with the PrintView.
We handed over the location, size, etc. to the report parameter and confirmed that it would enter the corresponding location.
Thankfully, in the previous question (see: https://www.telerik.com/forums/how-to-stretch-in-textbox))
This is the comparison between putting the value in svg and normal image in PictureBox.
When it is an image, the ReportViewer and PrintView seem to match normally.
However, when stretching the value with svg, ReportViewer and PrintView look different.
Please help me how to set it up in order to correct that part.


Todor
Telerik team
 answered on 10 Aug 2022
1 answer
209 views

I see that a feature was added in R3 2020 to support the styling of nested lists, https://feedback.telerik.com/reporting/1356704-ordered-list-styling

How would I implement this? I have letters that load dynamic HTML content like this:

<ol>
<li>Item one. </li>
<li>Item two.<ol>
<li>Item two a. <ol>
<li>Item two i.</li>
</ol>
</li>
</ol>
</li>
<li>Item 3.</li>
</ol>

I'd need it to render like this in the body of the letter:

1. Item one.
2. Item two.
    a. Item two a.
         i. Item tow i.
3. Item 3.

I'm adding an external style sheet when the letter is generated. 

ExternalStyleSheet(System.IO.File.OpenRead($"Reports\\ReportingStyleSheet.xml"));

I'm not sure how to add these styles.

ol li ol {
    list-style-type: lower-alpha;
}
ol li ol li ol{
    list-style-type: lower-roman;
}

ul li ul {
    list-style-type: circle;
}
ul li ul li ul {
    list-style-type: square;
}

 

Thanks.

Tim Paris

 

 

 

Dimitar
Telerik team
 answered on 10 Aug 2022
0 answers
364 views

Hi, supports.

I try to run rest api report server on mac OS which  used in windows10.

But I got a error message

Error Message : 

Unable to get report parameters. An error has occurred. Type: Telerik.Reporting.ReportSerialization.Current.ReportSerializable`1[Telerik.Reporting.Report]

 

Device:  mac OS m1

[Step]

1. Check result of api/reports/forms:

result:

[{"name":"PDF","localizedName":"Acrobat (PDF) file"},{"name":"CSV","localizedName":"CSV (comma delimited)"},{"name":"XLSX","localizedName":"Excel Worksheet"},{"name":"PPTX","localizedName":"PowerPoint Presentation"},{"name":"RTF","localizedName":"Rich Text Format"},{"name":"IMAGE","localizedName":"TIFF file"},{"name":"DOCX","localizedName":"Word Document"}]

 

2. Installed the libgdiplus library. 

brew install mono-libgdiplus

result: mono-libgdiplus 6.1_1 is already installed and up-to-date.

 

When I got a message for this, I thought project occurs error. But it runs well which on windows10.

I think, I missing setup for report server on mac OS.

So, I want how I set the project to run successfully.

And, If you have sample project about rest report server which runs on macOS m1, may I get that to refer? 

 

Due to this one thing, the entire project is being delayed. Please help me.

WoorimartDEV
Top achievements
Rank 1
Iron
Iron
 asked on 08 Aug 2022
3 answers
949 views

Hi,

 

You have added the new feature in PDF Security in latest version on Telerik reporting  R3 2016.

But do not have details regarding that how to set password?

Could please send the detail how to set the password in manual rendering pdf in code. 

 

Thanks,

Senthil

Rener Lemes
Top achievements
Rank 1
Iron
 answered on 06 Aug 2022
1 answer
122 views

Hi,

I noticed on the Roadmap that the following feature is under development. 

Angular & React components based on the Web Report Designer

Is there the ability to download a nightly build?  i.e. Not production suitable but would like to use it as a proof of concept. 

Alternatively is there an ETA of when this feature lands?

Thanks

Milen | Product Manager @DX
Telerik team
 answered on 05 Aug 2022
1 answer
173 views

I have a report that needs to access files stored on Azure.

What's the best way to do this?

THanks ... Ed

 

Dimitar
Telerik team
 answered on 05 Aug 2022
1 answer
106 views

Hello,

I need generate a report where the Table of content is on the second page of it, after a "front" page.

Please advise.

Thank you.

Domenico
Top achievements
Rank 1
Iron
 answered on 04 Aug 2022
1 answer
107 views

[Html5Viewer]

[PrintButton in Html5Viewer]

[Print Preview - when clicked the print button]

[Report.cshtml]

@{
    ViewData["Title"] = "Label";
}
<style>
    #reportViewerLayout {
        position: absolute;
        left: 0px;
        right: 0px;
        top: 0px;
        bottom: 0px;
        overflow: hidden;
        font-family: Verdana, Arial;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        $("#reportViewerLayout")
            .telerik_ReportViewer({
                // The URL of the service which will serve reports.
                // The URL corresponds to the name of the controller class (ReportsController).
                // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
                serviceUrl: "/api/reports",

                // The URL for custom report viewer template. The template can be edited -
                // new functionalities can be added and unneeded ones can be removed.
                // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
                // templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate-16.1.22.511.html',

                //ReportSource - report description
                reportSource: {
                    // The report can be set to a report file name (trdx report definition)
                    // or CLR type name (report class definition).
                    report: '@Html.Raw(ViewBag.PopReportFile)',
                    parameters: {
                         ...params...
                    }
                },
                // Specifies whether the viewer is in interactive or print preview mode.
                // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
                // INTERACTIVE - Displays the report in its original width and height without paging. Additionally interactivity is enabled.
                viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,

                // Sets the scale mode of the viewer.
                // Three modes exist currently:
                // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
                // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
                // SPECIFIC - Uses the scale to zoom in and out the report.
                scaleMode: telerikReportViewer.ScaleModes.SPECIFIC,

                // Zoom in and out the report using the scale
                // 1.0 is equal to 100%, i.e. the original size of the report
                scale: 1.0,
                enableAccessibility: false,

                //If set to true shows the Send Mail Message toolbar button
                sendEmail: { enabled: false },
            });
    });
</script>

------------------------------------------------------------------------------------------------------------------------------------------------------

Hi, I have a question.

I want to show like PrintPreview screen, not like Html5Viewer screen.

The location, size, and font of each character are provided through the Report Parameter and are linked by DataBinding.

And, the words or number(like '400'), all of the same components are imageview, and the expression dialog states:

All of the same components are imageview, and the expression dialog states:

<svg>
<g>
<text font-size="25">
<tspan x="0%" y="20%" textLength="60%">TEST</tspan>		
</text>
</g>
</svg>

I change the viewMode to [viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW], or 

    var rv = $("#reportViewerLayout").data("telerik_ReportViewer");
    rv.commands.print.exec();

But nothing has changed in particularly.

How I can show the report screen like [Print Preview]?

Todor
Telerik team
 answered on 04 Aug 2022
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?