ActiveReports for .NET 2.0 Visual Studio .NET 2005 Support

Started by kenhales at 11-17-2005 2:06 AM. Topic has 1 replies.

Print Search
Sort Posts:    
   11-17-2005, 2:06 AM
kenhales is not online. Last active: 12/4/2007 6:21:57 PM kenhales

Not Ranked
Joined on 08-28-2004
Posts 1
ASP.NET challenge / resolution / comment

While migrating my code to Visual Studio .Net 2005, I ran into problems getting ActiveReports viewer to work in my ASP pages.  What I wanted to accomplish seemed pretty simple: I had a page that collected some report criteria (select and sort stuff), then filled a typed Dataset, then passed it to an ActiveReports report, then display it in a viewer page.

The documentation was no help.  Neither was the sample code.  The sample code showed some interesting but non-applicable-to-me ways of saving reports to a directory and then viewing the stored report in the directory, or spitting reports out on-the-fly in some raw format.  There's some intriguing stuff there, but where's a simple sample?

In the end I was able to do it pretty much the same way I had done in .Net 2003 (using ActiveReports 3.3.1.2009).  There are 4 steps:

1. Create an aspx page that has the viewer.  This can be as simple as this:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportViewer.aspx.cs" Inherits="ReportViewer" Title="ReportViewer" %>
<%@ Register Assembly="ActiveReports.Web, Version=4.2.0.1186, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" Namespace="DataDynamics.ActiveReports.Web" TagPrefix="ActiveReportsWeb" %>
<!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>ReportViewer</title>
    </head>
 <body>
        <ActiveReportsWeb:WebViewer ID="WebViewer1" runat="server" Height="600" Width="900" />
 </body>
</html>

The only thing different from the past was the version number.

2. In the code-behind, load up the ActiveReport and stick it in the viewer.  Again, this code is pretty simple:

using (the default stuff)
using DataDynamics.ActiveReports;

public partial class ReportViewer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ActiveReport myReport = (ActiveReport)Session.Contents["ReportObject"];
        myReport.Run();
        WebViewer1.Report = myReport;
        WebViewer1.ViewerType = DataDynamics.ActiveReports.Web.ViewerType.ActiveXViewer;
       
    }
}

3. In the web.config file, add the httpHandlers info in the system.web section like this:

    <httpHandlers>
      <add verb="*" path="*.rpx" type="DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=4.2.0.1186, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
      <add verb="*" path="*.ActiveReport" type="DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=4.2.0.1186, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
      <add verb="*" path="*.ArCacheItem" type="DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler, ActiveReports.Web, Version=4.2.0.1186, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" />
    </httpHandlers>

4. In IIS, in the properties site, in the Home Directory tab in the Configuration button, entries for ActiveReport, ArCacheItem, and rpx.  There is a KB article that talks about this at http://www.datadynamics.com/ShowPost.aspx?PostID=574.

And that's that.  So here's my comment:

It should not have been so difficult to figure this all out.  I had to do a bunch of digging to find the information.  There is no mention of the <ActiveReportsWeb:WebViewer> tag approach anywhere in the "ActiveReports for .NET 2.0" documentation or samples.  There is no mention of the entries in the web.config file or the IIS ISAPI extensions stuff -- or mention that if you don't do this you get a "Error 5013: Invalid DataPath. Cannot Load Data" error.  This error message does not give any hint of 'oh, I forgot to update my web.config and IIS'.

Just my two cents.  I like ActiveReports -- it's great.  Keep up the good work.


   Report 
   11-18-2005, 12:32 PM
Michael is not online. Last active: 12/20/2011 6:40:04 PM Michael

Top 10 Posts
Joined on 04-23-2003
Columbus, OH
Posts 2,494

DDVIP
Re: ASP.NET challenge / resolution / comment
Thanks for the post Ken -

The website project changes have made what was once something relatively simple something that is much harder to accomplish.  We are working on a set of information that should be included with the final release with support for VS.NET 2005 which will include directions and recomendations for how to use ActiveReports for .NET in an ASP.NET 2.0 website environment.  You will be able to find this section in the readme that pops up on the final install under Visual Studio .NET 2005 FAQ.  Again, thanks for the post and be sure to let us know if you run into other problems.

Michael Mason

   Report 
GrapeCity » Forum Archives » ActiveReports f... » ASP.NET challenge / resolution / comment

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.