473,570 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Active Reports v1.1 via the COM Interlop



Hi,

I am trying to use Active Reports v1.1
(Build 1.1.0.84) in a ASP.NET application.

Is it possible to use it through the COM interlop
as Crystal Reports for .NET which comes built in
with VS.NET doesnt work properly.

Rgs,
Mehul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
3 3390
hi,

1) Basically you can use any COM object from ASP.NET. If the COM object
run as STA (single thread apartment) you should add AspCompat attribute
to your page. AspCompat change your page thread model so it won't run as
multi-thread.

2 ) there is ASP.NET version of Active report 2.0 :
http://www.datadynamics.com/Products...?Product=ARNET

3) What the problems with crystal? you can consult their site
(http://www.businessobjects.com/produ...ult.asp?ref=de
vzone_netzone_n av) or post them here.
Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2


Thanks,

What i was looking is a 'How to Guide' - step by step if somebody has
done that. I also have Active Reports v2.
I dont see a need to buy Active Reports.NET if i can use Active Reports
v2 via COM.

Regarding Crystal Reports, I have done what they suggest - i have
already spent too much time on it.

My experience with Active Reports is positive on the other hand.

Rgs,
Mehul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3


Hi,

Something that I came across from Active Reports helpfiles is that
you can use ARViewer (arviewer.ocx) to view reports in IE (using VB 6).

Below is the way to go about it (in the help files):
_______________ _______________ _______________ _______________ ____________
_______________ _

This is an example of inserting the viewer control into your page. You
will need to set up a licensing package file (LPK) as described in
Microsoft’s Internet Client SDK.

<Object ID="ARViewer1" WIDTH="869" HEIGHT="1143"
CLASSID="clsid: 00C7C2A0-8B82-11D1-8B57-00A0C98CD92B"
codebase="arvie wer.cab">

</Object>
<Script LANGUAGE="VBScr ipt">

<!—
' Set the data path to the relative path
' of your pages output
Sub Window_onLoad()

ARViewer1.DataP ath="salesbycou ntry.rdf"

End Sub
-->
</Script>

You can use ActiveReports to serve reports from your web server. You
will need to create an ActiveX DLL that combines all your reports with a
class that manages running and saving the reports to either an RDF
format or a PDF format.

The class will create an instance of the requested report and save it to
a directory where the ASP script can push it to the client.

Public Property Let Report(iRpt As eReport)
Dim hr As Long

Debug.Print "Report: ", iRpt

m_iReport = iRpt
End Property

Public Property Let OutputFormat(iF ormat As eOutputFormat)

Debug.Print "OutputForm at: ", iFormat

m_iFormat = iFormat
End Property

Public Property Get FileName() As String

Debug.Print "FileName"

m_sFName = StripFileName(m _sFName)
FileName = m_sFName
End Property

Public Function RunReport() As Boolean
Dim rpt As Object
Dim pdf As New ActiveReportsPD FExport.ARExpor tPDF
Debug.Print "RunReport"
Select Case m_iReport
Case erptAnnualRepor ts: Set rpt = New rptAnnualReport
Case erptCatalog: Set rpt = New rptCatalog
Case erptCustomerLab els: Set rpt = New rptCustomerLabe ls
Case Else
RunReport = False
Exit Function
End Select

rpt.Run False

m_sFName = String(255, Chr$(0))
' GetTempFileName is a Win32 API function, you need
' to add the declaration in one of your modules

If Not GetTempFileName (sServerPath, "AR", -1, m_sFName) Then

RunReport = False
Exit Function
End If

m_sFName = Left$(m_sFName, InStr(m_sFName, Chr$(0)) - 1)
Debug.Print m_sFName
If m_iFormat = eRDF Then
rpt.Pages.Save m_sFName
ElseIf m_iFormat = ePDF Then
pdf.FileName = m_sFName
pdf.Export rpt.Pages
End If

Unload rpt
Set rpt = Nothing
Set pdf = Nothing
RunReport = True
End Function


The ASP script will set the two properties Report and Output Format then
run the report.
<%@ LANGUAGE="VBSCR IPT" %>

<%
Dim rptServer
Dim fname
Set rptServer = CreateObject("A RASPSample.Repo rtServer")
rptServer.Repor t = Request.Form("c boReport")

rptServer.Outpu tFormat = 1
If rptServer.RunRe port() Then
fname = rptServer.FileN ame
%>

<CENTER>

<OBJECT ID="arv" WIDTH=95% HEIGHT=95%
CLASSID="CLSID: 00C7C2A0-8B82-11D1-8B57-00A0C98CD92B"
CODEBASE="../bin/arviewer.cab">
<PARAM NAME="_ExtentX" VALUE="17674">
<PARAM NAME="_ExtentY" VALUE="10478">

</OBJECT>
</CENTER>
<BODY FONT="Arial">
<script LANGUAGE="VBScr ipt">

<!--
Sub window_onload()
' set the initial reportsource data path

arv.DataPath="R eports/<%Response.Writ e fname%>"

end sub
-->
</script>
<%else%>
<BODY>
<P>
Error: Unable to create report.<BR>

Please send email to <A
HREF="mailto:Ac *************** ****@DataDynami cs.com">ActiveR eports.Suppo
rt@DataDynamics .com</A><BR>

</P>
<%end if%>
</BODY>

_______________ _______________ _______________ _______________ ____________
_______________ _

By idea is to convert the above sample to Asp.NET.

