This is a migrated thread and some comments may be shown as answers.

newbie stymied

4 Answers 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 28 Jul 2010, 03:19 PM
I am trying to put together a few reports - and can't seem to get the Telerik reports to work
here's what I did and how far I got

I added Telerik.Reporting and Telerik.ReportViewer,WebForms as reference to my web app
the verision is 4.1.10.714
the site is ASP.NET 4.0 created under Visual Studio 2010 with a SQL Server 2005 database

I had already created a view for my data
I added a New Item Telerik Report Q2 2010 - which Visual Studio wanted to put in the App_Code folder
I left clicked and opened View Designer

the menu item Telerik -> Reporting -> Report Wizard
I built a data source from the view, added a ConnectionString to the web config and hit Execute Query - it had 22 items
selected the fields
the data source control is at the bottom of the report
it shows on the left in Data Explorer
I built the report from the data source with the Report Wizard but Preview and HTML Preview are blank
what happened to the 22 records?
if the report is tied to the data source control and the data source control can locate data why can't the report?

also, to run the report, should I create a new page and add a Report Viewer to it, then create a report and move it into the viewer?
Help!
thanks

Marianne

4 Answers, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 29 Jul 2010, 02:18 PM
I added a web page to the application, added a Telerik Report viewer
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AllReports.aspx.vb" Inherits="AllReports" %>
<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=4.1.10.714, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %>
<!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>Show Badge Request Form - Reports</title>
    <link href="MDE2010.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="JavaScript">
    <!--  
    -->
    </script>
</head>
<body>
<img src="Images/Masthead.gif" alt="header" />
<table width="800" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
    <telerik:ReportViewer ID="rvReports" runat="server">
    </telerik:ReportViewer>
    </td>
    </tr>
</table>
</body>
</html>
on the Page Load instantiated the report, set the report viewer report to it

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ReportNumber As Integer = 0
        Dim ReportName As String = String.Empty
        Dim newReport As Object = Nothing
        If Page.IsPostBack Then
            Exit Sub
        End If
        If Request.QueryString("ReportNumber") Is Nothing Then
            Exit Sub
        End If
        ReportNumber = CInt(Request.QueryString("ReportNumber"))
        Select Case ReportNumber
            Case 3
                newReport = New DealerAttendees
        End Select
        rvReports.Report = newReport
    End Sub

got a System.IO.FileNotFoundException
{"Could not find file 'App_Code.8bzcqdlb.resources'.":Nothing}
here        'dsDealerAttendees
        '
        Me.dsDealerAttendees.ConnectionString = "BrunswickReports"
        Me.dsDealerAttendees.Name = "dsDealerAttendees"
-->        Me.dsDealerAttendees.SelectCommand = resources.GetString("dsDealerAttendees.SelectCommand")

what is going on here?
0
Elliott
Top achievements
Rank 2
answered on 02 Aug 2010, 03:20 PM
with the assistance of Steve from Telerik I wrote a simple report

the first step was to create the report as a stand-alone Windows application
I created a new Windows application, deleted the default Form1.vb then added a Class Library
I have to hunt down the Property Pages to make sure the dll was something meaningful, not Library1 or something

I went through the Report Wizard - the trick is NOT to create a ConnectionString - put the ConnectionString properties hard-coded in the dataset
I still can't figure out how to put more than one field on a Group Header

I built and created a dll
then moved the entire contents of the bin to the bin of the web application

I wrote a web page to display the report
I added as references both the Telerik Reporting and the Web Report Viewer
to keep the report viewer from blowing up I needed to add this to the code behind of the web page that held the Report Viewer
Visual Studio will try to add a call to MyBase.VerifyRenderingInServerForm - that needs to be deleted (it's what's bombing out)
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As System.Web.UI.Control)
End Sub

instantiate the report, set the report viewer to it

now if I could only figure out how to update a report
0
Peter
Telerik team
answered on 03 Aug 2010, 10:48 PM
Hi Marianne Seggerman,

As outlined in the Best Practices help article, you should host the reports in a separate class library instead of directly in your web site. Web site projects have several limitations that do not allow our designer to function properly. In order to view the report in a Web Site you have to add a Web Report Viewer to a  WebForm. Please check out the Embedding the Web Report Viewer on a Web Form.

Kind regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Elliott
Top achievements
Rank 2
answered on 04 Aug 2010, 01:07 PM
I mostly found the answer on my own, with the able assistance of Steve from the Telerik team
so OK mark as complete
Tags
General Discussions
Asked by
Elliott
Top achievements
Rank 2
Answers by
Elliott
Top achievements
Rank 2
Peter
Telerik team
Share this question
or