Telerik Forums
Reporting Forum
1 answer
579 views

Using the HTML5 ReportViewer in MVC

Aiming at finding a way to force the whole report to display in just one long scrolling page without interfering with how it may show up when printed.

The report being displayed is in a reportbook which switches between landscape and portrait orientation and it made up of ~ 19 report/subreports.

 

What is happening is that certain page breaks are showing up that push the contents onto additional pages even though the viewer is in ViewMode.Interactive .

 

Is there a listing anywhere of what reporting elements/settings/etc may be causing these breaks even in Interactive mode?

 

Is there any way to truly force the reportviewer to have everything on only a single page? 

 

Here's the viewer code being used:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Telerik MVC HTML5 Report Viewer</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

    <link href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.common.min.css" rel="stylesheet" />
    <link href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.blueopal.min.css" rel="stylesheet" />

    <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer.kendo-11.0.17.118.min.js")"></script>

    <style>
        #reportViewer1 {
            position: relative;
            width: 1300px;
            height: 900px;
            font-family: Verdana, Arial;
        }
    </style>

    <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer-11.0.17.118.min.js")"></script>

</head>
<body>

    @(Html.TelerikReporting().ReportViewer()
        .Id("reportViewer1")
        .ServiceUrl(Url.Content("/api/reports"))
        .ReportSource(new TypeReportSource() { TypeName = "ReportLibrary1.ReportBook_Oriented, ReportLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" })
        .ViewMode(ViewMode.Interactive)
        .ScaleMode(ScaleMode.Specific)
        .Scale(1.0)

        .PersistSession(true)//NOTE: If this is False it clears the site sessions so it may no longer be used
        .PrintMode(PrintMode.AutoSelect)
    )

</body>
</html>

Nasko
Telerik team
 answered on 15 Nov 2017
3 answers
75 views

Hi,

I want to print pageHeaderSection on clicking of print button which is visibility is set to false on design time in telrik using mvc or web application VS 2010.

Katia
Telerik team
 answered on 14 Nov 2017
0 answers
137 views

Hi everyone,

I want export report to PDF and Save file windows appear when i click the button in my page. That mean i hide report viewer or don't load data on this viewer.

Because my report really lagre data with 4-5000 pages so when i load report, my report viewer show error Memmory Error and i can resolve it.

Please help me!

Noah
Top achievements
Rank 1
 asked on 14 Nov 2017
1 answer
753 views

I'm almost there. Subreport is displaying but theres no data in it. What am I doing wrong please?

Winforms. ObjectDatasource using a dataset with 2 tables, master and detail.

My report represents a paper questionnaire/Form. Master is a single row table with a person's personal details eg name, address etc. The details table is multi row and represents the questions and answers that the person filled out. The tables are linked by an ID field. Ive added the ID to the filter field. For testing purposed I've created a dummy main and multi detail records.

 

Main report designer file entries

//
 // HealthQuestionnaireDataSet
 //
 this.HealthQuestionnaireDataSet.DataMember = "MainDetail";
 this.HealthQuestionnaireDataSet.DataSource = typeof(pulse.move.datasources.datasetHealthQuestionaire);
 this.HealthQuestionnaireDataSet.Name = "HealthQuestionnaireDataSet";
//
// subReport1
//
this.subReport1.Name = "subReport1";
typeReportSource1.Parameters.Add(new Telerik.Reporting.Parameter("parmId", "= Fields.Id"));
typeReportSource1.TypeName = "pulse.move.telerik.reportlib.RptHealthQuestionnaireSubDetail, pulse.move.telerik.reportlib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
this.subReport1.ReportSource = typeReportSource1;

 

I call the following static method in the code behind of my main report to generate the report onto the ReportViewer  using the dataset passed in. This seems to work correctly. If I change the code to read "var report = new RptHealthQuestionnaireMainDetail { DataSource = dataset };" then it fails to generate. I wondered if this was the cause of my problem with the sub report not working.

public static void GenerateReport(datasetHealthQuestionaire dataset, ReportViewer viewer)
{
  viewer.CancelRendering();
  var report = new RptHealthQuestionnaireMainDetail { DataSource = dataset.maindetail };
  var reportSource = new InstanceReportSource {ReportDocument = report};
  viewer.ReportSource = reportSource;
  viewer.RefreshReport();
}

