Telerik Forums
Reporting Forum
1 answer
162 views
Hello,

The issue is related to a Silverlight Application which uses Telerik reports to show data concerning the products selected to be displayed.
The data is collected from an SQL database, the product images are rendered in Telerik pictureBox controls.  
Using HTTP, the images are displayed correctly.
Using HTTPS, the images are not displayed at all, the other data in the text boxes appears correctly. 

Thank you for your suggestions.

Cristian
Hinata
Top achievements
Rank 1
 answered on 19 May 2014
3 answers
95 views
I am very new to Telerik and am currently just evaluating it as a possible reporting solution. Please bear with me.

Here is a basic example of what I am trying to do:

I have a Panel. Inside the Panel is a Shape. Inside the Shape are some TextBoxes. I am using the Shape to frame some TextBoxes (for visual organization). The Panel grows with the TextBoxes, but the Shape does not. So on some records, some of the data in the TextBoxes bleeds over the Shape.

What I would like to do is to have the shape grow/shrink with each record - basically, resize the Shape in relation to the Panel for *each record* that gets rendered. One thing I tried was to Anchor the Shape to the Panel. That has resulted in limited success. So I assume I may have to do this through code(?).

If anyone could point me in the right direction (documentation/examples/etc), I'd really appreciate it. I've been searching for hours and have only come up with out-dated code examples that don't align with the current API.

Thanks in advance!

Paul
Nasko
Telerik team
 answered on 19 May 2014
1 answer
77 views
Hi,

We have a report with 300+ columns and there are 3000 records. The report takes over 15 minutes to render into Excel. (We are not talking about time from server to browser here). This is on local machine.

Anyone has idea is whether this slowness is due to high number of columns? We checked the SP that it returns the data very fast. 

Thanks
Piyush Bhatt


Hinata
Top achievements
Rank 1
 answered on 19 May 2014
1 answer
176 views
I'm attempting to export to a memorystream not filestream.  It works fine when there's a single stream.  But I'm also trying to export to a multi-document format.  bmp or png.  When I export to this format I only get the first page of the report.  I did try combining the bytes from each stream but still only get the first page.  Would appreciate any help you can provide.

http://www.telerik.com/help/reporting/programmatic-exporting-report.html

Hinata
Top achievements
Rank 1
 answered on 19 May 2014
1 answer
118 views
In our report we had added two subreports which show up for each row returned by the main report.
We populate rest of the data depending on the main report in the subreports.
And when we export to csv the o/p has rows against each field in the subreports too. But it is not mapped correctly.
For eg: in Main report if I have two rows corresponding to  Employees : Raj and Jaya
The data in the subreport shows the Company Name. For Raj its Wipro and Jaya its TCS
When exported to csv the company Name for both the employees shows as Wipro. Is this an issue related to having subreports when rendering to csv.
Please suggest a solution asap....
Stef
Telerik team
 answered on 16 May 2014
3 answers
71 views
Our HTML5 implementation is working very nicely, but we have requests to perform different visual effects on the web page once the report is done rendering. 

Would it be possible to have a way to hook into the onReportLoadComplete event when we instantiate the reporting object (telerik_ReportViewer)?

$("#reportViewer1").telerik_ReportViewer({
      serviceUrl: "../api/reports/",
      templateUrl: 'src/templates/telerikReportViewerTemplate.htmll',
      reportSource: { report: "product catalog.trdx" },
      onReportLoadComplete : function(e){
              // our code run here
       }
});


Thank you
Stef
Telerik team
 answered on 16 May 2014
2 answers
538 views
Greetings.

I'm not sure how to do this so asking it here. I have a Web API project that I've added the HTML5 ReportViewer.  I have looked at the examples included with Q3 2013 release but they reference a dll, not the trdx file. What I need to do is find the plumbing to:
1) load the trdx file
2) assign the dataset to the report
3) display the report

Simple eh?  But not if you can't find an example.  In the past I was able to do this on a windows form by:
<snippet>
 // reportInfo is a class that has all the report details, header, DataSet, etc
   XDocument doc = LoadXDocument(reportInfo); 

