Home End User

Invalid Stream Format error

edited March 2003 in End User
I have downloaded the ConvertBinaryTemplateToASCII.zip demo so i can change
a Report Template so it can be used by different database back ends.

I am getting an 'Invalid Stream Format' error when i try to open one of my
Report Template (which i have created using the SaveToFile menu option on
the Design Tab).
I am using the Demo which you suggested and just pointing to my Report
Template instead of the default Template that comes with the demo.
I have opened and saved a template using the LearnReportBuilder demo program
and that works OK.
I have tried saving a template from both the DBISAM template and the ASTA
template.

I have set the Report-SaveAsTemplate to True on my Report form but i still
get this error.
Any ideas what may be the cause ?

Many thanks
John

Comments

  • edited March 2003
    I can reproduce the problem. What is happening is that the template was
    saved in ASCII format. The template needs to be in binary format in order
    for the ObjectBinaryToText method to work. Place a try..except (we should've
    had this in our demo) catching the EReadError in case some of your templates
    are already in ASCII format so they won't be converted.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Thanks, i've got it parsing OK now.
    I can parse the file and then get the user to manually select the
    LoadFromFile method to load this new template when in design mode but is
    there any other way i can just get the user to select which Online Report
    they want to make into an Offline Report and then do it seemlesly ?
    I am using the Report explorer and Report Builder 6.03

    Many thank for your help
    John
  • edited March 2003
    I would problably take the designer offline so that it can runs in two modes
    or use a report behind the scenes to do the conversion and then the designer
    only operates in one of the two modes in any given session. One mode would
    be when the report explorer is running and one is when it is file based. You
    would need to close the designer, configure the designer's DataSettings
    property in order to change modes and database connections for new reports
    and so that the data settings match the loaded template and so that new
    reports will also have the correct datasettings. You can use a TppReport
    behind the scenes that you can configure to connect to the database and load
    the report dynamically using the
    Report.Template.LoadFromDatabase/SaveToDatabase methods. Set the
    Report.Template.Datasettings to use these methods. This will allow you to
    convert the report behind the scenes in conjunction with a call to
    Report.Template.LoadFromFile/SaveToFile. Then the report in the designer can
    be made to load the report from file or database after it has been converted
    from ASTA to DBISAM or vice versa. Does this give you the leverage to do
    what you want to do?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Yes, that has given me enough to get going with it.

    Many thanks
    John
This discussion has been closed.