Results 1 to 11 of 11

Thread: Can it be did?

  1. #1
    Join Date
    Dec 2003
    Posts
    268

    Unanswered: Can it be did?

    This may sound like a peculiar question here but I am wondering if it might be possible to pass to a report an array of objects which it would use to populate a report?

    Initially I am thinking pro'ly not, which is fine I will just pass the object variables I want into the report to a temp table, which would inturn populate the report. But that is just one extra step I would like to cut out.

    So all of you access whizbangs out there, any idears?

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Create a custom type that stores a list of object definitions?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    I may be off on what you want here, but if you're wanting information from one table, you could just reference the table name in the Record Source property of the Report. Or if you're using more than one table you could create a query with the fields you want and reference that query in the Record Source property of the report.

  4. #4
    Join Date
    Dec 2003
    Posts
    268

    In an ideal world

    Yes,I would love to be able to do that.

    Problem is that some fo the values to be represented in the report aren't stored values in a table, but rather derived using some algorithms within the classes themselves depdendent on anywhere from 1 to 4 different criteria.

    to try and build that with conditional ifs would be horribly complicated.

    i.e.

    myObject.pass

    is much easier to read than (x being a table)

    iif(x.interim, "Interim", iif(x.comparator = "=",iif(x.delta=0,iif x.result=x.goal,"Pass", "Fail"), iif(x.result < x.goal-x.delta AND x.result>x.goal+x.delta,"Pass","Fail")))

    ?? I think this is syntatically correct, but you get my drift.

    Keep in mind this is only for one comparator type, there are 5. Now imagine trying to derive that at time of select query execution.

    I can't get my mind around that, nor would I even know how to attempt debugging or managing that downt the road of there were an error.

    I'll look into that datatype suggestion but thing but wonder how the array of objects would get passed to a datatype?

  5. #5
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136
    Sorry, that stuff is still a little too advanced for me to try and help you. Teddy will probably be able to help you. Good Luck!

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I'm not sure I understand exactly what you're trying to do here. Drop the code and explain your intention in plain english...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    ?? sidestep the iif() and object-array-passing complications

    you can use (legible, maintainable) public functions in a module to feed queries (thus reports)

    izy
    currently using SS 2008R2

  8. #8
    Join Date
    Dec 2003
    Posts
    268

    Huh?

    I didnt' use that much code, but I'll try and explain again.

    I have an object X. X has the following variables.

    goal
    result
    comparator
    delta
    variance
    name
    id

    it also has a method
    pass

    The values of the first 5 items can dictate whether an X has either Passed, Failed, or is an Interim X object (meaning it is a point of data for an aggregately measured X)

    Each X can look at it's result and compare that via the comparator variable to the goal , then consider a delta or a variance to determine its pass value.

    In my application I regularly create and store arrays of these objects and can easily populate some values on a form to show whether it is passing or not.

    Now I want to create a report for admnistrative purposes.

    The problem. I want to displaly the pass value for an object. This value doesn't exist in a table so I can't bind the values to a table or a query. (the structure of the objects has been horribly simplified to make explaination quite easy) Secondly, the data are stored in a supertype/subtype relationship. Making querying quite laborious and overly complicated.

    So, I was thinking I have this virtual RS (has attributes that could be considered columns and indexes which could be considered rows) can I pass this into a report.

    Is this clearer? I know it is kind of complicated and I am utilizing some not generally practiced techniques, but I wanted to develop someting that would be easily scalable and upgradable to a more robust development environment.

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You can't report on non-existant data. Reports run on SQL queries. SQL does not support iterating through random non-database objects. That's like saying you want to base a report on a collection for some bizarre third party activex control.

    You were correct in assuming a temporary table will probably be necessary.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  10. #10
    Join Date
    Dec 2003
    Posts
    268

    Non-existant

    Is derived data non-existant? I didnt' know that.

    select fname, lname, format(now(),"yyyy") - format(bdate, "yyyy") as age
    from tblEmployees

    would work. The column age doesn't exist but is derived. Hmmmmm

    I guess these are just the hurdles one must overcome when trying to build tools that aren't tightly coupled with the access DB in which the tool is being developed.

    by storing the data as objects I reduce the load on the DB, I reduce the amount of memory overhead, I increase repsonse time, I allow for the DB platform to change to any ODBC complaint DB and still work, I allow for the front end to change without affecting the DB, I increase the reusability of the code, etc. etc. Dunno, but these seem like good programming practices.

    Oh, and an FYI, tables are arrays of objects.

    Finally, if there were an array from an active x control and people wanted a report on it, or any other array of some objects I would find a way to produce this the most efficient way.

    But that's me.

  11. #11
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Derived data isn't what I'm talking about. Base a report on all of the geometric attributes of a set of application windows on the fly, how do you do that? As far as the SQL specification is concerned, there is no data to report on. Are we talking about different things?

    You may want to check out recoding your application in ADO.NET. It is based on many of the principles you are eluding to and lends itself quite well to your scalability requirements.

    Oh, and FYI, I do believe tables would qualify as "database objects".
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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