We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Error when tryinmg to Read RDLC from Server side

Thread ID:

Created:

Updated:

Platform:

Replies:

113601 Oct 1,2013 09:05 AM Oct 2,2013 10:03 AM Silverlight 1
loading
Tags: ReportViewer
Darren Hunnter
Asked On October 1, 2013 09:05 AM

Hi,

I have an issue, if I am trying to read an RDLC to a byte array through a domain service and then convert the bytes back to a stream I am getting an error saying it can't find part of the report. But if I reference the report directly in the silver-light per the example it works.

Here is the code:
Option Compare Binary
Option Infer On
Option Strict On
Option Explicit On
 
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Linq
Imports System.ServiceModel.DomainServices.Hosting
Imports System.ServiceModel.DomainServices.Server
Imports System.IO
Imports FileFunctions.FileFunctions
'TODO: Create methods containing your application logic.
<EnableClientAccess()>  _
Public Class TestReportServer
    Inherits DomainService
 
    Private Function GetServerRootPath() As String
        Dim r As String = HttpContext.Current.Server.MapPath("..")
        If r.EndsWith("\") = False Then r &= "\"
        Return r
    End Function
 
 
    <Invoke()>
    Public Function ReportTest() As String
        Dim r As String = GetServerRootPath() & "Reports\TestReport1.rdlc"
        Return r
    End Function
 
 
    <Invoke()>
    Public Function Getreport() As Byte()
        Dim b As Byte()
        Dim ff As New FileFunctions.FileFunctions
        b = ff.ReadFileToByte(GetServerRootPath() & "Reports\TestReport1.rdlc")
        Return b
    End Function
 
End Class


Imports System.ServiceModel.DomainServices.Client Imports System.IO Partial Public Class MainPage     Inherits UserControl     Dim test As New ReportApp.ReportTest.TestReportServer     Public Sub New()         InitializeComponent()     End Sub     Private Sub MainPage_Loaded(sender As Object, e As System.Windows.RoutedEventArgsHandles Me.Loaded         'test.ReportTest(AddressOf GetTest, Nothing)         test.Getreport(AddressOf DisplayReort, Nothing)             End Sub     Private Sub GetTest(e As InvokeOperation(Of String))         MessageBox.Show(e.Value)     End Sub     Private Sub DisplayReort(e As InvokeOperation(Of Byte()))         Dim b As Byte()         b = e.Value         'MessageBox.Show(b.Length.ToString)         's.Write(b, 0, b.Length)         'MessageBox.Show(s.Length.ToString)         's = Application.GetResourceStream(New Uri("BarChartDemo;component/TestReport1.rdlc", UriKind.Relative)).Stream         Dim rdlStream As Stream = Application.GetResourceStream(New Uri("ReportApp;component/TestReport1.rdlc"UriKind.Relative)).Stream         Dim rdlstream1 As Stream         rdlstream1 = New MemoryStream()         rdlstream1.Write(b, 0, b.Length)         Try             ReportViewer1.LoadReport(rdlStream)         Catch ex As Exception             MessageBox.Show(ex.ToString)         End Try         ReportViewer1.RefreshReport()         'MessageBox.Show(b.Length)     End Sub
Is there any diffrence between stream and
Application.GetResourceStream in there encoding.

I would like to keep the RDLC files on the server and read them in as a byte array and then reconstitute the stream.

Any help would be appreciated.


Anandakumar S [Syncfusion]
Replied On October 2, 2013 10:03 AM

Hi Darren Hunnter,

 

Thanks for using Syncfusion Products.

 

Please follow up the incident #113845 for updates regarding this query.

 

Please let us know if you have any questions.

 

Regards,

Anandakumar S


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;