Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
In other projects I have had no problems using the HTML5 Report viewer extension for MVC but I can not implement it in my current project.
The page containing the report viewer displays "loading.." in the top left corner but the report is never loaded.
I have debugged the application with Fiddler and Firebug but can see no errors.
The report service (Web API) controller is never called which is probably the root cause.
Comparing Fiddler traces between applications where reporting works and the application with the problem shows that the call
http://localhost:34639/ReportViewer/templates/telerikReportViewerTemplate.html is never made
Does anybody have any suggestions on how to debug this problem.
namespace
Reports
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.Reporting;
using Telerik.Reporting.Drawing;
/// <summary>
/// Summary description for CrossTabReport.
/// </summary>
public partial class CrossTabReport : Telerik.Reporting.Report
{
public CrossTabReport()
{
InitializeComponent();
}
}
[
DataObject]
public class CrossTabReportModel {
[
DataObjectMethod(DataObjectMethodType.Select)]
public CrossTabData getData() {
return new CrossTabData();
}
}
public class CrossTabData {
public CrossTabData() {
title =
"CROSS TAB DATA";
items =
new List<CrossTabItem>() {
new CrossTabItem { itemName = "FRED",
itemAttributes =
new List<ItemAttribute>()
{
new ItemAttribute{ attribName = "HAIR", attribValue= "BROWN"},
new ItemAttribute{ attribName = "EYES", attribValue= "BROWN"},
new ItemAttribute{ attribName = "HEIGHT", attribValue= "5'6"},
new ItemAttribute{ attribName = "WEIGHT", attribValue= "200"}
}
},
new CrossTabItem { itemName = "SAM",
itemAttributes =
new List<ItemAttribute>()
{
new ItemAttribute{ attribName = "HAIR", attribValue= "BLONDE"},
new ItemAttribute{ attribName = "EYES", attribValue= "BLUE"},
new ItemAttribute{ attribName = "HEIGHT", attribValue= "6'0"},
new ItemAttribute{ attribName = "WEIGHT", attribValue= "210"}
}
},
new CrossTabItem { itemName = "CHILLY",
itemAttributes =
new List<ItemAttribute>()
{
new ItemAttribute{ attribName = "HAIR", attribValue= "BROWN"},
new ItemAttribute{ attribName = "EYES", attribValue= "GREEN"},
new ItemAttribute{ attribName = "HEIGHT", attribValue= "5'10"},
new ItemAttribute{ attribName = "WEIGHT", attribValue= "150"}
}
}
};
}
public string title { get; set; }
public List<CrossTabItem> items { get; set; }
}
public class CrossTabItem {
public string itemName { get; set; }
public List<ItemAttribute> itemAttributes { get; set; }
}
public class ItemAttribute {
public string attribName { get; set; }
public string attribValue { get; set; }
}
}
Thanks for any help.
I have a simple report.
I want this displayed:
--------------------------------------------
Product Name 1
Product ID 1
Product 1 Feature 1
Product 1 Feature 2
Product 1 Feature 3
Product Name 2
Product ID 2
Product 2 Feature 1
Product 2 Feature 2
-------------------------------------------------------
I have the layout in a table like this (in one column):
--------------------------------------------------------
Fields.ProductName
Fields.ProductID
Fields.ProductFeature
---------------------------------------------------------
The printout is ok but how do you page break for the entire group? In other words, I want a page break after Product 1 Feature 3 and a page break after Product 2 Feature 2. I have looked everywhere. You don't have a page break for groups.
I am using a Crosstab. How do you set a page break after a Crosstab?
Can someone please tell me what is incorrect with the following code. It only fails when the TIFF is one page.
Public Sub CreateProcessNotesTIFF() Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource() instanceReportSource.ReportDocument = New ProcessNotes instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ProcNo", _procNo)) instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ApplicantName", _applicantName)) Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor() 'set any deviceInfo settings if necessary Dim deviceInfo As New System.Collections.Hashtable() deviceInfo("OutputFormat") = "TIFF" deviceInfo("TiffCompression") = "ccitt4" deviceInfo("DpiX") = 300 deviceInfo("DpiY") = 300 'deviceInfo("DpiX") = 120 'deviceInfo("DpiY") = 120 'Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo) Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("IMAGE", instanceReportSource, deviceInfo) Dim fileName As String = result.DocumentName + "." + result.Extension 'Dim path As String = System.IO.Path.GetTempPath() Dim path As String = System.IO.Directory.GetCurrentDirectory() Dim filePath As String = System.IO.Path.Combine(path, fileName) Using fs As New System.IO.FileStream(filePath, System.IO.FileMode.Create) fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length) End UsingEnd SubPublic Sub CreateProcessNotesTIFF() Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource() instanceReportSource.ReportDocument = New ProcessNotes instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ProcNo", _procNo)) instanceReportSource.Parameters.Add(New Telerik.Reporting.Parameter("ApplicantName", _applicantName)) Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor() 'set any deviceInfo settings if necessary Dim deviceInfo As New System.Collections.Hashtable() deviceInfo("OutputFormat") = "TIFF" 'deviceInfo("TiffCompression") = "ccitt4" deviceInfo("DpiX") = 300 deviceInfo("DpiY") = 300 'deviceInfo("DpiX") = 120 'deviceInfo("DpiY") = 120 'Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo) Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("IMAGE", instanceReportSource, deviceInfo) Dim fileName As String = result.DocumentName + "." + result.Extension 'Dim path As String = System.IO.Path.GetTempPath() Dim path As String = System.IO.Directory.GetCurrentDirectory() Dim filePath As String = System.IO.Path.Combine(path, fileName) Using fs As New System.IO.FileStream(filePath, System.IO.FileMode.Create) fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length) End UsingEnd Sub