Telerik Forums
Reporting Forum
2 answers
262 views
Hello,

I'm designing an application that will produce a number of different reports.  There are three pages for each report and a number of different possible configurations for each page.  There are also completely custom configurations for two of the pages.  I'm storing the name of each custom report in a database and have been able to initialize and display a single report.

var typeSource = new TypeReportSource();
typeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportName);
typeSource.Parameters.Add("id", _id);

this.rvMainView.ReportSource = typeSource;
...
...


I've also been able to display multiple pages of the standard templates by using a reportbook:

var rbBookSource = new ReportBook();

var pageOne = new ReportPageOneType();
pageOne.Parameters.Clear();
pageOne.Parameters.Add("id", ReportParameterType.Integer, _id);
rbBookSource.Reports.Add(pageOne);

var pageTwo = new ReportPageTwoType();
pageTwo.Parameters.Clear();
pageTwo.Parameters.Add("id", ReportParameterType.Integer, _id);
rbBookSource.Reports.Add(pageOne);

this.rvMainView.ReportSource = rbBookSource;
...

What I cannot figure out how to do is to merge/combine these two pieces of functionality:

var rbTypeBook = new ReportBook();

var p1TypeSource = new TypeReportSource();
p1TypeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportPageOneName);
p1TypeSource.Parameters.Add("id", _id);
rbTypeBook.Reports.Add(p1TypeSource);

var p2TypeSource = new TypeReportSource();
p2TypeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportPageTwoName);
p2TypeSource.Parameters.Add("id", _id);
rbTypeBook.Reports.Add(p2TypeSource);

this.rvMainView.ReportSource = rbBookSource;
...

Is this possible in any way?

Thanks.
Jonathan
Top achievements
Rank 1
 answered on 10 Oct 2014
1 answer
218 views
Hi, 

I'm not able to filter data in my subreport. I'm trying to add filters to a report and a subreport with the following code. As you can see, I define a filter for the report according to the value selected in a ASP.NET dropdown control. Filters works fine in report (using fillters.addrange method), but it's impossible for subreport.

    Protected Sub Search()
        Try
            Dim rs As InstanceReportSource = DirectCast(Me.rviewer.ReportSource, InstanceReportSource)
            Dim filters As New Telerik.Reporting.FilterCollection
            Dim filterApoyo As New Filter()
            filterApoyo.Expression = "=Fields.IdApoyo"
            filterApoyo.Operator = FilterOperator.Equal
            filterApoyo.Value = "='" + ddlApoyos.SelectedValue + "'"
            filters.Add(filterApoyo)
 
            Dim repProt As ReportProtocolo = DirectCast(rs.ReportDocument, ReportProtocolo)
            repProt.Filters.AddRange(filters)
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

