Telerik Forums
Reporting Forum
5 answers
563 views
HI All,

I have created a telerik report, In that report i have a table. If the table cell Contains more data then it is rendering to the next page and also it is rendering table header in one page and data in another page. I have tried KeepTogether=false property also but still the problem exist. Please refer the attached screen shot. Please help me.

Thanks,
Satya
Nasko
Telerik team
 answered on 29 May 2014
2 answers
239 views
I am brand new to Telerik Reporting Q3 2011 and brand new to Visual Studio 2010, but I wanted to create a web part for SharePoint 2010 that would display a Telerik Report using a ReportViewer control. It took me a week, countless hours of reading, and some help from proffessionals but I was ultimately able to create the web part that displayed a basic report showing data from an SQL database. I thought I would share my experience with everyone here.

Disclaimer: I am a complete noob at web part developing and may have done things that are not smart or safe to do. However, I did what I did and got the results I was looking for, so follow my lead at your own risk.

Special thanks to: Robby, Moncef, Bary and Gary for helping me with this!


How to create a VisualWebPart in SharePoint 2010 that contains a Telerik ReportViewer control that displays a report. (This assumes you have installed Telerik Reporting on a machine with Visual Studio 2010 and SharePoint Server 2010)

Setting up the SharePoint 2010 server

Follow steps 1-4 in this Telerik guide: http://www.telerik.com/help/reporting/asp-net-report-viewer-deploying-web-reportviewer-in-moss.html

Look on the Details tab of the properties of the Telerik.Reporting.dll file found at (C:\Program Files (x86)\Telerik\Reporting Q3 2011\Bin\Telerik.Reporting.dll) to see what version number you will be using in steps 2 & 3.

1/ Ensure the following .dll files are installed in the Global Assembly Cache: Telerik.Reporting, and Telerik.ReportViewer.WebForms by verifying they exist at C:\Windows\Assembly\

Install them as needed using the gacutil.exe through the Visual Studios 2010 command prompt with the following syntax: gacutil /i “full path to file.dll”

2/ Add the SafeControl lines to your web.config file (mine was located at C:\inetpub\wwwroot\wss\VirtualDirectories\80) using the appropriate Version number.

3/ Register the Handlers required in your web.config file, using the appropriate Version number.

While inside the web.config file, address the note at the bottom of the Telerik guide talking about SessionState by searching ‘enableSessionState’ and ensuring it is set to ‘ <pages enableSessionState="true" …’

Next search the web.config file for ‘name=”Session” ‘ and ensure you have the following two lines of code:
<remove name="Session" />

<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />

Creating the VisualWebPart

In Visual Studios 2010, create a new SharePoint 2010, Visual Web Part, .NET Framework 3.5, Visual C# project

Choose your site for debugging and deploy as a farm solution then click Finish

4/ Drag a report viewer control from the toolbox to the VisualWebPart1UserControl.ascx and it will automatically add the Register line for you.

Modify the Group value property in the Elements.xml to the group you want your webpart to be in

Modify the Title and Description of your webpart as desired within the VisualWebPart1.webpart file

Click Deploy Solution under the Build menu

Add the web part to a page in SharePoint 2010

Open a webpart enabled page on your SharePoint 2010 site in your browser and click the edit button

Click the Web Part button on the Insert tab of the ribbon

Select the Group you named in the Elements.xml file and the Web Part name you used in the .webpart file then click the Add button

Click the save button to view the page normally and if everything is configured correctly you should see the ReportViewer control.

Creating the Report ClassLibrary Project

Open a second Visual Studio 2010 window by right clicking the VS icon on the task bar and selecting the option “Microsoft Visual Studio 2010”

Note: Do not add your new ClassLibrary project to your solution that contains your VisualWebPart project. I did this and started getting “The source of the report definition has not been specified” errors

Click the New > Project option within the File menu

