Results 1 to 6 of 6

Thread: ActiveReports: Disconnect a RPX File

  1. #1

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251

    ActiveReports: Disconnect a RPX File

    I'm not sure if anyone here knows anything about ActiveReports.NET, but I want to give it a shot because it is obvious I'm not getting any help on the datadynamics forums

    So:

    We have been working on converting from 2.0 to .NET for a couple weeks now, but I am starting to get stumped by a recurring problem.

    In a class file I can do the following:
    VB Code:
    1. Dim arap As New AppendixBackCare()
    2. arap.Image5.Image = System.Drawing.Bitmap.FromFile("C:\Inetpub\wwwroot\ActiveReports\sunset.jpg")
    This allows me to dynamically set the property of a control in an RPX file, as long as the control is open for Public Use.

    My question:

    Is there a way I can still set the property of a control in the RPX file, but have not have to include the RPX file in my project?

    Basically, we dynamically build pages based on certain critera dictated by the database, so there could be 4 or 5 RPX files that have the exact same controls, but only one of them would be used in a report.

    So you can see that the above code is NOT going to work for us, because you have to specifically tell it which report we want to use. We need to have the same functionality, but be able to plug in a report on the fly.

    In AR 2.0 & VB6 we could do this to get the same functionaility:
    VB Code:
    1. Set arBasePage = New ActiveReport
    2. arBasePage.LoadLayout (App.Path & "\" & mdAnswers("Language") & mdAnswers("General_BasePage"))
    3.    
    4. arBasePage.Image5.Picture = "C:\Inetpub\wwwroot\ActiveReports\sunset.jpg"
    But it will not work in AR.NET. I can use the LoadLayout function, but I can't set the properties of the control. VB.NET says Image5 is not part of the ActiveReport Class.

    Anybody have any insight to what we can do, without redesigning the whole system (which would take 1yr+)?

    There has got to be a way...
    Last edited by rdove; Feb 10th, 2004 at 10:08 AM.
    ~Ryan





    Have I helped you? Please Rate my posts.

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    Im throwing a guess that its objecting to being late bound.
    Im still on the VB6 version btw, so this is guess work.

    Is there an array you can access in the list ?
    ie: arap.Controls("Image5") you could then ctype the output to be the correct type, if you can access the activereport object types that is. It might look something like this

    CType(arap.Controls("Image5"), ActiveReports.PictureBox).Image = ****

  3. #3

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    Well, I had been on something like that a while ago, but it was a different approach. I blended your suggestion with what I had used previously, but still couldn't get it to go:

    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Code:
    Line 122:
    Line 123:        CType(artest.Sections("Details").Controls("Image5"), DataDynamics.ActiveReports.Picture).Image = System.Drawing.Bitmap.FromFile("C:\Inetpub\wwwroot\ActiveReports\sunset.jpg")
    Line 124:        artest.Run()
    Line 125:
    Thanks for the suggestion though..

    It would be nice if AR.NET had better documentation, but unfortunately it lacks in that dept.
    ~Ryan





    Have I helped you? Please Rate my posts.

  4. #4

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    GOT IT!!!

    Changed to:

    CType(artest.Sections(0).Controls("Image5"), DataDynamics.ActiveReports.Picture).Image = System.Drawing.Bitmap.FromFile("C:\Inetpub\wwwroot\ActiveReports\sunset.jpg")


    Thank you soo much for your suggestion!
    ~Ryan





    Have I helped you? Please Rate my posts.

  5. #5
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    Its amazing what guess work can achieve .

    You do realise that I will be pestering you in a few months when we move over to the new .net version .

  6. #6

    Thread Starter
    Addicted Member rdove's Avatar
    Join Date
    Dec 2002
    Location
    Indianapolis
    Posts
    251
    yes...yes...I'll just warn you now, things are kinda different, as you can see...
    ~Ryan





    Have I helped you? Please Rate my posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width