Hi everyone,
We have several problems when we run reports in Linux environment.
1. The main problem is related Style and ExternalStyleSheets. Look at the picture below to see differences:
In windows environment (pic#1) report header part (report name, company name) shows correctly and style & external style sheets applied. BUT, in Linux environment (pic#2) it shows incorrectly, style is not applied. There are issues with text position (aligned to left), font size and other font properties.
2. Another issue is in Linux some texts are wrapped:
3. We also cannot create table programmatically. Since when we create a table programmatically, we trying to set properties like Font, Size.
See attached file to compare 2 pdf files of sample report which were exported in Windows and Linux.
We are planning to use our app in Linux and our project based on .NET6. How do you suggest to avoid those issues in Linux?
We recently started receiving complaints from clients who have been creating increasingly large reports, in the area of 50,000 to 75,000 records. In order to rule out our data, I created a test report using the same code we have to create our actual reports, but only create data from a POCO class. When running this test report, the output from RenderReport is extremely fast for record sets under a few thousand rows, but becomes very slow for record sets 50,000 to 75,000 rows. With our data, a 75,000 record report will take over an hour. Here are the times observed processing CSV and PDF report types with the test data and code below:
1000: *** Render Report #0 DONE in 00:00:00.1581774 ***
5000: *** Render Report #0 DONE in 00:00:02.6023945 ***
10000: *** Render Report #0 DONE in 00:00:11.0991098 ***
50000: *** Render Report #0 DONE in 00:10:20.2986525 ***
75000: *** Render Report #0 DONE in 00:21:37.1953330 ***
Here is the code I am using to run the tests. Please advise if there is a better alternative, but please keep in mind that this code currently ties into our user interface to produce a variety of different report types. Thanks for any insight.
private Table _MainTable;
private Unit PageWidth = new Unit(11, UnitType.Inch);
private Unit PageHeight = new Unit(8.5, UnitType.Inch);
private Unit ItemHeight = new Unit(.25, UnitType.Inch);
private Unit TenPointFont = new Unit(10, UnitType.Point);
private Unit TableWidth;
public class TestReportObject
{
public int? RowID { get; set; }
public string Description { get; set; }
public string LongDescription { get; set; }
}
private void AddTestColumn(int colIndex, string header, string fieldName, Unit colWidth)
{
TableGroup tableGroupColumn = new TableGroup();
_MainTable.ColumnGroups.Add(tableGroupColumn);
_MainTable.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(colWidth));
Telerik.Reporting.TextBox columnHeaderTextBox;
Telerik.Reporting.TextBox cellTextBox;
columnHeaderTextBox = new Telerik.Reporting.TextBox();
columnHeaderTextBox.Style.BackgroundColor = Color.LemonChiffon;
columnHeaderTextBox.Style.BorderStyle.Default = BorderType.Solid;
string name = header;
columnHeaderTextBox.Value = name;
columnHeaderTextBox.Name = name;
columnHeaderTextBox.Size = new SizeU(colWidth, ItemHeight);
columnHeaderTextBox.Style.Font.Size = TenPointFont;
columnHeaderTextBox.Style.TextAlign = HorizontalAlign.Center;
tableGroupColumn.ReportItem = columnHeaderTextBox;
columnHeaderTextBox.TextWrap = true;
columnHeaderTextBox.Height = ItemHeight;
_MainTable.Items.Add((ReportItemBase)columnHeaderTextBox);
cellTextBox = new Telerik.Reporting.TextBox();
cellTextBox.Style.BorderColor.Default = Color.Black;
cellTextBox.Style.BorderStyle.Default = BorderType.Solid;
cellTextBox.Value = $"=Fields.{fieldName}";
cellTextBox.Name = name;
cellTextBox.Size = new SizeU(colWidth, ItemHeight);
cellTextBox.Style.TextAlign = HorizontalAlign.Left;
cellTextBox.Style.Font.Size = TenPointFont;
cellTextBox.Style.VerticalAlign = VerticalAlign.Middle;
cellTextBox.Height = ItemHeight;
cellTextBox.TextWrap = true;
_MainTable.Body.SetCellContent(0, colIndex, cellTextBox);
}
private Telerik.Reporting.Report BuildTestReport()
{
Telerik.Reporting.Report TestReport = new Report();
#region page settings (making the assumption of landscaped 8.5 x 11 paper)
TestReport.PageSettings.Landscape = true;
TestReport.PageSettings.PaperSize = new SizeU(PageWidth, PageHeight);
double BottomMarginSize = ExportParameters.BottomMargin == null ? .5 : ExportParameters.BottomMargin.Value;
TestReport.PageSettings.Margins.Bottom = new Unit(BottomMarginSize, UnitType.Inch);
double LeftMarginSize = ExportParameters.LeftMargin == null ? 1 : ExportParameters.LeftMargin.Value;
TestReport.PageSettings.Margins.Left = new Unit(LeftMarginSize, UnitType.Inch);
double RightMarginSize = ExportParameters.RightMargin == null ? 1 : ExportParameters.RightMargin.Value;
TestReport.PageSettings.Margins.Right = new Unit(RightMarginSize, UnitType.Inch);
double TopMarginSize = ExportParameters.TopMargin == null ? .5 : ExportParameters.TopMargin.Value;
TestReport.PageSettings.Margins.Top = new Unit(TopMarginSize, UnitType.Inch);
TableWidth = PageWidth - (new Unit(LeftMarginSize + RightMarginSize, UnitType.Inch));
#endregion
Unit remainingPageWidth = TableWidth;
Unit fullTableWidth = new Unit(11, UnitType.Inch);
_MainTable = new Table();
_MainTable.Location = new PointU(new Unit(0, UnitType.Inch), new Unit(0, UnitType.Inch));
_MainTable.Size = new SizeU(fullTableWidth, ItemHeight);
// Body
DetailSection ExportDetail = new DetailSection();
int RowCountTotal = 50000;
var rowList = new List<TestReportObject>();
for (int rows = 0; rows < RowCountTotal; rows++)
{
var reportObj = new TestReportObject();
reportObj.RowID = rows;
reportObj.Description = $"Row {rows}";
reportObj.LongDescription = $"This is the long description for row {rows}";
rowList.Add(reportObj);
}
_MainTable.DataSource = rowList;
_MainTable.Style.VerticalAlign = VerticalAlign.Middle;
_MainTable.ColumnHeadersPrintOnEveryPage = true;
_MainTable.Name = "mainTable";
// default grouping has to be added to allow data to appear
Telerik.Reporting.TableGroup tableGroup = new Telerik.Reporting.TableGroup();
tableGroup.Groupings.AddRange(new Telerik.Reporting.Grouping[] { new Telerik.Reporting.Grouping("") });
tableGroup.Name = "DetailGroup";
_MainTable.RowGroups.Add(tableGroup);
#region Define columns and cells within the main table
Unit theColumnWidth = _MainTable.Width / 3; // number of columns
AddTestColumn(0, "Row ID", "RowID", theColumnWidth);
AddTestColumn(1, "Description", "Description", theColumnWidth);
AddTestColumn(2, "Long Description", "LongDescription", theColumnWidth);
#endregion
ExportDetail.Items.AddRange(new ReportItemBase[] { _MainTable });
TestReport.Items.Add((ReportItemBase)ExportDetail);
return TestReport;
}
/// <summary>
/// Generates the bytes of the export file
/// </summary>
private byte[] ExportBytes()
{
Report rpt = BuildTestReport();
InstanceReportSource rptSource = new InstanceReportSource();
rptSource.ReportDocument = rpt;
using (new ContextScope(new Hashtable()))
{
Hashtable deviceInfo = new Hashtable();
deviceInfo["FontEmbedding"] = "Subset";
Telerik.Reporting.Processing.ReportProcessor RP = new Telerik.Reporting.Processing.ReportProcessor();
// ExportFileTypeString is UI selection, pdf, csv, etc.
byte[] buffer = RP.RenderReport(ExportFileTypeString, rptSource, deviceInfo).DocumentBytes;
return buffer;
}
}
I have a .Net 6 Blazor server side project that uses the Telerik Reporting and I'm trying to upgrade it to work with Blazor 3.0.0. When I use it with the latest Bootstrap theme by loading <link rel="stylesheet" href="https://unpkg.com/@@progress/kendo-theme-default@latest/dist/all.css" /> in my _Layouts.cshtml file the export functionality does not work. I followed the link to this theme and it is version 5.1.1. I went through the example of using the report viewer and I noticed that in the page configured with the report viewer that a stylesheet of <link rel="stylesheet" href="https://unpkg.com/@@progress/kendo-theme-default@4.26.0/dist/all.css" /> is being loaded. I went to the Bootstrap website and noticed that when going from version 4 to version 5 that jQuery has been replaced by JavaScript by default. Since the report viewer is using jQuery is this the problem?
The export functionality works when using the 4.26.0 version but it also changes the theme from the one loaded in the _Layouts.cshtml file.
Please advise how to resolve this issue.
Thanks in advance.
Carl
Dear all,
I have a report which will load for a certain period of time. When it is generated, I will export the word format. However, when I export it after a certain time, the report viewer says "session expired". I have change the "sesssionstate timeout" in web.config to "480" minutes. However, the report viewer does not last the report for that long time. How can I increate the timeout to export the report? The following is my setting in web.config.
<sessionState timeout="480"></sessionState>
Hello Forum,
I can render a PDF with ReportProcessor.RenderReport() successfully.
Now I want to encrypt the PDF, there seems to be two ways to do this with the PDF Device Information Settings:
1. Set the user and owner password. This works, but it is not a solution for my use case, because it requires a clear password.
deviceInfo.Add("OwnerPassword", "myPassword");
deviceInfo.Add("UserPassword", "myPassword");
2. Use a certificate for encryption. This does not work, but would be my preferred solution.
deviceInfo.Add("SignCertFilename", "C:\\Temp\\my.cer");
deviceInfo.Add("SignCertPassword", "myPassword");
I cannot find an example which utilizes the device info SignCertFilename (google "Telerik SignCertFilename" returns one result, which links to above documentation).
Does the encryption with a certificate actually work?
Do you have an example code for me, maybe I must set a specific device information.
If you wish, I can deliver a minimal working example.
Thank you for reading!
Good Morning,
I am trying to generate a simple report using a CSV data source. The data source contains applicant information including their university, name, state, etc. The CSV also contains information on the stage of the application, whether it was a whitepaper or full proposal etc. When trying to generate a simple bar chart of the count of the different stages, (i.e., count of how many whitepapers) the field stage also contains the states on the y axis in the chart. It seems the field stage and state are being intertwined when this is not what I want. Is there any solution to this? These fields are clearly separated in the CSV and the data preview when importing the CSV.
Thanks
Hi All,
I need display Telerik report inside a razor page in the .NET framework MVC app.
I attached the design I need to build.
Top of the razor page I'm selecting parameter values for stored procedure. Based on that values report will show the details.
I tried html5 reports and mvc reports. But those are not helped to do my requirement
If anyone is having suggestion, resources or ideas, please insert here. It would be much helpful for me
Thank you
Hllow,
We using with Rest API
In our project we use with 2 different ways with the reports:
sometimes with html5 report viewer. and other time we render the reports in the code with ReportProcessor, RenderReport.
Until now we use wit previous version of telerik reporting (from 2015) and now we upgrade our solution to newer version,
We need to use in the reports with http.context data.
From 2018 this data is not available in report possessing, I override the GetUserIdentity function in the reportscontroller. In the reports I success to get the user data.
But when I Render the reports at code I do not now how to send to report this data(UserIdentity). Additionally, when I try to get data from UserIdentity.Current in the report (after call render report function) I get older data of another report with proccessing from HTML5 viewer.
My questions:
1. Is there a way to use UserIdentity in ReportProcessor.RenderReport? (find attached option2-render report.PNG)
2. Why I sometimes get old value in reports which call from RenderReport function?
Thanks,Chani