Create a Visual C#, .Net Framework 3.5, Class Library that will hold your reports

Hit (Ctrl + Shft + A) to create a new item in the Class Library then select a Telerik Report Q3 2011 (version may vary)

Cancel out of the report wizard

Select the Page Header section of the report and then hit F4 to bring up its properties

Set the BackgroundColor property within the Style group to ‘Aqua’

Click the Preview tab to see a big cyan rectangle report with no text or data

Right click the ClassLibrary project and select properties then select the Signing tab on the left

Select the “Sign the assembly” check box, click in the drop down box “Choose a strong name key file:” and select “<New…>”

In the Create Strong Name Key dialog box, enter a Key file name like ‘ MyKey1 ‘ and uncheck the “Protect my key file with a password’ checkbox then click the OK button.

Save the ClassLibrary properties by hitting (Ctrl + S)

Click the Build Solution option in the Build menu

Attaching a report to the ReportViewer control

Switch to the Visual Studio 2010 window that has the VisualWebPart project open

Open the Package.package file and click the Advanced button at the bottom left

Click the Add button at the top right and select the “Add Existing Assembly…” option

Using the […] button to the right of the Source Path field, browse to the .dll created in your ClassLibrary’s Debug folder, mine was located here but your path will be different: C:\Vs2010 projects\PalmClassLibraryOfReports\PalmClassLibraryOfReports\bin\Debug\PalmClassLibraryOfReports.dll

Ensure the GlobalAssemblyCache radio button is selected for the Deployment Target and then click the OK button

Save the .package file by hitting (Ctrl + S)

Right click the References and select Add Reference

Select the ClassLibrary project by browsing to it using the Browse tab

Again, Right click the References and select Add Reference

This time Select Telerik.Reporting under the .NET tab or browse to it using the Browse tab

Open your UserControl.ascx.cs file and add the following code to the specified places

Add this to the using section:
using PalmClassLibraryOfReports; (be sure to use the name of your ClassLibrary)

Add this inside the Page_Load block:
        if (!IsPostBack)

        {

            AllTasks AllTasksReport = new AllTasks();

            ReportViewer1.Report = AllTasksReport;

            ReportViewer1.RefreshReport();

        }

(be sure to substitute the name of your report for my “AllTasks” and your ReportViewer ID for my ReportViewer1 which was the default) (you can name this instance of the report anything you want where I have called it “AllTasksReport”)

Save the UserControls.ascx.cs file

Click the Deploy Solution option in the Build Menu

Refresh the web part page to see if everything worked

Go back to the web part enabled page in your browser that contains the ReportViewer control and hit F5 to refresh.

If everything was configured correctly you will see a report generated inside the ReportViewer control with a cyan rectangle.

Connecting a report with an SQL data source to the VisualWebPart

If you would like to see a report with some actual data from an SQL database then continue reading!

 (I am using the AxioWorks SQList service which continuously copies SharePoint data into an easy to navigate SQL database.) http://www.axioworks.com/

Make sure the users that will be logged into SharePoint have security rights to read the SQL database. (I gave the Domain Users group access to my database, but had to enable using groups as logins first) http://stackoverflow.com/questions/5029014/how-to-add-active-directory-user-group-as-login-in-sql-server

 In the Visual Studio 2010 window with the ClassLibrary, hit (Ctrl + Shft + A) to add a new item then select a Telerik Report Q3 2011, name it and click the Add button.

Follow the steps in the Telerik Report Wizard: [Next >], [Next>], [Add New Data Source…], SQL Data Source [OK], [New Connection…], Server name: = localhost [Refresh], Select or enter a database name:=YourDbName [OK], [Next >],[Next>],[Query Builder…], Select Table [Add],[Close], Select a check box next to a column in the table [OK],[Next>],[Execute Query…],[Finish>>|], [Next>], [Next>], Select your table [Detail >],[Next>], [Next>], Select ‘Aspect’ for Style Sheets [Next >], [Finish >>|]