(Note I have not added code for subreport filtering, because I tried a lot of different options and didn't work.) 

Is there any example to add filters programatically to a subreport, please? I can only see examples for reports... 

Thanks in advance. Best regards, 
Hinata
Top achievements
Rank 1
 answered on 10 Oct 2014
1 answer
51 views
I seem to be having trouble with what I think is a very simple newbie issue.

I am unable to get information from my datasource into text areas on the reportHeader.

Originally I had a datasource bound to my report and at that point I had access to the fields I needed to print in the reportHeader.
However when I got to the details section and attempted to bind the datasource to a table so that I could print out the rows, I noticed that I was getting the same data over and over again.
Trolling through your forums revealed that this was solvable by only binding my dataset to the table and not to the whole report, which I did.
That solved the duplicate data in the table problem but now none of the reportHeader text boxes have nothing in them.
Can you tell me what I am doing wrong?

Thank you,

Jim

Nasko
Telerik team
 answered on 10 Oct 2014
1 answer
767 views
I am wondering if there is guidance on editing the Report Viewer template html file. I see the section for the multi-select parameter but if I change it to anything other than a list I get a java script error that "var children = listView.element.children();" saying 
"jquery-1.10.2.js:7093
Uncaught TypeError: Cannot read property 'element' of null "

I would like to use a multi-select dropdown list instead of just a list, as we have over 100 items in the parameter options.

Thanks,

Jim
Stef
Telerik team
 answered on 10 Oct 2014
1 answer
249 views
I'm using Reporting 2013 Q1 in a WPF application. We have several reports which are displayed in a Report Viewer using ViewMode.PrintPreview.

On one of our reports, which has several graphs we sometimes get an error generated by the report ( i.e the report loads and the query is run, data is successfully returned, but the report viewer itself generates the error).

Error is:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Any ideas what this could be?



Stef
Telerik team
 answered on 10 Oct 2014
5 answers
436 views
Hello,

From the documentation, it doesn't seem hard to create a report programmatically: 

Telerik.Reporting.Report report = new Telerik.Reporting.Report();
  
            string sql = @"SELECT * FROM Recipient";
            string connectionString = "Data Source=EVAN-PC\\SQLEXPRESS;Initial Catalog=AccufloMaster;Integrated Security=True;User ID=sa;Password=creative";
            System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(sql, connectionString);
            report.DataSource = adapter;
            report.Name = "recipientReport";
              
            return View(report);




However, After I have the report created, how do I view it using the MVC report viewer (which I already have set up). Are there some additional properties I need to set? Ideally, I thought I could just pass the entire Report object to the view and into the viewer, but there is no overlord for that. So once I have the report created programmatically (I have to do this for reasons beyond this thread), how I can view it in the report viewer?


@model Telerik.Reporting.Report
 
 
@using Telerik.Reporting.Examples.CSharp
@{
    ViewBag.Title = "Telerik HTML5 Report Viewer MVC Demo";
}
 
@section styles
{
 
 
 
    <style>
        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>
 
    <link href="@Url.Content("~/ReportViewer/styles/telerikReportViewer-8.1.14.804.css")" rel="stylesheet" />
}
 
@{
    var typeReportSource = new TypeReportSource() { TypeName = typeof(ReportCatalog).AssemblyQualifiedName };
   // typeReportSource.Parameters.Add("OrderNumber", Model.SelectedInvoice);
    //ReportSource(new UriReportSource() { Uri = "Product Catalog.trdx" })
}
 
 
@(Html.TelerikReporting().ReportViewer()
        // Each report viewer must have an id - it will be used by the initialization script
        // to find the element and initialize the report viewer.
        .Id("reportViewer1")
        // The url of the service which will provide the report viewer with reports.
        // The service must be properly configured so that the report viewer can
        // successfully communicate with the server.
        // For more information on how to configure the service please check http://www.telerik.com/help/reporting/telerik-reporting-rest-conception.html.
        .ServiceUrl(Url.Content("~/api/reports/"))
        // The url for the report viewer template. The template can be edited -
        // new functionalities can be added and unneeded ones can be removed.
        // For more information please check http://www.telerik.com/help/reporting/html5-report-viewer-templates.html.
        .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html"))
        // Strongly typed ReportSource - TypeReportSource or UriReportSource.
        .ReportSource(Model.Name)
        // Specifies whether the viewer is in interactive or print preview mode.
        // PRINT_PREVIEW - Displays the paginated report as if it is printed on paper. Interactivity is not enabled.
        // INTERACTIVE - Displays the report in its original width and height witn no paging. Additionally interactivity is enabled.
        .ViewMode(ViewModes.PRINT_PREVIEW)
        // Sets the scale mode of the viewer.
        // Three modes exist currently:
        // FIT_PAGE - The whole report will fit on the page (will zoom in or out), regardless of its width and height.
        // FIT_PAGE_WIDTH - The report will be zoomed in or out so that the width of the screen and the width of the report match.
        // SPECIFIC - Uses the scale to zoom in and out the report.
        .ScaleMode(ScaleModes.SPECIFIC)
        // Zoom in and out the report using the scale
        // 1.0 is equal to 100%, i.e. the original size of the report
        .Scale(1.0)
        // Sets whether the viewer’s client session to be persisted between the page’s refreshes(ex. postback).
        // The session is stored in the browser’s sessionStorage and is available for the duration of the page session.
        .PersistSession(false)
        // Sets the print mode of the viewer.
        .PrintMode(PrintMode.AutoSelect)
)
 
@section scripts
{  
    <!--kendo.all.min.js can be used as well instead of kendo.web.min.js and kendo.mobile.min.js-->
    <script src="@Url.Content("~/ReportViewer/js/telerikReportViewer-8.1.14.804.js")"></script>
 
    <!--kendo.mobile.min.js - optional, if gestures/touch support is required-->
 
}

Stef
Telerik team
 answered on 10 Oct 2014
5 answers
498 views
I am currently working on a Range Bar graph that has dates on it.
It reads data from a database and displays properly, my only problem is that when there is a lot of data the rows (shrink) get very small to allow for all the data to fit.  Is there a way to adjust the rows so that they stay a constant height and the graph itself grows in height to fit all the data points?

This first image is one that doesnt have many datapoints in it:


then once I add more data into the database i get this:

So is there any way to keep the rows a constant height and just increase the total high of the graph to fit the extra data in without making it smaller?

Thanks








Nasko
Telerik team
 answered on 10 Oct 2014
3 answers
392 views
I built a small test web application using your mvc how to and example reports and everything worked great. I then replicated my steps inside of a larger web application and when I try to bring up a report inside the html 5 viewer now I get an "Internal Server Error: undefined" message inside the viewer. No further information that I can see. What can I do to find out what's wrong? Trial and error so far has not resulted in anything...

Thanks
Jan
Top achievements
Rank 1
 answered on 09 Oct 2014
8 answers
472 views
Hi,

We have installed Report Designer Q2 2014, Visual Studio Express 2012 for Web and Oracle DB 11g. Right now I am able to design a report, connect to the Oracle DB by using SqlDataSource and able to preview the report contents as well.

Now in Visual Studio Web Forms Solutions, I have couple of issues:

Issue 1:

When I added the Telerik controls to Toolbox section from 'C:\Program Files (x86)\Telerik\Reporting Q2 2014\Bin\Telerik.Reporting.dll', it added all the controls but only ReportViewer is enabled and rest are disabled. In my understanding I cannot use any Telerik controls except the ReportViewer, why is these disabled?

Issue 2:

I have added the ReportViewer to my aspx page and have set the ReportSource to the .trdx file I designed. When I run that web page to view the report I am keep getting a error as below:

-----------
An
error has occurred while processing Table 'table1':
A network-related or instance-specific error occurred while establishing
a connection to SQL Server. The server was not found or was not
accessible. Verify that the instance name is correct and that SQL Server
is configured to allow remote connections. (provider: Named Pipes
Provider, error: 40 - Could not open a connection to SQL Server)
------------- InnerException -------------
The network path was not found
--------------

As I had read in one of the thread (sorry I am not able to get that thread link) that, we need to install ODP.Net to connect to the Oracle DB from VS.Net. So I had installed the ODP.Net (ODAC121012) as well. But still I am getting the same error. One thing, I am not able to understand is, even though I have connected the Report to Orcle DB, why in the error it's says that 'Could not open the connection to SQL Server'.

Can some one please guide me on this as earliest?

Regards,

Sree Harshavardhana
Sree Harshavardhana
Top achievements
Rank 1
 answered on 09 Oct 2014
4 answers
512 views
I followed the wizzard and made no changes to the report layout besides what the wizzard did and when I export to Excel there are two extra blank rows between every row of data.  What is causing this?

The report has a labels group header and detail...
Stef
Telerik team
 answered on 09 Oct 2014
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?