Telerik Forums
Reporting Forum
1 answer
107 views

I am creating a reporting application for a client that does not use the designer but rather a table based report that allows for drilling in.  I am using the HTML5 MVC and I have a working report in my website that displays the Sample Report.trdx.

 

What I need is a way to pass in a report ID to the page and have the ability to generate a data source that gives the user interactive access to all the metrics that are behind the data.

 

I have searched through the documentation and I am a little confused how I can get my data into a format that the Telerik Reporting can use and how exactly to pass it to the report control (I assume through the ReportSource field).

 

        @(Html.TelerikReporting().ReportViewer()
            // Each report viewer must have an id - it will be used by the initialization script
            // to find the element and initialize the report viewer.
            .Id("reportViewer1")
            // 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(Url.Content("/api/reports/"))
            // The URL for the 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(Url.Content("/ReportViewer/templates/telerikReportViewerTemplate-9.2.15.1126.html"))
            // Strongly typed ReportSource - TypeReportSource or UriReportSource.
            .ReportSource(new UriReportSource() {Uri = "SampleReport.trdx"})
            //.ReportSource(Model)
            //.ReportSource("73", new Dictionary<string, object>() { { "parameter1", "value1" }, { "parameter2", "value2" } })
            // Specifies whether the viewer is in interactive or print preview mode.
            // PrintPreview - 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 with no paging. Additionally interactivity is enabled.
            .ViewMode(ViewMode.Interactive)
            // Sets the scale mode of the viewer.
            // Three modes exist currently:
            // FitPage - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
            // FitPageWidth - 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(ScaleMode.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)
            // Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback).
            // The session is stored in the browser’s sessionStorage and is available for the duration of the page session.
            .PersistSession(false)
            // Sets the print mode of the viewer.
            .PrintMode(PrintMode.AutoSelect)
        )

Where can I find an example on how to figure out what I want to do?

 

Thanks,

--Jeff

Nasko
Telerik team
 answered on 10 Dec 2015
1 answer
140 views
I'm still new to Telerik's Reporting tools - I've only spent about a day playing around with the trial. I've currently got a WinForms application that was using Active Reports before with TeeChart for my charting control.  Active Reports has a "CustomControl" control that can be added to the reports, which lets you put any custom control there and basically allows me to put my chart on the report (rather than using the built in charting that came with Active Reports). I was wondering if there is a similar method that Telerik's reports have that could allow me to use TeeChart in my report. Thanks in advanced!
Nasko
Telerik team
 answered on 09 Dec 2015
1 answer
224 views

Hello,

I want to change the width of columns of a CrossTable depending of the bound data. I know how to change the columns but I do not know at what time I can do that. My report gets its data via object data source set from outside of the report as my following code shows:

01.var reportModel = new MainReportModel()
02.{
03.    Orders = _GetOrders()
04.};
05. 
06.ObjectDataSource objectDataSource = new ObjectDataSource();
07.objectDataSource.DataSource = reportModel;
08. 
09.var report = new Report1();
10.report.DataSource = objectDataSource;
11.  
12.InstanceReportSource instanceReportSource = new InstanceReportSource();
13.instanceReportSource.ReportDocument = report;
14.  
15.ReportProcessor reportProcessor = new ReportProcessor();
16.RenderingResult renderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, null);
17.  
18.File.WriteAllBytes("test.pdf", renderingResult.DocumentBytes);

 

For design time I added an ObjectDataSource of type Order to the CrossTable. So I can use the expression designer for example. For render time I added a binding to my CrossTable to bind DataSource to the Orders property of MainReportModel.

Where can I hook into the process to get the bound data and change the CrossTable columns?

Greetings from Germany,

Tobias

Stef
Telerik team
 answered on 08 Dec 2015
1 answer
1.2K+ views

Dears,

 I'm new to telerik reporting tools, after I walk through the tutorials and the demos I've keep getting the following error message when trying to view the report : No HTTP resource was found that matches the request URI 'http://localhost:28480/api/reports/formats'.  although I've registered the api route in the global.asax

ReportsControllerConfiguration.RegisterRoutes(GlobalConfiguration.Configuration);

my report controller class :

 using System.IO;
    using System.Web;
    using Telerik.Reporting.Cache.File;
    using Telerik.Reporting.Services;
    using Telerik.Reporting.Services.Engine;
    using Telerik.Reporting.Services.WebApi;

    public class ReportsController : ReportsControllerBase
    {
        static Telerik.Reporting.Services.ReportServiceConfiguration configurationInstance =
    new Telerik.Reporting.Services.ReportServiceConfiguration
    {
        HostAppId = "Application1",
        ReportResolver = new ReportFileResolver(HttpContext.Current.Server.MapPath("~/Reports"))
            .AddFallbackResolver(new ReportTypeResolver()),
        Storage = new Telerik.Reporting.Cache.File.FileStorage(),
    };

        public ReportsController()
        {
            this.ReportServiceConfiguration = configurationInstance;
        }

    }

 

 I'm using asp.net MVC 5 , and web api assemblies are already referenced , I have many web api controllers in the project that are working properly.

please advise.

Nasko
Telerik team
 answered on 08 Dec 2015
