Hi,
I am working on a Installer Project, which requires to deploy SQL Server 2005 Reports (.rdl files) and Datasource (.rds file). The datasource is common for all reports. The report files are available in multiple folders (under D:\TestReport) and the .rds file is in a folder called 'Data Sources'. I wrote a VB.Net console application to do the task. I am able to deploy the report files under the specified folders. But I don't know how to deploy the rds file and assign that datasource to the report files.
I have created s datasource based on the input. The datasource is created, but when I browse the reports, the error "The report server cannot process the report. The data source connection information has been deleted. (rsInvalidDataS ourceReference) " appears. Herewith I have attached the code I used. Somebody please help me in this regard.
Thanks,
Bala - Module Module1
-
Sub Main(ByVal Arg() As String)
-
Try
-
'If Arg.Length < 5 Then Exit Sub
-
Dim DBServer As String = "Server" 'Arg(0)
-
Dim DBName As String = "DBName" 'Arg(1)
-
Dim ReportServerURL As String = "http://localhost/ReportServer1/ReportService2005.asmx" 'Arg(2)
-
Dim ReportsParentFolder As String = "C:/TestReport" 'Arg(3)
-
Dim ReportParentFolderName As String = "DB Reports" 'Arg(4)
-
-
Dim RServices As New ReportingService2005.ReportingService2005()
-
RServices.Credentials = System.Net.CredentialCache.DefaultCredentials
-
RServices.Url = ReportServerURL
-
RServices.CreateFolder(ReportParentFolderName, "/", Nothing)
-
-
Dim ReportPath As String = ""
-
Dim ReportDef() As Byte
-
Dim DirInfo As New DirectoryInfo(ReportsParentFolder)
-
Dim CurrentFolderName As String = ReportsParentFolder
-
Dim CurReportFolderName As String = "/" & ReportParentFolderName
-
-
' Create datasource for the report.
-
Dim dDefinition As New ReportingService2005.DataSourceDefinition()
-
dDefinition.Extension = "SQL"
-
dDefinition.ConnectString = "Data Source=" + DBServer + ";Initial Catalog=" + DBName
-
dDefinition.ImpersonateUser = False
-
dDefinition.ImpersonateUserSpecified = True
-
dDefinition.Prompt = Nothing
-
dDefinition.WindowsCredentials = True
-
dDefinition.CredentialRetrieval = ReportingService2005.CredentialRetrievalEnum.Store
-
dDefinition.Enabled = True
-
dDefinition.EnabledSpecified = True
-
dDefinition.UserName = ""
-
dDefinition.Password = ""
-
dDefinition.WindowsCredentials = True
-
-
For Each RdlFile As FileSystemInfo In DirInfo.GetFileSystemInfos
-
If RdlFile.GetType.Name = "DirectoryInfo" Then ' it is a folder
-
RServices.CreateFolder(RdlFile.Name, "/" & ReportParentFolderName, Nothing)
-
CurrentFolderName = ReportsParentFolder & "/" & RdlFile.Name
-
CurReportFolderName = CurReportFolderName & "/" & RdlFile.Name
-
-
Dim DirInfo1 As New DirectoryInfo(RdlFile.FullName)
-
For Each RdlFile1 As FileSystemInfo In DirInfo1.GetFileSystemInfos
-
If RdlFile1.GetType.Name <> "DirectoryInfo" Then
-
ReportPath = RdlFile1.Name
-
Dim File As New FileStream(CurrentFolderName & "/" & ReportPath, FileMode.Open)
-
ReportDef = New Byte(File.Length) {}
-
File.Read(ReportDef, 0, CInt(File.Length))
-
File.Close()
-
-
If LCase(Mid(RdlFile1.Name, RdlFile1.Name.Length() - 2)) = "rdl" Then
-
RServices.CreateReport(ReportPath.Remove(ReportPath.Length - 4, 4), CurReportFolderName, True, ReportDef, Nothing)
-
End If
-
If LCase(Mid(RdlFile1.Name, RdlFile1.Name.Length() - 2)) = "rds" Then
-
RServices.CreateDataSource("ReportData", "/" & ReportParentFolderName & "/Data Sources", False, dDefinition, Nothing)
-
End If
-
-
End If
-
Next
-
Else ' it is a rdl file
-
ReportPath = RdlFile.Name
-
Dim File As New FileStream(CurrentFolderName, FileMode.Open)
-
ReportDef = New Byte(File.Length) {}
-
File.Read(ReportDef, 0, CInt(File.Length))
-
File.Close()
-
RServices.CreateReport(ReportPath.Remove(ReportPath.Length - 4, 4), CurrentFolderName, True, ReportDef, Nothing)
-
End If
-
CurReportFolderName = "/" & ReportParentFolderName
-
Next
-
-
Catch ex As Exception
-
Console.WriteLine(ex.Message)
-
End Try
-
End Sub
-
End Module
3 6564
It sounds like the RDL is not set correctly to point to where the datasource is being deployed. You can either change the RDL or call SetItemDatasour ces (RS 2005) or SetReportDataso urces (RS 2000) to set the data source to point to the shared data source. HTH.
Thanks for your response.
I tried using SetItemDatasour ces, but could not succeed. It will be very helpful, if you can provide me a code sample. Thanks in advance.
Then show us what you tried. Thanks.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tim_Mac |
last post by:
hi,
i read the crystal reports documentation on deploying for asp.net, but
they tell you to build a web setup project, which i presume is an msi.
i only have FTP access to the web server and hence can't run MSI's on
it. does this mean i can't use CR in my web app? is there any way
around it?
thanks
tim
|
by: Robert Warnestam |
last post by:
Hello,
I have some problems deploying Crystal Reports.
I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports
(9.7.3500.0) is included. I created a small test application (ASP.NET) that
shows a simple report. It work fine with on my local computer. Now I'm
trying to deploy this sample application on our web server but I really need
some help.
|
by: Aaron Schnieder |
last post by:
Hi,
I have developed an ASP .NET application which using Crystal Reports for my
reporting needs. My local development is Windows XP Pro with IIS and Visual
Studio .NET 2003. The ASP .NET site and the reports I have written work great
on my local IIS environment, the problem comes in when I try to deploy my
application to my ASP .NET server.
I have signed up for an ASP .NET business account with 1and1.com. The ASP
..NET works great on...
|
by: Martin Widmer |
last post by:
Hi guys
I am looking for the best way to generate new reports with reporting
services for SQL server 2005. The reports will be generated programmatically
from a .Net VB application. So far I see the only way to do it is to feature
my objects (text blocks, pictures, tables drawn from excel and databases
etc.) with a "render to RDL"- function and thus create an RDL definition of
the report, then push that one to the server using the...
|
by: Brian McClellan |
last post by:
Just wondering if anyone has a simple example of creating a gridview
completely programmatically, i'm not doing anything terribly sophisticated.
When creating the gridview declaratively evertying works fine, however
programmatically, while the grid will display data that exsists in the
database, any operation on the data ( editing/updating/deleting ) seems to
cause a rowdeleting/updating etc error. Or is this simply not meant to be
done?
| |
by: Pieter |
last post by:
Hi,
I'm having a problem deploying Reporting Services Reports on a ReportServer,
when the reports have to be put in subdirectory's and use a shared
DataSource.
I'm using an application similar to this one:
http://www.devx.com/dotnet/Article/22014/0/page/1
When I'm trying to deploy to a subdirectory of the folder in which I put the
|
by: p.strong |
last post by:
Gday,
I am trying to deploy a windows forms application that uses crystal
reports for .net 2005...
Prior to publishing the application to a webserver, I have checked the
prerequisite to install crystal reports .net 2005, however when I go to
access the URL to install the application on a client computer I get
the error:
|
by: =?Utf-8?B?Y2hhaXJtYW4=?= |
last post by:
I am trying to set up a Report Server to publish reports that I have created
in Visual Studio 2005. I have been able to get it up and running and I am
able to access reports via the web and set up another user. The other user
can log on and see the reports available but when he runs then it begins to
run the report then throws the error below. I have tried looking in the
virus software logs to see if it is being blocked but that doesn't...
|
by: Paulo |
last post by:
Hi, how can I deploy the Crystal Reports dlls on server? Just copying dlls
to bin folder of asp.net site? Wich dlls?
VS 2005 asp.net C# 2.0
Thanks!
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |