ActiveReports for .NET Support

Started by joeszeto at 11-24-2009 11:29 PM. Topic has 1 replies.

Print Search Rate
Sort Posts:    
   11-24-2009, 11:29 PM
joeszeto is not online. Last active: 5/13/2011 8:35:16 AM joeszeto

Not Ranked
Joined on 11-25-2009
Posts 1
DrawImage() System.NullReferenceExpection

Hi all,

I have a problem that when I use DrawImage(), I got "System.NullReferenceExpection" below is the code:

Private Sub Test_ReportStart(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.ReportStart                             
   Dim fs As FileStream
   Dim x As Single = 1.1F
   Dim y As Single = 1.1F
   Dim width As Single = 1.1F
   Dim height As Single = 1.1F
   Dim drawRect As New RectangleF(x, y, width, height)
   fs = New FileStream(HttpContext.Current.Server.MapPath("../Images/test.PNG"), FileMode.Open, FileAccess.Read)
   Me.CurrentPage.DrawImage(System.Drawing.Image.FromStream(fs), drawRect)
   fs.Close()

End Sub

at Testrpx.Test_ReportStart(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Reports\Testrpx.vb:line 146                                        at DataDynamics.ActiveReports.ActiveReport.-b01()     at DataDynamics.ActiveReports.ActiveReport.-fa2(Boolean bDelayedInit)       at DataDynamics.ActiveReports.ActiveReport.Run(Boolean syncDocument)                                                                                          at TCM.RpxReportGenerator.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\Report\RpxReportGenerator.aspx.vb:line 89

Please help!


   Report 
   11-25-2009, 3:16 AM
Amit Pal is not online. Last active: 2/7/2012 10:11:10 PM Amit Pal

Top 25 Posts
Joined on 12-11-2008
Posts 855

DDStaff
Re: DrawImage() System.NullReferenceExpection
Hello,

The problem is not with the DrawImage method of ActiveReports.

If you're attempting to use "Server.MapPath" in the code-behind page of the report, you'll need to "Import System.Web.HttpContext" at the beginning of the report class (before declaration) in order for the report to recognize it, and it will need to be preceded by "Current.".

Regards,
Amit
Amit Pal
GrapeCity- DataDynamics
   Report 
GrapeCity » Product Support » ActiveReports f... » Re: DrawImage() System.NullReferenceExpection

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