I wasn't able to get the subreport to work in the designer, so I moved the binding code to the constructor of the sub report to make it easier to debug and change.

The subreport displays the labels correctly, but there's no data. What am I missing to bind the data correctly?

public RptHealthQuestionnaireSubDetail()
{
  //
  // Required for telerik Reporting designer support
  //
  InitializeComponent();
 
  Bindings.Clear();
  // tried both of the following. Makes no difference. Still no data
  //Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.DataObject"));
  Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.Parent.Parent.DataObject"));
       
}

 

//
// RptHealthQuestionnaireSubDetail
//
// Commented out the following 2 lines and moved them to the constructor
//this.Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=ReportItem.DataObject"));
//this.DataSource = this.HealthQuestionnaireDataSource;
this.Filters.Add(new Telerik.Reporting.Filter("= Fields.Id", Telerik.Reporting.FilterOperator.Equal, "= Parameters.parmId.Value"));
this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
      this.detailSection1});
this.Name = "RptHealthQuestionnaireSubDetail";
reportParameter1.Name = "parmId";
reportParameter1.Type = Telerik.Reporting.ReportParameterType.Integer;
this.ReportParameters.Add(reportParameter1);
Todor
Telerik team
 answered on 13 Nov 2017
2 answers
340 views

I designed the my report on Telerik Reporting. When I export to Excel, something error appeared. Most of column is split as my picture. 

Someone help me to fix this error please ?

Thuan
Top achievements
Rank 1
 answered on 11 Nov 2017
2 answers
512 views
After updating to the latest version of reporting, all of my logo's that were in the top left of my reports are now scaling differently. It doesn't matter what size I set the images to or what options I set. I also tried changing the image to be the exact size it needs rather than just scale to fit. Has anyone else had a similar issue? If so any steps on how to fix it?
Katia
Telerik team
 answered on 10 Nov 2017
3 answers
158 views

I am getting the following exception when attempting to export a report from WPF Report Viewer to any format in the pull down list:

System.ArgumentNullException was unhandled by user code
  HResult=-2147467261
  Message=Value cannot be null.
Parameter name: format
  Source=mscorlib
  ParamName=format
  StackTrace:
       at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
       at System.String.Format(String format, Object arg0)
       at Telerik.ReportViewer.Wpf.ReportViewerModel.ExportReport(String format, Hashtable deviceInfo)
       at Telerik.ReportViewer.Wpf.ReportViewerModel.set_SelectedRenderingExtension(RenderingExtension value)
  InnerException:

 

I'm not sure when this started. Has anyone else seen this problem?

Thanks

Katia
Telerik team
 answered on 09 Nov 2017
5 answers
563 views

I have Web Forms report viewer ASPX and I'm trying to set a parameter "Parameter1" included in the designer like this:

     if (!IsPostBack)
            {
                int AppointmentID = Convert.ToInt16((string)Request.QueryString["AppointmentID"]);
                ReportLibrary.ClientApptInvoice rpt = new ReportLibrary.ClientApptInvoice();
                rpt.ReportParameters["Parameter1"].Value = AppointmentID;
            }

when I run the report viewer page I get "Missing or invalid parameter value" and the parameter field which is set visible appears to allow entry.

What am I missing ? I was trying to follow this - http://docs.telerik.com/reporting/designing-reports-parameters-programmatic-control

Thanks

Rod
Top achievements
Rank 1
 answered on 09 Nov 2017
2 answers
522 views
Hi

I have to bind an Object Data Source dynamically to a tablechart control dynamically i.e. not during the design time. Please let me know whether it is supported in telerik reporing. If so, pls let me know how will it be done.

Thanks in advance
Ravindra
Muhammad
Top achievements
Rank 1
 answered on 09 Nov 2017
2 answers
265 views

Hi,

Is it possible to load data from a text file to the telerik report?

Currently we have an external source of data coming from a text file. it is already formatted the way client wants to display on their end.

What we want to do is, we load the entire data to the telerik report without doing much data formatting and layout adjustment.

Is this possible on telerik reporting by setting the datasource to the textfile?

Thanks,

Dondon
Top achievements
Rank 1
 answered on 09 Nov 2017
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?