1 answer
335 views

DEAR *.*

How to Pass value on a report using querystring.

I created a webform1.aspx with textbox control and a button control, and my second form is webform2.aspx with a reportviewer control,

 

my questions :
How to pass the value on my textbox control in the webform1.aspx when i clicked the button to webform2.aspx using QueryString?

i'm using vb code..

 

please help

Nasko
Telerik team
 answered on 08 Dec 2015
1 answer
339 views

I have partial view:

@section head
{
    <script src="~/ReportViewer/js/telerikReportViewer-8.1.14.804.js"></script>
    <script src="~/ReportViewer/js/resources.hr-HR.js"></script>
    <link href="~/ReportViewer/styles/telerikReportViewer-8.1.14.804.css" rel="stylesheet" />
    <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css"
          rel="stylesheet">
    <style>
        #reportViewer1 {
            position: absolute;
            left: 15px;
            right: 15px;
            top: 65px;
            bottom: 50px;
            overflow: hidden;
        }
    </style>
}
 
@{
    var typeReportSource = new TypeReportSource() { TypeName = string.Format("ATICRaspored.Reports.{0}, ATICRaspored", ViewBag.ReportName) };
    typeReportSource.Parameters.Add("PredavacId", new Guid(((ClaimsIdentity)User.Identity).FindFirst("PredavacId").Value));
    typeReportSource.Parameters.Add("AkGodId", ViewBag.AkGodId);
    typeReportSource.Parameters.Add("AkGodNaziv", ViewBag.AkGodNaziv);
}
 
@(
 Html.TelerikReporting().ReportViewer()
  .Id("reportViewer1")
  .ServiceUrl("/api/reports/")
  .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html"))
  .ReportSource(typeReportSource)
  .ViewMode(ViewModes.PRINT_PREVIEW)
  .ScaleMode(ScaleModes.SPECIFIC)
  .Scale(1)
  .PrintMode(PrintMode.AutoSelect)
)

On button click I need to show my partial view inside kendo window. My code is:

@(Html.Kendo().Window().Name("ReportViewer")
    .Title("Izvještaj!")
    .Visible(false)
    .Modal(true)
    .Draggable(true)
    .Resizable(x => x.Enabled(true))
    .Width(800)
    .Height(800))
 
<script>
    $("#btnReportKolegij").click(function () {
        var site = site || {};
        site.baseUrl = site.baseUrl || "";
 
        var wnd = $("#ReportViewer").data("kendoWindow");
        wnd.refresh(site.baseUrl + "/Home/_ReportContainer/" + '@Model.Id' + "/" + '@Model.GodineMerge.Replace('/', '-')' + "/EvidencijaOdrzaneNastaveKolegij").center().open();
    });
</script>

 

On click my window is opened but it's only showing "Loading..." as you can see on the attached image. Without kendo window and with simple view everything is working.

What am I missing?

Thanks

Nasko
Telerik team
 answered on 08 Dec 2015
1 answer
279 views

Hello Telerik team,

    I want to know is there a possible way to render List box instead of drop down for my report parameters. I am getting by default is a drop down list.

Also please tell me if i can have my report parameters as vertically on right side instead on the header horizontally.

 If it is not possible in Report designer (Standalone) then tell me what are my options to achieve it.

 Thank You

Nasko
Telerik team
 answered on 07 Dec 2015
1 answer
361 views

Hello all,

 i have a huge database in Oracle. I cant load it fully in the Standalone Designer. To set up filtering and so on, i try to limit the rows i receive from the DB.

Normally in Oracle, i use ROWNUM to limit the results:

SELECT * FROM HUGEDB WHERE ROWNUM < 100

 When i use exact the same query in ReportDesigner, i get: ORA-00904 - "ROWNUM" invalid identifier.

It seems, that the ReportDesigner add some quotation marks around ROWNUM. How can i turn that off?

Or is there another way to limit the number of returned rows?

 

Thanks,

Tobias

Tobias
Top achievements
Rank 1
 answered on 04 Dec 2015
1 answer
102 views
I am using the default ASP.NET WebApi ReportsControllerConfiguration.RegisterRoutes to the GlobalConfiguration.Configuration, and when I attempt to unregister my client with the clientId I receive a '405 Method Not Allowed'. Since I am using the default setup I was wondering if there are any known issues, or if I need to override everything and create my own endpoints to bypass this error?
Stef
Telerik team
 answered on 04 Dec 2015
5 answers
179 views
Hello Telerik-Team, Hello everone else ;)

I've got a Intel i5-2500 CPU in my development system. This CPU has 4 cores.

When the report viewer is rendering a report, it's only using max. 25% of the CPU capacity. So it seems that Telerik Reporting is running as a single thread which can only use one of my 4 CPU cores / 25% of the CPU capacity (delegated to every core doing a small amount of the 25%). See the attached jpg for a Task Manager screenshot.

Is there any way to let Telerik Reporting use the full power of the CPU? This would mean cutting down the rendering time to a quarter of the current.

Kind Regards,
Michael
Projects Computerra
Top achievements
Rank 1
 answered on 04 Dec 2015
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?