Open the App.config file and notice the connection string that was added. Mine looked like this:

    <connectionStrings>

      <add name="PalmClassLibraryOfReports.Properties.Settings.CrmReports"

connectionString="Data Source=localhost;Initial Catalog=CrmReports;Integrated Security=True" providerName="System.Data.SqlClient" />

    </connectionStrings>

Open the web.config file for your SharePoint site and search for ‘<connectionStrings>’. If you already have a this section, copy paste the line of code which adds the connection string to your database from your app.config file to your web.config file. If you do not have the ‘<connectionStrings>’ section then add it along with the actual connection string found in your app.config file.

In the Visual Studio 2010 window with the VisualWebPart project, open the UserControls.ascx.cs file

Change the name of the report from the basic one to the new one you created that displays data. Be sure to change both occurrences of the old report name.

Click the Deploy Solution option in the Build menu

Go back to your SharePoint page with the VisualWebPart and hit F5 to refresh it

If everything was configured correctly, you will see a report with some data in it.

Stef
Telerik team
 answered on 29 May 2014
1 answer
137 views
Hello,

I have the following situation:
- I use ".trdx" reports created with standalone Report Designer in ASP.Net MVC application
- I have a reserved space for a graph in a report,
- the report is parametrized to select from a database values within a date range, the size of the range could vary significantly from one week or less to one month, three months or even more.

Problem is that if my serie is with daily data then I get too many labels that overlaps over each other. I saw that I can configure LabelStep on the scale but that is a static setting. If I increase the LabelStep to have the labels properly displayed for one month then I remain short on labels.

Ideal solution for my problem would be to have a way to bind LabelStep to a report parameter so I can calculate how big it shall be from outside depending on selected range.
Another solution would be to have somehow a way to configure a maximum number of labels to be displayed for the XAxis and the LabelStep to be adjusted automatically based on that
The desperate solution I was considering also was to dinamically modify the ".trdx" XML report before it get loaded by the report viewer, but didn't found a way to intercept a component/interface that would allow me to do that.

Could you please suggest any option to address this issue?
Thank you,

Vasile


Nasko
Telerik team
 answered on 29 May 2014
3 answers
377 views
I new user on Telerik. I want save my pdf report on server. I want when user click save button report save on server a folder. 
My function is:

 public void SaveReport(string fileName="aaaa")
        {
            Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();
            deviceInfo.Add("DocumentAuthor", "Umut Güncan");
            deviceInfo.Add("DocumentTitle", "İlkPdfKaydı");
            deviceInfo["OutputFormat"] = "JPEG";

            Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
            // reportName is the Assembly Qualified Name of the report
            typeReportSource.TypeName = "Telerik.Reporting.Examples.CSharp.Invoice, CSharp.ReportLibrary";
            Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("ddfe.PDF", typeReportSource, deviceInfo);
            
            fileName = result.DocumentName + "." + result.Extension;
            string path = @"d:\rpr\";
            string filePath = System.IO.Path.Combine(path, fileName);

            using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
            {
                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            }
        }

How can I define assembly name? Reagards...
Stef
Telerik team
 answered on 29 May 2014
3 answers
309 views
I downloaded the the trial binaries from telerik site for WPK Controls and Reporting but found that they were for .Net Framework 4.0 and 4.5.

We are developing a WPF application with 3.5 framework and were looking for using telerik reporting for generating the reports. Can someone please point me to telerik WPF controls and reporting for .Net Framework 3.5?
Stef
Telerik team
 answered on 29 May 2014
4 answers
131 views
When I render a report in a new window using version 11 of Internet Explorer (IE 11) the content gets squished.  See attached image of example.  If I show the ReportViewer refresh button and click it the report renders correctly.  I've tried many different page and report life cycle events to refresh to get it to render correctly on opening, but nothing worked.  I changed the Height setting as well for the ReportViewer and no good still.  It exports fine and renders correctly in IE 10.  I distribute to 2 different versions of IIS and both have the same problem when IE 11 used (7.0 and 7.5 IIS used to test).  I have attached a screen image of what I'm talking about too.

