Telerik Forums
Reporting Forum
1 answer
161 views
Hi,

I try to build up the report definition dynamically. The exact report definition depends on the data sent to the contructor (eg, dynamic number of colums). But Telerik Report seems to call the parameterless constructor where we do not have the needed data to build up the report definition. Why do we need a parameterless constructor  and why are multiple instances created with the parameterless constructor?

I have an sample ASP.NET MVC 4 project exemplifying this scenario but i cant attach it,
How do i attach a sample project?

Thanks in advance

Tommy
Elian
Telerik team
 answered on 03 Oct 2012
1 answer
262 views
Hello,

Our client/server application project is at a crossroads report technology wise. We have been experimenting with Telerik Reporting, creating a prototype in which the report definitions are stored as Xml in a database on the server side, deserialized and presented client side. The report data sources are domain model objects passed from the server to the client. An unconditional demand from our product owner is that end-users are given the opportunity to edit existing reports, and also create new alternative ones. We were unable to fully accomplish this using existing Telerik Reporting technology, since the only report editing capabilities provided is the stand-alone report designer. This designer, although for it's purposes fully functioning, provides no alternatives for datasource that are useful to us.

What we would need to know, to be able to make an informed decision regarding Telrik as vendor, is whether a report designer component that can be embedded in our WPF client application is in the Reporting roadmap. And, if so, when this might be available. The reason we need this, apart from not having to temporarily store the Xml-definition clientside as a trdx-file, is to be able set the data source programatically, enabling the end-user to add report fields through drag & drop.

Best regards
Rikard
Steve
Telerik team
 answered on 03 Oct 2012
2 answers
237 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
464 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
317 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
99 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
69 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.5K+ 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
533 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
105 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
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?