Hi,
I create a report and i try to export it to PDF, I'm using C# ASP.net MVC 4 , but an unknown error occured and I can't resolve it, can you help me please,
this is the C# Source code
and I the print screen of the generated PDF file in the attachements
public ActionResult PrintRpt(int myId)
{
try
{
myReport report = new myReport();
report.sqlDataSourceMyReport.Parameters[0].Value = myId;
report.sqlDataSourceMyReport.ConnectionString = "";
var processor = new ReportProcessor();
var res = processor.RenderReport("PDF", report, null);
var pdfSteream = new MemoryStream(res.DocumentBytes);
FileStream file = new FileStream("d:\\file.pdf", FileMode.Create, FileAccess.Write);
pdfSteream.WriteTo(file);
file.Close();
pdfSteream.Close();
byte[] bytes = pdfSteream.ToArray();
string base64String = string.Empty;
try
{
base64String = System.Convert.ToBase64String(bytes, 0, bytes.Length);
byte[] binaryData = System.Convert.FromBase64String(base64String);
}
catch (System.ArgumentNullException)
{
throw new Exception("Binary data array is null.");
}
return Json(base64String, JsonRequestBehavior.AllowGet);
}
catch (Exception e)
{
return Json(e, JsonRequestBehavior.AllowGet);
}
}
Dear users,
i want to use a class from my project to generate a report. i am able to use Public Property's from my class as long as it holds just one value with success
When i try to use a property like (remark: i want to print all values in it as a list)
Public Property douRundenZeiten As New BindingList(Of Double) ' Feld mit allen Rundenzeiten - Messwerte
instead of the values the report shows System.ComponentModel.BindingList1[System.Double] in the tablecell (table wizard as used)
Why will this happen and how to access the real values from the BindingList
A close by behavior also happens when i read in an xml file like
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
TicketRun
>
<
Fahrer
>
<
Pos
>1</
Pos
>
<
Kart
>8</
Kart
>
<
NameOfDriver
>Kart-Nr. 08</
NameOfDriver
>
<
Rnd
>13</
Rnd
>
<
Rundenzeiten
>
<
Laptime
>120,06</
Laptime
>
<
Laptime
>119,15</
Laptime
>
<
Laptime
>126,12</
Laptime
>
<
Laptime
>159,8</
Laptime
>
<
Laptime
>147,46</
Laptime
>
<
Laptime
>119,07</
Laptime
>
<
Laptime
>119,22</
Laptime
>
<
Laptime
>120,2</
Laptime
>
<
Laptime
>119,64</
Laptime
>
<
Laptime
>120,3</
Laptime
>
<
Laptime
>120,2</
Laptime
>
<
Laptime
>120,85</
Laptime
>
<
Laptime
>121,34</
Laptime
>
</
Rundenzeiten
>
<
Best
>119,07</
Best
>
<
Speed
>19,05</
Speed
>
</
Fahrer
>
Using
Function
ReadTicketWithTimesXml(xmlfile
As
String
)
Dim
ds
As
New
DataSet
xmlfile =
"e:/karatris/LTR.xml"
ds.ReadXml(xmlfile)
Return
ds.Tables(
"Fahrer"
)
End
Function
and use this function as a source for an objectdatasource all values can be used in a report except the <Rundenzeiten> <Laptime> values.
The Report shows System.Data.RelatedView in the table cell instead of the values.
Using the same xml in Altova Style Vision works like a charm for generating HTML Reports.
What is the reasons why it does not work the same way in reporting. Where is my mistake?
Attached is the view how the objectdatasource looks in visual studio 2012.
Any help is welcome
Martin Gartmann
Hello
Im having trouble reaching the detailsection of a loaded subreport, in my mainreport contructor.
here is my subreport loading procedure:
this.subLP5.ReportSource = new subLP5a();
//change pagebreak of subreport detailsection
DetailSection ds = (DetailSection)this.subLP5.Report.Items["detaillp5a"];
ds.PageBreak = PageBreak.None;
I get ds=null despite "detaillp5a" is the existing name for subLP5a detailsection.
Should I adress the detailarea in another manner?
regards
Mark
Hi there
Due to we change the Visual Studio from 2008 to 2010, we've updated the 2008 version to 2010 Q3 version of Telerik reporting.
We are having trouble with one report, it gives the error: 'value of the parameter of the report invalid'.
This particular report is a dynamic column approach type of report.
So in our ASPX file we just do the like this previously:
Telerik.Reporting.Report report = new EUCTVIReports.MostLeastPreferredReport();
report.ReportParameters["MyParameter1"].Value = dtMostView;
report.ReportParameters["MyParameter2"].Value = dtLeastView;
this.rprtvwrMostLeastPreferred.Report = report;
We passed DataTable into 2 parameters into this report.
Here's the code in telerik reporting called MostLeastPreferredReport (telerik_3a.png, telerik_3b.png, telerik_3c.png, telerik_3d.png) and also Paramters (telerik_2a.png and telerik_2b.png).
Please help. Is there any other approach that I can do?
Thanks
Hello,
I can't find an anwser or i don't know what to search for my issue.
I have a reportlibrary.dll file from a Telerik Reporting Q2 Project.
I can use it in WebForms Application with the ReportViewer.aspx.
How ever i want to make a new Telerik MVC App which is based on Kendo and optimized for mobile browsers (responsive).
I can't find a definite anwser how to use the existing .dll with the ports with the HTML5 viewer.
So far i've tried with the documentation a standalone REST service and an integrated ReportPage.html.
However they seem to work only with .trdx files.
Can you point me a source for reading or even better attach a demo solution file with this structure.
Regards,
Hi,
I use Telerik Reporting with asp.net HTML5 viewer. In my bar chart(Graph)when I use Category grouping the Y Axis labels cut off words.I even tried to set CoordinateSystem.YAxix.Size to set the size manually but then it add dummy spaces.And no Text alignment property helps.
I know there is a listing in the documentation about what strings can be used to do programmatic exporting.
But is there a way to programmatically get this list?
Having to put a static array of strings into my code to validate my export parameters is very limiting.
It would be much nicer if I could leverage the reporting library to assist me in this validation.
P.S. Just letting the code throw an exception is not really acceptable.
Has anyone see this issue regarding the toolbar.