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

Print to text file - N/G

edited December 2002 in Devices
I've been away from ReportBuilder for a while, and must have forgotten
something fundamental . I'm trying to print to a text file to
generate a data file for input into another system. I have the following
property settings:

allowprinttofile - true
devicetype - textfile
modalcanceldialog - false
modalpreview - false
textfiletype - ftFixedLength
and I specified the text file name.

When I run this report, I get a 0-byte output file. When I change the
device to screen, I get the expected results displayed.

Can anyone tell me what I am doing wrong?

Thanks

Comments

  • edited December 2002
    Never mind! I found the Print to File Setup Dialog from a previous thread.

    So now I can get the report into a file, but the format is a problem. I'm
    trying to create a fixed-length data file with a header
    record. It looks like this:

    H 19970904
    9876ABAB ABS ABRC 6.5 101598 090993 19981015C

    The first line is a header record, and the second line is a sample of the
    detail data. Each detail field has to begin in a specific
    column.I selected a fixed font, Courier, and put the header record info in
    the header band.
    However, now if I set the textfiletype to Fixed Length, I again get an empty
    file. If I set it to custom, I get all records on one line. How can I
    generate the report I need?

    Thanks.



  • edited December 2002
    Have you tried setting DeviceType = ReportTextFile instead of TextFile. This
    should create the "columns" in the file that you are looking for. This is a
    report emulation text file output.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    Thanks - that got me some output at least .Now, my problem is, a line is
    skipped after each 2 records.

  • edited December 2002
    You'll have to reposition the controls to map to the character map on the
    page in 1/6 inch increments. See the main reports demo #107, as it uses
    this approach to print specifically for the report text file output.
    Courier is good. What point size are you using? Try using Courier New 8pt.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002


  • edited December 2002
    The header band needs to be set to visible = true on teh first page, then
    false for evey page after. The fixed length file device output is really
    what you should probably use, but it sound sas if the report emulation text
    file works also. You have to set the SaveLength property on each component
    that prints to the file in order to print that many characters in the file.
    You can set the header band's visibility in the Report's OnStartPage event.
    If the Report.AbsolutePageNo = 1 then set the headerband to visible = true,
    else = false.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    Now that's what I call help! Thanks a lot, Jim. I'll implement these
    instructions right away.
    Happy New Year.

This discussion has been closed.