I'm using version 8.0.14.225 of the Reporting control.
The web site is using Framework version 4.
I've set the Height to: 550px, 800px, & 100%.  Always get the same squished result and size on opening of the report.

The report is opened by passing URL for the page that holds the ReportViewer in JavaScript and the command looks like:
window.open(rValue, "Report", "resizable=1,width=1000,height=600");

The page design source is pasted below (I already tried setting id's as specified in other forum post; this also didn't work):
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Audit.aspx.cs" Inherits="Reports_Audit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Audit Report</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:ReportViewer ID="ReportViewer1" runat="server"
ShowParametersButton="False" ShowRefreshButton="False" Width="100%"
Height="500px" ShowDocumentMapButton="False" DocumentMapVisible="False">
</telerik:ReportViewer>
</div>
</form>
</body>
</html>
Stef
Telerik team
 answered on 29 May 2014
2 answers
183 views
I have some large reports 500-1000 pages, they display fine, but they seem to take up a lot of memory on the server.  the w3wp.exe keeps building up.  If I have 500 people opening up a different 500-1000 page report, it seems like it's going to be a major hit on the server.  Is there anyway around this?

I'm using the silverlight viewer.  It would be nice to dump all the data to the client and free up the memory.  I guess maybe I could the the render to pdf option instead of showing the report.  I would guess the server would then get rid of the memory after the file is downloaded.

Maybe there's no way around this and I just have to limit the number of people who can view the reports.  Or I guess I could make a crude report viewer or xaml tree and use silverlight 4's printing.  Then I could just dump all the data to the client.
Stef
Telerik team
 answered on 28 May 2014
1 answer
157 views
I have just put Telerik Reporting (HTML5) into my web application (MVC5), and I have followed the documentation available online, but I have been only partially successful at getting it to display due to an error that comes up within the template itself (below the navigation/toolbar).The error message within the template shows the following:Internal Server Error:

An error has occurred.<br>Could not load file or assembly 'Telerik.OpenAccess, <br>Version=xxxx.x.xxx.x, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' or one of its dependencies. The system cannot find the file specified.

It is not part of the documented install procedure to include a reference to Telerik.OpenAccess... So, I am assuming that this error is stemming from within one of my references that is shipped with Telerik Reporting Q1 2014 (v8.0.14.255)?

I have attached the following references in my application as per this these instructions this and this..
  • Telerik.Reporting
  • Telerik.Reporting.Services.WebApi
  • Telerik.ReportViewer.Mvc
  • Telerik.Reporting.Cache.Database
  • Telerik.Reporting.OpenXmlRendering
  • Telerik.Reporting.XpsRendering

Help would be greatly appreciated in resolving this issue.

Stef
Telerik team
 answered on 28 May 2014
5 answers
352 views
Hi,

           I downloaded Report Designer Q1 2014 yesterday. I want to create Ad Hoc Report for end user.  The tables and columns available in dataset should be available for the end user to select  only the Required column and design their own report.  But the end user will not have Report Designer in their Desktop. Can you please confirm whether this can be done through Telerik.


Thanks,
Jegan Benitto Francis
Stef
Telerik team
 answered on 28 May 2014
1 answer
86 views
I've created quite a few reports with my Q1 2013 version of the report designer and they are run on our web site. I need to get another license for the designer to have as second person creating reports. I'd like to know if they get a new version of the designer and I update both my designer and the dlls on the web site will there be any compatibility issues with the trdx files created with the old designer.

Seems like it should work but if there is anything that I should watch out for I'd be interested to know.

Thanks,
Don Rule
http://translationalsoftware.com
Stef
Telerik team
 answered on 28 May 2014
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?