// open the report
 BufferedStream stream = new BufferedStream(new MemoryStream());
 stream.Write(Encoding.ASCII.GetBytes(doc.ToString()), 0, doc.ToString().Length);
 stream.Seek(0, SeekOrigin.Begin);
 StreamReader sr = new StreamReader(stream); 
System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings();
 settings.IgnoreWhitespace = true; 

XmlDocument xmlDoc = GetXmlDocument(doc);
 Telerik.Reporting.Report report; 

using (System.Xml.XmlReader xmlReader = System.Xml.XmlReader.Create(sr, settings))
 {
  Telerik.Reporting.XmlSerialization.ReportXmlSerializer xmlSerializer = new Telerik.Reporting.XmlSerialization.ReportXmlSerializer();  
report = (Telerik.Reporting.Report)xmlSerializer.Deserialize(xmlReader);
 } 

Telerik.Reporting.TextBox tbHeader = (Telerik.Reporting.TextBox)report.Items["pageHeaderSection1"].Items["textBoxHeader"];
 tbHeader.Value = reportInfo.Title; 

if (reportInfo.CompanyLogo != "" && reportInfo.CompanyLogo != null)
 {
  Telerik.Reporting.PictureBox pictureBoxCompanyLogo = (Telerik.Reporting.PictureBox)report.Items["pageHeaderSection1"].Items["pictureboxCompanyLogo"];
  pictureBoxCompanyLogo.MimeType = reportInfo.CompanyLogoExt != "" ? "Image/" + reportInfo.CompanyLogoExt.ToUpper() : "";
  pictureBoxCompanyLogo.Value = Image.FromFile(reportInfo.CompanyLogo);
 } 

foreach (TableInfo tableinfo in reportInfo.Tables)
 {
  Telerik.Reporting.Table table = (Telerik.Reporting.Table)report.Items["detailSection1"].Items[tableinfo.ReportTableName];
  table.DataSource = tableinfo.DataSource;
 }
 
</snippet>    
    
 //routine that converts the XDocument (trdx) into XmlDocument
 private XmlDocument GetXmlDocument(XDocument document)
 {
  using (XmlReader xmlReader = document.CreateReader())
  {
   XmlDocument xmlDoc = new XmlDocument();
   xmlDoc.Load(xmlReader);
   if (document.Declaration != null)
   {
    XmlDeclaration dec = xmlDoc.CreateXmlDeclaration(document.Declaration.Version,
     document.Declaration.Encoding, document.Declaration.Standalone);
    xmlDoc.InsertBefore(dec, xmlDoc.FirstChild);
   }
   return xmlDoc;
  }
 }

oh if anyone wants to use that code, the one thing to point out is your DataTables need to have the same name as your Tables in the trdx else the Table cant assign the data.

I have to say that in the past all the responses the best I've ever gotten was a link to the documentation that only has partial code.  I just wish for once that someone would actually give me what I want, maybe a small web api project that loads a single report (trdx file) based on a datatable using the html5 viewer?
 
References:
http://www.telerik.com/help/reporting/telerik-reporting-rest-host-http-service-using-web-hosting.html
http://www.telerik.com/help/reporting/html5-report-viewer-embedding.html
many many others.....

Background Info
===================================
A lot of this should look familiar since it was basically cut and pasted from what I could find from your docs. 

WebApp (other sections not shown for simplicity)
----------------------------------------------
 Controllers
  ReportsController.cs
 Reports
  Sample1.trdx
 ReportViewer
  all files copied over from ReportViewer Folder and added to web app
 Views
  Reports
   Index.cshtml

ReportsController.cs
--------------------------------------------  
using System.Web;
using Telerik.Reporting.Cache.Interfaces;
using Telerik.Reporting.Services.Engine;
using Telerik.Reporting.Services.WebApi;namespace WebApp.Controllers
{
        public class ReportsController : ReportsControllerBase
    {
        protected override IReportResolver CreateReportResolver()
        {
            var reportsPath = HttpContext.Current.Server.MapPath("~/Reports");            return new ReportFileResolver(reportsPath)
                .AddFallbackResolver(new ReportTypeResolver());
        }        protected override ICache CreateCache()
        {
            return Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache();
        }
    }
}
   
