Telerik Forums
Reporting Forum
1 answer
180 views

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);
            }
        }

 

 

haitham
Top achievements
Rank 1
 answered on 26 Nov 2015
3 answers
205 views

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
 

Nasko
Telerik team
 answered on 26 Nov 2015
2 answers
104 views

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

 

 

Mark
Top achievements
Rank 1
 answered on 25 Nov 2015
1 answer
360 views
I have a report that I want to show in a reportviewer and I can set the urireportsource when I clarify the full path location.  How do you set the report source to a report located in a folder in the solution.  I am using winforms with c# and coding it in VS 2012.  The report works fine on the server, but of coarse the file path is not found on client computers and I don't want to share the folder were the files reside.
Stef
Telerik team
 answered on 25 Nov 2015
1 answer
463 views

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

 

 

 

 

 

 

Nasko
Telerik team
 answered on 25 Nov 2015
1 answer
402 views

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,

Nasko
Telerik team
 answered on 25 Nov 2015
2 answers
140 views

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.

Stef
Telerik team
 answered on 25 Nov 2015
5 answers
318 views

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.

Stef
Telerik team
 answered on 25 Nov 2015
7 answers
477 views
I have saved my previous reports Q1 reports to Q3 2013 but I also want them in Q1 2013. However, I cannot open them in Q1 because 

Telerik.Reporting.Xml.XmlSerializerExcepion: An error has occurred during xml serialization. The xml serializer cannot resolve type with name: Report
   at Telerik.Reporting.Xml.ObjectXmlReader.ReadXmlElement(String name)
   at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.ReadReport()
   at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)

I am aware of the upgrade wizard on visual studio etc. but I cant seem to find the upgrade wizard on report designer. Is there a solution for this?
TomR
Top achievements
Rank 1
 answered on 25 Nov 2015
3 answers
53 views

Has anyone see this issue regarding the toolbar.

 

Stef
Telerik team
 answered on 25 Nov 2015
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?