I'm currently doing a little proof of concept, but I'm either failing to understand something or I did something wrong.
Here's the code snippet:
class Program
{
static void Main(string[] args)
{
Telerik.Reporting.Report report = new Telerik.Reporting.Report();
string selectCommand = @"SELECT * FROM Test.dbo.TestTable"; //Assume that the query works in SQL
string connectionString = @"Data Source=.\DEVSQL;Initial Catalog=Test;Integrated Security=True;Persist Security Info=True;";
Telerik.Reporting.SqlDataSource sqlDataSource = new Telerik.Reporting.SqlDataSource(connectionString, selectCommand);
report.DataSource = sqlDataSource;
ExportToPDF(report);
}
public static void ExportToPDF(Telerik.Reporting.Report reportToExport)
{
ReportProcessor reportProcessor = new ReportProcessor();
Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument = reportToExport;
RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
string fileName = result.DocumentName + "." + result.Extension;
string path = System.IO.Path.GetTempPath();
string filePath = System.IO.Path.Combine(path, fileName);
using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
{
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
}
}
}
After executing this I get an empty PDF, even though the table has several rows.
I have two project
- Project Angular
- Project existing used Dot net core 2.0 (.NET Core and ASP.NET Core 2.0).
Now, I want to use Telerik Report Rest Service. Help me.
I have 2 project:
1. Angular (pictrure: 1.JPG)
2. Rest Service
- I used class MyResolver() (pictrure: 2.jpg)
Error function DeserializeReport
HI team
I wanted to know if its possible to change the culture of a report during the rendering process.
Say for example you are grouping by Country. When printing a given country the Currency symbol should reflect that of the country.
Do you set the culture of all the report items in the lower detail sections (and possibly any child groups) in the item databinding event. Thats what first came to mind.
Some code would be appreciated..
Kind Regards
Michael
Hello,
it has been a long time since I got this error happening randomly on my production enviorment and not been able to solve it.... I got this error message when opening a report with 2 parameters (int, datetime) :
Value cannot be null.
Parameter name : Instance.......
Consider that there' approximatelly 400 ppl using this application, I don't know it if it's something related to concurrency or what... I can just say that one time it happens it continue till I do an iisreset
I got this problem with Q2, can't move immediatly to Q3 since we got scheduled deploys..... any suggestion?
Thanks
Paolo
Hi, I have some reports implemented in WPF, with the Telerik ReportViewer, in there the user can export the report result to CSV, PDF, Excel, etc. but I want what he will can export it only to PDF, how I can configure?
Thanks