Index.cshtml
---------------------------------
<head>
    <link href="ReportViewer/styles/ReportViewer-7.2.13.1010.css" rel="stylesheet" />
    <script src="ReportViewer/js/ReportViewer-7.2.13.1010.js"></script>    <style>
        #reportViewer1 {
            /*position: absolute;*/
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            font-family: 'segoe ui', 'ms sans serif';
            overflow: hidden;
        }
    </style></head>
<style>
    ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
    }    table td, table td * {
        vertical-align: top;
    }
</style><h3>Title</h3><table style="padding: 0; margin: 0; border: 1px">
    <tr>
        <td>
            <ul id="panelbar" style="width: 150px; list-style-position: inside; padding: 0; margin: 0">
    /* code omitted */
            </ul>
        </td>
        <td>
            <div id="reportViewer1" class="k-widget">
            </div>
         </td>
    </tr>
</table><script>
    $("#panelbar").kendoPanelBar({
        expandMode: "single"
    });
</script><script type="text/javascript">
    //async
    $(document).ready(function () {
  //code omitted for panelbar        $("#reportViewer1")
            .telerik_ReportViewer({
            serviceUrl: "/api/reports/",
            templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate.htmll',
            reportSource: { report: "~Reports/Sample1.trdx" }
        });
    });
</script>

