How to set ReportViewer same

1 Answer 148 Views
PictureBox Report Viewer - ASP.NET
WoorimartDEV
Top achievements
Rank 1
Iron
Iron
WoorimartDEV asked on 06 Aug 2022, 06:00 AM

[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.


1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 10 Aug 2022, 01:35 PM

Hello Doyeong,

I noticed that you have already opened a discussion about the SVG resizing issue in the forum post How to show print same with Html5Viewer?

We have recognized this as a bug and it is logged in our public feedback portal - The SVG image in a Picturebox is not rendered correctly in HTML Viewer's Preview modes.

Unfortunately, there is no other workaround than utilizing a different image format that we support.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
WoorimartDEV
Top achievements
Rank 1
Iron
Iron
commented on 11 Aug 2022, 02:38 AM

Hi, support

Thanks you for answer.

Then, I have a question.

[Report view page]

I want to show print view page, which is not the viewer, just print view page.

The page which is push the print button.

[Print view page]

tIn that case, I can show just print view not the viewer.

IIs there any way to show the only print view?

 

 

Todor
Telerik team
commented on 15 Aug 2022, 03:10 PM

If I understood correctly, you would like to see the report in the viewer in PrintPreview. If so, you need to set the viewer's option 'viewMode' to "PRINT_PREVIEW".

You may also use the Toolbar menu button 'Print Preview' that switches between Logical and Physical page renderer.

If you would like to avoid the viewer at all, you may use the approaches from the following KB articles:

Tags
PictureBox Report Viewer - ASP.NET
Asked by
WoorimartDEV
Top achievements
Rank 1
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or