Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Space added when exporting text from VB

Status
Not open for further replies.

GB2

Programmer
Jan 10, 2002
8
CA
Using VB 4.0 and Windows 98 we recently upgraded from Crystal Reports v6 to v8.

Viewing the Crystal Report in VB is okay, but when exporting the report data to a text file, an extra space is now added before each row in the .txt file.

Seagate recognizes the problem and offers a patch that installs U2ftext.dll 8.6.0.285 which I did, but the problem still persists.

The problem doesn't occur with Windows 2000, but the client is not willing to upgrade at this point.

Any suggestions?
 
Straight text exports also involve the printer drvier. Did you try telling the report that it was using a differnt printer? Just a shot in the dark. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
We installed the most recent printer drivers, and that didn't help.
I'm not sure how you would "tell the report that it was using a different printer".

We are able to recreate this problem on different machines in different offices.

The problem lies in the Crystal Report Control that is placed on the VB form. It uses a different Export.dll than the Crystal Reports application. I believe it's this .dll that inserts an extra space in the text file which you can actually see, not just when you are printing it.

Due to the urgency of the problem, the client has agreed to upgrade to Windows 2000 so I guess the problem will remain one of Seagate's little mysteries.

Thanks for responding.

 
You can replace the old export dll with a new one, if that is really the problem. The export files start with "U2". Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
What I meant by "select a different printer" was to go into printer setup and selecting another printer from the list. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I did replace the U2ftext.dll with v8.6.0.99 ... it was in the patch supplied by Seagate.
But it didn't make any difference.

 
I have V8 on a windows 98 PC, and it doesn't do what you describe. Are you using TEXT or one of the other 'flat' data exports. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
...remember... we were using Visual Basic 4.0 when we upgraded from Crystal 6 to 8.

This is how we're creating the text file...

'(frmMain.RPTGeneral = the Crystal Control)

'call sub (below) to initialize the report
InitializeReport "EFT1PCS.rpt", "Electronic File Transfer", 2, False

frmMain.RPTGeneral.ParameterFields(0) = "ReportNo;" & sReportNumber & "; True"
frmMain.RPTGeneral.ParameterFields(1) = "ProfitCtrCd;" & msProfitCtrCd & "; True"
frmMain.RPTGeneral.PrintFileName = lblFileLocation & "\" & sFileName
frmMain.RPTGeneral.PrintFileType = 2
ireturnval = frmMain.RPTGeneral.PrintReport

Sub InitializeReport(sReport As String, sTitle As String, _
iDest As Integer, bProgress As Boolean)

'****************************************************
'*** Purpose: Reset the Crystal Reports control in
'*** preparation for printing a report.
'*** This is necessary since we don't know
'*** how many parameters were passed to the
'*** previous report and residual parameters
'*** cause an 'Invalid parameter' error.
'***
'*** Parameters:
'*** sReport - name of report being printed
'*** sTitle - title of report window
'*** iDest - destination of report
'*** 0=Window; 1=Printer; 2=File
'*** bProgress - boolean to turn on or off Crystal's
'*** progress panel
'***-------------------------------------------------
'****************************************************

On Error GoTo ERR_Section

' reset the control
frmMain.RPTGeneral.Reset

' set the database connection
frmMain.RPTGeneral.Connect = "DSN = " & gsDSN
frmMain.RPTGeneral.Connect = frmMain.RPTGeneral.Connect & ";UID = " & gsUID
frmMain.RPTGeneral.Connect = frmMain.RPTGeneral.Connect & ";PWD = " & gsPWD

' set the report
frmMain.RPTGeneral.ReportFileName = gsReportPath & sReport
frmMain.RPTGeneral.WindowTitle = sTitle

' set the destination
frmMain.RPTGeneral.Destination = iDest

' set the progress panel
frmMain.RPTGeneral.ProgressDialog = bProgress

' set the report to maximize the window
frmMain.RPTGeneral.WindowState = 2

Exit Sub

ERR_Section:
frmError.DisplayError Err.Number, Err.Description, frmMain, _
"InitializeReport", ""

End Sub
 
I am exporting from the report desginer, so I can't test that. However, if it were a problem specific to 98 I would have expected to have the same problem. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
You may have just solved the mystery... the Report Designer is not one of the available components in my Add-Ins menu.

I tried uninstalling and reinstalling VB4 to get the Report Designer Add-In, but that didn't work. I then uninstalled and reinstalled just the Crystal Reports component of the VB4 application, and it still doesn't show as an item in the Add-Ins menu.

Looks like upgrading to Windows 2000 is still the most cost effective option here.


 
I meant the free standing CR designer, CRW32.exe. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Oh - yes, the Crystal Reports application also works fine for us.
However, the client wants the export function to remain part of the automated VB process.

 
I can't see why the report designer would export one way in a 98 environment, while VB using the same dll would behave differently. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top