trdx file
-----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<Report Width="8in" Name="Sample Report 1" xmlns="http://schemas.telerik.com/reporting/2012/3.4">
  <Items>
    <PageHeaderSection Height="0.730000019073486in" Name="pageHeaderSection1">
      <Style>
        <BorderStyle Bottom="Solid" />
        <BorderColor Bottom="0, 61, 121" />
      </Style>
      <Items>
        <PictureBox Width="1.82000005245209in" Height="0.629999995231628in" Left="6.18in" Top="0.1in" Sizing="Stretch" Anchoring="Top, Right" Name="pictureboxCompanyLogo" />
        <TextBox Width="6.07991790771484in" Left="0in" Height="0.5in" Top="0.1in" Value="" TextWrap="True" Anchoring="Top, Left, Right" Name="textBoxHeader">
          <Style Color="0, 61, 121" TextAlign="Left" VerticalAlign="Bottom">
            <Font Name="Microsoft Sans Serif" Size="12pt" Bold="True" />
          </Style>
        </TextBox>
      </Items>
    </PageHeaderSection>
    <DetailSection Height="6in" Name="detailSection1">
      <Items>
        <Table Width="1.59375in" Height="0.61666658787421in" Left="0.00in" Top="0.16in" ColumnHeadersPrintOnEveryPage="True" Name="detailTable_b066f4d8089a4c38993391bc534ce628">
          <Body>
            <Cells>
              <TableCell RowIndex="0" ColumnIndex="0" RowSpan="1" ColumnSpan="1">
                <ReportItem>
                  <TextBox Width="0.927083333333333in" Height="0.18in" CanGrow="True" WordWrap="True" Left="0in" Top="0in" Value="=Fields.[Description]" Name="textBoxDetail_Description">
                    <Style TextAlign="Left" VerticalAlign="Middle">
                      <Font Name="Microsoft Sans Serif" Size="8pt" />
                    </Style>
                    <ConditionalFormatting>
                      <FormattingRule>
                        <Style BackgroundColor="230, 231, 232" />
                        <Filters>
                          <Filter Expression="=RowNumber()%2" Operator="Equal" Value="=1" />
                        </Filters>
                      </FormattingRule>
                    </ConditionalFormatting>
                  </TextBox>
                </ReportItem>
              </TableCell>
              <TableCell RowIndex="0" ColumnIndex="1" RowSpan="1" ColumnSpan="1">
                <ReportItem>
                  <TextBox Width="0.666666666666667in" Height="0.18in" CanGrow="True" WordWrap="True" Left="0in" Top="0in" Value="=Fields.[Value]" Name="textBoxDetail_Value">
                    <Style TextAlign="Right" VerticalAlign="Middle">
                      <Font Name="Microsoft Sans Serif" Size="8pt" />
                    </Style>
                    <ConditionalFormatting>
                      <FormattingRule>
                        <Style BackgroundColor="230, 231, 232" />
                        <Filters>
                          <Filter Expression="=RowNumber()%2" Operator="Equal" Value="=1" />
                        </Filters>
                      </FormattingRule>
                    </ConditionalFormatting>
                  </TextBox>
                </ReportItem>
              </TableCell>
            </Cells>
            <Columns>
              <Column Width="0.927083333333333in" />
              <Column Width="0.666666666666667in" />
            </Columns>
            <Rows>
              <Row Height="0.18in" />
            </Rows>
          </Body>
          <Corner />
          <Style>
            <BorderStyle Default="Solid" />
          </Style>
          <RowGroups>
            <TableGroup Name="detailTableGroup">
              <Groupings>
                <Grouping />
              </Groupings>
            </TableGroup>
          </RowGroups>
          <ColumnGroups>
            <TableGroup Name="tableGroup">
              <ReportItem>
                <TextBox Width="1.59375in" Height="0.2in" Left="0in" Top="0in" Value="" Name="textBoxTableTitle_detailTable_b066f4d8089a4c38993391bc534ce628" StyleName="">
                  <Style BackgroundColor="0, 61, 121" Color="White" VerticalAlign="Middle" Bottom="Solid">
                    <BorderStyle Bottom="Solid" />
                    <BorderColor Bottom="131, 171, 85" />
                    <Font Name="Microsoft Sans Serif" Bold="False" Size="9pt" />
                  </Style>
                </TextBox>
              </ReportItem>
              <ChildGroups>
                <TableGroup Name="groupDescription">
                  <ReportItem>
                    <TextBox Width="0.927083333333333in" Height="0.23in" Left="0in" Top="0in" Value="Description" Name="textBoxRowHeader_Description">
                      <Style BackgroundColor="White" Color="13, 80, 169" VerticalAlign="Bottom" TextAlign="Left">
                        <BorderStyle Bottom="Solid" />
                        <BorderColor Bottom="13, 80, 169" />
                        <Font Name="Microsoft Sans Serif" Size="9pt" Bold="False" />
                        <Padding Bottom="1pt" />
                      </Style>
                    </TextBox>
                  </ReportItem>
                </TableGroup>
                <TableGroup Name="groupValue">
                  <ReportItem>
                    <TextBox Width="0.666666666666667in" Height="0.23in" Left="0in" Top="0in" Value="Value" Name="textBoxRowHeader_Value">
                      <Style BackgroundColor="White" Color="13, 80, 169" VerticalAlign="Bottom" TextAlign="Right">
                        <BorderStyle Bottom="Solid" />
                        <BorderColor Bottom="13, 80, 169" />
                        <Font Name="Microsoft Sans Serif" Size="9pt" Bold="False" />
                        <Padding Bottom="1pt" />
                      </Style>
                    </TextBox>
                  </ReportItem>
                </TableGroup>
              </ChildGroups>
            </TableGroup>
          </ColumnGroups>
        </Table>
        <TextBox Width="2.5in" Height="0.18in" CanGrow="False" Left="0in" Top="0.82666658787421in" Value="* Lower rate indicates better performance" Name="textBoxDetail_a4b1b395d8414d85a3e237623d8289c7">
          <Style Color="Black" TextAlign="Left" VerticleAlign="Middle">
            <Font Name="Microsoft Sans Serif" Size="8pt" Bold="False" Italic="True" />
          </Style>
        </TextBox>
      </Items>
    </DetailSection>
    <PageFooterSection Height="0.769999821980794in" Name="pageFooterSection1">
      <Style>
        <BorderStyle Top="Solid" />
        <BorderColor Top="0, 61, 121" />
      </Style>
      <Items>
        <PictureBox Width="0.8in" Height="0.5in" Left="0.1in" Top="0.15in" Sizing="Stretch" MimeType="image/png" Anchoring="Top, Left" Value="" Name="pictureBox" />
        <TextBox Width="2.69997572898865in" Height=".18in" Left="5.19791666666667in" Top="0.447916030883789in" Value="=&quot;Generated on &quot; + NOW()" Anchoring="Top, Right" Name="currentTimeTextBox" StyleName="PageInfo">
          <Style Color="DimGray" TextAlign="Right" VerticalAlign="Middle">
            <Font Name="Microsoft Sans Serif" Size="9pt" />
          </Style>
        </TextBox>
        <TextBox Width="3.0in" Height="0.2in" Left="2.5in" Top="0.15in" Value="=&quot;Page &quot; + PageNumber + &quot; of &quot; + PageCount" Anchoring="Top, Left" Name="pageInfoTextBox" StyleName="PageInfo">
          <Style Color="13, 80, 169" TextAlign="Center" VerticalAlign="Middle">
            <Font Name="Microsoft Sans Serif" Size="9pt" />
          </Style>
        </TextBox>
      </Items>
    </PageFooterSection>
  </Items>
  <StyleSheet>
    <StyleRule>
      <Style>
        <Padding Left="2pt" Right="2pt" />
      </Style>
      <Selectors>
        <TypeSelector Type="TextItemBase" />
        <TypeSelector Type="HtmlTextBox" />
      </Selectors>
    </StyleRule>
  </StyleSheet>
  <PageSettings>
    <PageSettings PaperKind="Letter" Landscape="False">
      <Margins>
        <MarginsU Left="0.25in" Right="0.25in" Top="0.25in" Bottom="0.25in" />
      </Margins>
    </PageSettings>
  </PageSettings>
