private
void
GenerateReportFromSource(InstanceReportSource reportSource, ReportType reportType, String path, CultureInfo cultureInfo)
{
LocalizationInfo.Culture = cultureInfo;
Thread thread =
new
Thread(() =>
{
try
{
ReportProcessor reportProcessor =
new
ReportProcessor();
RenderingResult result = reportProcessor.RenderReport(reportType.ToString().ToUpper(), reportSource,
null
);
FileInfo info =
new
FileInfo(path);
if
(info.DirectoryName !=
null
&& !Directory.Exists(info.DirectoryName))
Directory.CreateDirectory(info.DirectoryName);
File.WriteAllBytes(path +
"."
+ reportType.ToString().ToLower(), result.DocumentBytes);
}
catch
(Exception e)
{
Logger.WriteException(e);
}
});
thread.CurrentCulture = cultureInfo;
thread.CurrentUICulture = cultureInfo;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
}
So, I've set up a "component" for a project-level data source as described here: http://www.telerik.com/help/reporting/data-source-how-to-add-project-data-source.html
I've added the new data source to a report, and I have added a table to display the data.
When I go to the Html Preview I get an error " An error has occurred while processing Report 'Xxxx': The ConnectionString property has not been initialized."
While I was following the directions for the component, I had selected a ConnectionString and added in a SQL query with parameters and I was able to preview the data and it was looking just fine. But, now that I've added it to the report I need it in I get the above error.
Any helps? I'm using the latest Q2 2015 tool.
Thanks,
Ken
Error saving the file in pdf format within the .pdf file with the message:
An error has occurred while processing Report 'Report1':
Object with name 'Report2' already exists. Object should have unique names.
Can someone help me?
Found another issue when embedding the Report Viewer within a bootstrap site. I found all my reports showed what looked like cell spacing in a table - see TelerikReportingBootstrapBefore.png. This happened in Normal Viewing mode and Print Preview mode.
All you need to do to fix it is add the following bold text before the #reportViewer1 style. This fixes the issue for the report viewer and turns the report back to normal - see TelerikReportingBootstrapAfter.png.
<style>
* {
box-sizing: content-box!important;
}
#reportViewer1 {
position: absolute;
left: 5px;
right: 5px;
top: 5px;
bottom: 5px;
height: 100%;
overflow: hidden;
font-family: Verdana, Arial;
}
</style>​
I have a ReportViewer in my WinForms application to show some data in the form of a Telerik Report. I also have some textboxes, which will update the Report when the user leaves the textbox and the text has been changed.
private
void
SpediControl_Leave(
object
sender, EventArgs e)
{
Control ct = sender
as
Control;
// check if text in textbox has been changed
if
(ct.Text != s)
// s is the text of the textbox
{
// update spedi report
InstanceReportSource repSrcSpedi =
new
InstanceReportSource();
repSrcSpedi.ReportDocument =
new
Spedi(
this
);
repViewerSpediPreview.ReportSource = repSrcSpedi;
repViewerSpediPreview.RefreshReport();
}
}
After​ leaving a textbox, the ReportViewer gets the focus on itself. So I'm using UpdateUI event. To test if it gets fired, I just call a MessageBox:
private
void
repViewerSpediPreview_UpdateUI(
object
sender, EventArgs e)
{
MessageBox.Show(
"aaa"
);
}
To my surprise, the message box gets called 8 times. First, I thought the "_Leave()" event must have an error. But the Leave event is only triggered once (as expected). It's only the UpdateUI event which is triggered multiple times. Everything else is working as expected. Is this a known bug or can anyone please provide me some help?
Regards,
Danilo
I just updated my Telerik Reporting to 2015 Q2. I'm almost done fixing every obseletes properties and method but one issue remain and I can't find any proper solution to fix it. Here is my code:
Dim
GridColumnElements()
As
Processing.ProcessingElement = GridTable.ChildElements.Find(
"GridColumnTextBox"
,
True
)
For
i
As
Integer
= 0
To
GridColumnElements.Count - 1
Dim
ColumnRatio
As
Double
= (GrdField.Columns(i).Width / TotalColumnPixelWidth)
Dim
ColumnWidth
As
Unit = TotalGridWidth.Multiply(ColumnRatio)
Dim
pe
As
Processing.ProcessingElement = GridColumnElements(i)
Dim
tb
As
Processing.TextBox =
DirectCast
(pe, Processing.TextBox)
Now I get the classic:
"Warning 'Public ReadOnly Property ChildElements As Telerik.Reporting.Processing.ProcessingElement.ElementCollection' is obsolete: 'The Telerik.Reporting.Processing.ProcessingElement.ChildElements property is now obsolete. Use Telerik.Reporting.Processing.ElementTreeHelper.GetChildElements() method instead.'
It doesn't seems to have any method that would suite me well in this case.. any ideas ?
Hi All,
Can we create report book with report designer only ? not using code