Telerik Forums
Reporting Forum
1 answer
110 views
Hi there,

I noticed a very strage behavior while creating a PDF-report:
it's a quite simple report with a table with data from an objectDataSource.datamenber (a method that collects the needed data elsewhere)
If I just show the output on screen with the reportviewer everything works as expected.
But if I switch to only PDF-output, I got a second thread "rendering" and BOTH threads do use the datamember so it runs twice delivering exactley the same data. So my output tooks twice as long.
So why do both threads (rendering and "main") are using the objectDataSource? Can I somehow deny spawning a second thread?

Thanks in advance!
Elian
Telerik team
 answered on 02 Oct 2012
0 answers
71 views
Hi.  Does anyone knows what the code is and how to apply this to the Telerik equivalence?

 	Dim MyTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim mySubreport As CrystalDecisions.CrystalReports.Engine.ReportDocument
Frank
Top achievements
Rank 1
 asked on 01 Oct 2012
7 answers
1.6K+ views
I have a question, that seems extremely simple, but I can not seem to figure it out. I have created a basic report and simply added a datasource. I have a list of parts, and I would like for the column headers to repeat on each page, not on each line. If I put the column headers in the details section, they repeat on every row. If I put them in the page header, they then appear above the report header.

How can I simply put the column headers below the report header, and have the repeat on each page. Seems like I need to add a second page header, but have it below the report header.

I am doing this through the GUI also.
Steve
Telerik team
 answered on 01 Oct 2012
6 answers
539 views
Hi,

I would like to create a  report based on a generic IList. How do I get the generic type to load in the report's design view? I can't seem to be able to add it as a datasource.
Petr
Top achievements
Rank 1
 answered on 01 Oct 2012
1 answer
112 views
Hi,

I am following the example "AutoGenerateColumns" found on the forum to dynamically populate data from the database in Telerik.Reporting.Table.


	private void table1_ItemDataBinding(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            processingTable.DataSource = _dataTable;
 
            //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
            Telerik.Reporting.HtmlTextBox textboxGroup;
            Telerik.Reporting.HtmlTextBox textBoxTable;
 
            //we do not clear the Rows collection, since we have a details row group and need to create columns only
            this.table1.ColumnGroups.Clear();
            this.table1.Body.Columns.Clear();
            this.table1.Body.Rows.Clear();
            int i = 0;
            this.table1.ColumnHeadersPrintOnEveryPage = true;
            foreach (DataColumn dc in _report.ReportData.Columns)
            {
                Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                this.table1.ColumnGroups.Add(tableGroupColumn);
                this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
 
                textboxGroup = new Telerik.Reporting.HtmlTextBox();
                textboxGroup.Style.BorderColor.Default = Color.Black;
                textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                textboxGroup.Value = dc.ColumnName.ToString();
                textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                tableGroupColumn.ReportItem = textboxGroup;
 
                textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields.[" + dc.ColumnName + "]";
                textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                this.table1.Body.SetCellContent(0, i++, textBoxTable);
                this.table1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
            }
        }
the DataTable is a very simple two-column table : Employee Name / Employee Email address The below exception is thrown for each email address table cell when the table is generated :
System.Xml.XmlException: The '@' character, hexadecimal value 0x40, cannot be included in a name. Line 1, position 30.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at Telerik.Reporting.HtmlEngine.HtmlParser.ParseHtmlNode(XmlReader reader)
   at Telerik.Reporting.HtmlEngine.HtmlParser.Parse()
   at Telerik.Reporting.HtmlEngine.HtmlParser.Parse(String html, ReportObject parent)
   at Telerik.Reporting.Processing.HtmlTextBox.ProcessItem()
   at Telerik.Reporting.Processing.ReportItemBase.Process(DataMember data)


Please advise

Thanks
Paulino
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
479 views
Hello,

We are using aspnet report viewer.
However we have some difficulties to auto size the viewer to fit content of the browser when it is resized by end user.
I can successfully auto size on the width using CSS and width = 100% but not the height.
Is there anyway to auto size the viewer height and width to fit content of the browser?

Here is the code:

    <form id="ReportManagement" runat="server" style="width: 100%">
    <div id="content" >
        <telerik:ReportViewer ID="ReportManagementViewer" runat="server"    
             Width="100%" ViewMode="PrintPreview"  Height="690px"
             ParametersAreaVisible="False" ShowParametersButton="False"
            ShowDocumentMapButton="False" ShowPrintPreviewButton="False" 
            ZoomPercent="200" ShowZoomSelect="False" ShowHistoryButtons="False">
        </telerik:ReportViewer>
    </div>   
    </form>

Width of the viewer can resize to fit the with of the browser, but it doesn't work for the height.
Thanks for your help
Regards

Joël
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
88 views
Ik have a report with a chart which is showing sales.
This report has a couple of parameters:
  • customer
  • year
  • period from (month)
  • period to (month)

when I select a period from which is larger as 1, the chart is showing strange behaviour (see image 1). In this example, I am using the following parameters: from period 3 (march) till period 6 (jun). A total of 4 months.

  • the axis labels are all right;
  • the amount of months is ok
  • but strangely the months januari and februari are shown as zero values in the graph. Because the chart is showing 4 months, the values for may and june are not shown.

When I preview the datasource, I get a perfect dataset, and only the range between the selected periods are returned.

What could be the problem? Thanks in advan
Elian
Telerik team
 answered on 29 Sep 2012
1 answer
118 views
How can I format the parameters area on the top of a report?
Steve
Telerik team
 answered on 29 Sep 2012
1 answer
209 views
Hi, we use the wcf service to render reports to pdf for emailing within our application, as well as the silverlight report viewer for viewing them on screen.  If an image within a report is invalid somehow (we occasionally have zero byte image files generated by another part of our application), then within the silverlight app report viewer it shows in the picture box as being invalid. 

However, when using the wcf service the error gets propogated all the way back into the results of the render operation, in the Errors array, and in the HasErrors boolean.  I check the HasErrors boolean, and the content of the Errors array to report rendering failures, and do not email the resulting rendered document if any errors exist.

This isn't really an error from the point of view of not emailing the report as far as we are concerned.  Is there any way to reliably discriminate between fatal errors (whatever they might be), and other minor errors like this?  If the report has rendered at all we would still want to email it, although we could still report on minor errors in our logging.  Could I check on the DocumentBytes property and see if that's non-null and has a size of greater than zero?

Alternateively is there some way to get the picturebox to completely suppress the error and not throw its own exception under this particular circumstance?

Thanks,

Colin.
Steve
Telerik team
 answered on 28 Sep 2012
1 answer
188 views
We were using a fairly simple method to assign DataTables as SubReport DataSources, so that a report with multiple sub-reports can be given data as a result of a single database call.

foreach (Telerik.Reporting.SubReport item in ReportLib.ReportBase.GetDescendantsByType(this.Report, typeof(Telerik.Reporting.SubReport)))
{
    item.ReportSource.DataSource = ds.Tables[ReportLib.ReportBase.GetDataSetIndex(item.Name)];
}

I updated to the 2012 Q2 release in order to get the PageCount bug fix, and now this approach no longer works.  I'm seeing references to new ReportSource sub-types, but I haven't found one which seems to allow for this sort of approach.  Can anyone help me out?

Note: We are using the same method for assigning DataSources for Crosstabs and Tables, and that appears to still work.
BNA
Top achievements
Rank 1
 answered on 28 Sep 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?