Telerik Forums
Reporting Forum
2 answers
270 views
Hello

I am working on a report, where the PageHeader has to have a label (addressee) that can have 4 different values and depends on the current page and total number of pages in the report. 
I have created a method that takes these, but it is not working as anticipated.

I debugged it and the problem is that the PageCount that is passed is not the final at the time of calling the method. Is there a way to access  the total number of pages from code-behind?

Regards,
Roland
Roland
Top achievements
Rank 1
 answered on 03 Oct 2012
5 answers
512 views
Hi,

I am new to Telerik and I am following the code posted on your website related to adding reports to a website.  However, when I run this code:

Dim instanceReportSource As New Telerik.Reporting.InstanceReportSource()
            instanceReportSource.ReportDocument = New ListBoundReport()
            ReportViewer1.ReportSource = instanceReportSource

I get an error message saying that 'Type Telerik.Reporting.InstanceReportSource is not defined'.  I have my reference to Telerik.Reporting.  I was wondering if you can help me figure what I am missing.

Thank you,
Leo
illumination
Top achievements
Rank 2
 answered on 02 Oct 2012
1 answer
337 views

Posted 20 hours ago (permalink)

Hi,

I have a Report with a table

With the parameters I'm testing with, my data call returns 17 rows of order objects.  Binding directly to the table datasource gives 17 rows as expected.  The report has a footer that relies on the same dataset and setting the report dataset causes the table data to repeat.  Instead of one page with 17 rows, it becomes 18 pages with  the same 17 rows reapeated on each page.

I tried setting the data source on the table's NeedDataSource event, and it ran 18 times.
I'm currently setting the table datasource in the report NeedDataSource.

This gives proper grid, no footer:
this.OrderDetailsTable.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);

This gives 18 pages of grid with proper footer:
 private void OrdersDetailReport_NeedDataSource(object sender, EventArgs e)
        {
                string authToken = (string)this.ReportParameters["AuthToken"].Value;
                bool newAndPendingOnly = (bool)this.ReportParameters["NewAndPendingOnly"].Value;
                DateTime startDate = (DateTime)this.ReportParameters["StartDate"].Value;
                DateTime endDate = (DateTime)this.ReportParameters["EndDate"].Value;
                PatientSearchType patientFilter = (PatientSearchType)(int)(long)this.ReportParameters["PatientFilter"].Value;


                if (SRServicesFacade.VerifyAuthentication(authToken, SERVICE_NAME, SERVICE_VERSION))
                {
                    //TODO: Change this for a regular GetCompanyInfo call when the change to store the company info happens

                    this.txtCompanyName.Value = CompanyManagementFacade.GetCompanyName();
                    this.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);
                    this.OrderDetailsTable.DataSource = this.DataSource;
                    //this.OrderDetailsTable.DataSource = SupplyReplacementFacade.GetOrdersByCompanyID(newAndPendingOnly, patientFilter, startDate, endDate);

                }
        }
The same thing happens when you set the datasource in the needs datasource event.
private void OrderDetailsTable_NeedDataSource(object sender, EventArgs e)
        {
            if (((Telerik.Reporting.Processing.Table)(sender)).DataSource == null)
                ((Telerik.Reporting.Processing.Table)(sender)).DataSource = Report.DataSource;
        }


How do I set the report datasource, so that I get the page footer information, and set the table datasource so that it has one page of 17 rows?

Thank you for your help,

James Trimmier
James
Top achievements
Rank 1
 answered on 02 Oct 2012
1 answer
116 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
76 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
556 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
129 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
500 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
99 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
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?