Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Problem with Rb using Variables in IW

edited April 2011 in General
Last year (09/28/10) I started a thread about this topic. Not wanting to
sound like a rant but I didn't get any usefull answer, only Ed Dressel
asked what the error was and then nothing else.

I use RB to generate a PDF, save it to the temporary folder of the
session and show it on the Web Browser. I have been using this for some
time without problems *only* when I use Variables on the report it
doesn't work.

The error I always get is:

Project WebOL.exe raised exception class ECodeError with message 'Not
possible to compile the program: Variable2OnCalc'. Process Stopped.Use
Step or Run to continue.

I'm using
RB Enterpise 12.04 build 77
Delphi 6 Build 6.240 UpdatePack 2
Intraweb 10.0.7

also, I'm using DM's encrypted PDF output as I find it to be better than
the TExtraDevice's.

I believe that I am forgeting something, to declare a unit in the uses
clause or something equally dumb. But I just can't find out what it is.

A example of the code I use:

If Exames_do_Laudo['IDEMS'] = 1056 then
Begin
DBText1.Visible := True;
DBText3.Visible := True;
DBText13.Visible := True;
End else
Begin
DBText1.Visible := False;
DBText3.Visible := False;
DBText13.Visible := False;
End;


What is so diferent in the report when I use a variable with some RAP
code?


Andrew

Comments

  • edited April 2011
    Hi Andrew,

    I'm very sorry you did not have a good experience in the past with our
    support.

    The error implies that the RAP code associated with the Variable2 OnCalc
    event has an error. If you select the Calc tab and view this code, is
    it compiling correctly? Does it give an error message?

    Is the code you posted located in the OnCalc event of a variable? It
    would seem a better place to perform this action would be the
    Band.BeforePrint event.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2011
    Hi Nico,


    Yes, it's the code I used as an example. The problem is not where I use
    it or where I use it, but using it. If I put a RAP code wherever, it'll
    give an error. It compiles ok and works in any other place but my
    Intraweb module. That's the reason I want to know what I'm possibly
    forgetting to use/do in the app. I have an impression that I'm missing
    something so basically simple that it makes me sick that I can't find it
    (well, that and the clients bugging me about this). That's why I want to
    know more about what exactly I should put in the uses clause or whatever
    else I can do to make it work. When I tried with the guys at Atozed they
    said that it should work exatly the same as everything else, IOW the
    report works so it's something I missed.

    Regards
    Andrew
  • edited April 2011

    Have never heard this before. If I understand correctly, you are saying that
    if you put any RAP code in a Report and place the report in an Intraweb
    module, then you get ECodeError? How about if you create an empty report
    layout with no datapipeline and put a single empty RAP event-handler in the
    report. Does that cause the error?

    ECodeError is raised by TraCodeModule.CompileProgram, when it cannot compile
    a RAP program. So try the above test to determine whether RAP can compile
    and empty event-handler.

    The biggest difference with IntraWeb is that you have to provide a
    thread-safe environment for the report. The RBuilder help topic for
    TppReport.BackgroundPrintSettings includes details about providing for
    thread-safety.



    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2011
    Nard,


    Exactly, as wierd as it may seem.


    It's a start, I'll try this and see what happens.


    Thanks. I'll read more about this and will be back on this topic. This
    next week I'll be on a client, but the week after I'll examine this
    closely.

    Thanks again.
    Andrew
This discussion has been closed.