So we get:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Web Form2.aspx.vb"
Inherits="Acces sReportAutomati on.WebForm2"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm2 </title>
<meta content="Micros oft Visual Studio.NET 7.0"
name="GENERATOR ">
<meta content="Visual Basic 7.0" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post" runat="server">
<OBJECT id="ARViewer1" style="WIDTH: 448px; HEIGHT:
422px" codeBase="arvie wer.cab" height="422" width="448"
classid="clsid: 00C7C2A0-8B82-11D1-8B57-00A0C98CD92B" VIEWASTEXT>
<PARAM NAME="_ExtentX" VALUE="9483">
<PARAM NAME="_ExtentY" VALUE="8932">
</OBJECT>
</form>
</body>
</HTML>

Its the next part of creating a class that gives problems (have called
the class
- Mehul_class). Here's the code:
Imports System.Diagnost ics

Public Class Mehul_Class
Public Property Report(ByVal iRpt As eReport)
Get

Dim hr As Long

Debug.Write("Re port: ", iRpt)

m_iReport = iRpt

End Get
Set(ByVal Value)

End Set
End Property

Public Property Let OutputFormat(iF ormat As eOutputFormat)

Debug.Print "OutputForm at: ", iFormat

m_iFormat = iFormat
End Property
Public Property FileName() As String
Get
Debug.Write("Fi leName")

m_sFName = StripFileName(m _sFName)
FileName = m_sFName

End Get
End Property
Public Function RunReport() As Boolean
Dim rpt As Object
Dim pdf As New ActiveReportsPD FExport.ARExpor tPDF()
Debug.Write("Ru nReport")
Select Case m_iReport
Case erptAnnualRepor ts : rpt = New rptNewReport()
Case erptCatalog : rpt = New rptCatalog()
Case erptCustomerLab els : rpt = New rptCustomerLabe ls()
Case Else
RunReport = False
Exit Function
End Select

rpt.Run(False)

m_sFName = String(255, Chr$(0))
' GetTempFileName is a Win32 API function, you need
' to add the declaration in one of your modules

If Not GetTempFileName (sServerPath, "AR", -1, m_sFName) Then

RunReport = False
Exit Function
End If

m_sFName = Left$(m_sFName, InStr(m_sFName, Chr$(0)) - 1)
Debug.Write(m_s FName)
If m_iFormat = eRDF Then
rpt.Pages.Save( m_sFName)
ElseIf m_iFormat = ePDF Then
pdf.FileName = m_sFName
pdf.Export(rpt. Pages)
End If

Unload(rpt)
rpt = Nothing
pdf = Nothing
RunReport = True
End Function
End Class

Question is what do i convert
Public Property Let OutputFormat(iF ormat As eOutputFormat)

Debug.Print "OutputForm at: ", iFormat

m_iFormat = iFormat
End Property
into as vb.net doesnt support it? Also statements like

m_iReport = iRpt

in the 1st Report property - give an error that "Name m_iReport is not
declared".

However if in the help files is not declared anywhere (or am i missing
something?).
[See above for code that was provided in the help files].
Pls help,
Rgs,
Mehul

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1902
by: Oscar | last post by:
I am quite new to the ASP scene. I want to display the results of a recordset into a third party grid control called VSFlexgrid. I've prepared one asp page which queries an Access database and holds the object in which the results should be writte. I've tried two options : 1. The grid active-X component was instantated within the html part...
11
6567
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am...
4
4930
by: CsaaGuy | last post by:
I get OS errors when I run active reports from code. The first error is with this code (beware of the commented out code) Dim oPrinter As New System.Drawing.Printing.PrintDocument oPrinter.PrinterSettings.PrinterName = "\\CSSFVPNT01\PSFB1F2BL01" Dim oReport As New Report01 'oReport.Document.Printer.PrinterName =...
2
3230
by: Jm | last post by:
Hi All Im not sure of which way to go about this so ill start by explaining what im trying to do and the options ive come up with. ok.. I have a client program which talks to an sql server database whenever a machine is turned on. It reports the client machine status to the server and accepts incoming tcp connections for various...
0
880
by: Enver A | last post by:
Hi There, I am having difficulties on using Active Reports on vb.net . I have succesfully tried and executed designing and printing a report but what i am trying to do is to design an End-User designer. I can send parameters while i am attaching a reader to the report. But What if a client wnats to design a report on End-User designer. How...
1
5328
by: ATroy | last post by:
Hello! So far, I can't find any information on making a connection to active directory for reports in visual studio .net 2003. From the list of Available Data Sources I select "OLE DB (ADO)" and from the list of OLE DB Providers I select "OLE DB Provider for Microsoft Directory Services". On the next screen where I put in my data source I...
3
8911
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data from sql server) and I was wondering whish of these is the better tool .. We're still not sure if they'll be loaded from an existing VB6 application...
1
1221
by: z | last post by:
hi i want to ask how can we retrieve data from MS sql server table northwind and generate report of same data in formated form in MS word using VB.net ... i need its code can any one help please .. its real urgent .. i m currently using Visual Studio 2003 ... and MS SQL server 2003 thanks in advance...
0
2167
by: PughDR | last post by:
As the subject of this topic suggestions I am trying to find a way to use ASP, SQL Server, Com+ and Crystal Reports 8.5 to Create Dynamic PDF Reports Over The Web, but the only article I found that decribes this process is located on ASPToday.com which is no longer an active website. When I try and suscribe to the site I just get a message...
0
7637
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7950
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8151
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5523
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3684
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2133
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.