</Report>
Glenn
Top achievements
Rank 1
 answered on 16 May 2014
5 answers
138 views
Hi..

My sp returns 3 datatable in a dataset. i put the dataset in loop and creates dynamic table

 for (int m = 1; m < dataSet.Tables.Count - 1; m++)
{
  Table table1 = new Table();
        DataTable data = dataSet.Tables[m];
       
...................................
       
-----------------------------------
        Panel pnlPeerReviewerRecommendation = new Panel();
        pnlPeerReviewerRecommendation.Anchoring = AnchoringStyles.Left;
       
table1.Anchoring = AnchoringStyles.Left;
       
table1.Top = new Unit(20.0d);
       
pnlPeerReviewerRecommendation.Items.Add(table1);
 
}


and i'm adding this panel to another panel which i cretated in the desiger.

My issue is the tables are binding in the reverse order.

Thats is the the last table in the dataset shows first. please help me..


Thanks,
Mahesh
Stef
Telerik team
 answered on 16 May 2014
4 answers
133 views
Hi,

I have been waiting for this feature to be integrated in the Reporting suite for years now. I was wondering if the team has considered a feature for generating reports from client-side data in Silverlight as my application do not use server data? I need to generate report from the user input. Do you have this feature now and its just that I am unaware of it?

I really do not want to have to buy the whole suite from another vendor just for this feature as everything else Telerik intregrates nicely into my app.

Cheers!
Stef
Telerik team
 answered on 16 May 2014
1 answer
85 views
I am including the Telerik Data Access DLL's with my VS project that is using the Reporting tool, we are not even referencing the data access DLL's,  however, each time I deploy the code to a client machine, I get an error that the Data Access DLL's are not found. Only after I download and install the data access does the error go away. Can anyone tell me what is being set when I install data access that is not being done when I deploy my code. I have already read the the link below

http://www.telerik.com/support/kb/data-access/details/handling-error-could-not-load-file-or-assembly-telerik-openaccess-or-one-of-its-dependencies

that deals with this subject but I am still having issues. Can anyone help? What needs to be in my project so I dont get this error?
Hinata
Top achievements
Rank 1
 answered on 16 May 2014
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?