Exporting Report to a txt file problems

Michael J Ross

Registered User.
Local time
Today, 12:46
Joined
Mar 2, 2006
Messages
245
Hi

I have a report which I want to export to a txt file as it is to be used as a source file for upload into another system. I can't export directly from a query as the txt file needs to be in a format I can't get directly from a query.

I have some problems with it, firstly some of my labels become wrapped and secondly others are cut short. Also some extra line breaks are added. I've tried changing font sizes but that doesn't make any difference.

I've attached a screenshot of the report view and also the txt file produced.

Can anyone give me any tips on how to do it or is it not possible?

I can do it via exporting to rtf and then saving the file as a txt file but ideally I'd like to do it without the need to do this.

Thanks
 

Attachments

Michael, I think you might need to use a 'stringbuilder' function to create the data and get it to stay formatted.

Here's a function I use to create and format addresses on my reports:
Code:
Public Function acbMakeLine(varValue As Variant)
On Error GoTo Error_Handler


   If IsNull(varValue) Then
      acbMakeLine = Null
   Else
      acbMakeLine = varValue & vbCrLf
   End If
   
   
Exit_Handler_Click:
    Exit Sub

Error_Handler:
    MsgBox Err.Description
    Resume Exit_Handler_Click
   
End Function

I then have a single textbox control on my report with the recordsource set to:
Code:
=acbMakeLine([Company_Name]) & acbMakeLine([Address1]) & acbMakeLine([Address2]) & acbMakeLine([Address3]) & acbMakeLine([Address4]) & acbMakeLine([County]) & acbMakeLine([Country])

Try building your string into a single control.

Regards
Melt
 
Thanks! I'll give that a try.
 

Users who are viewing this thread

Back
Top Bottom