Good Afternoon Everyone,
Issue
-----
Documents are not exporting, but folders ARE being created, and no errors are being thrown currently when used on client network. Program operates perfectly both in the VB NET 2013 Studio or via the executible package on my sandbox. Please see sections on Troubleshooting and Verification for further details.
Scenario:
----------
I've built a program that is designed to read an external txt file (or csv) and based on the info provided, search the repository for the specified item, then export it as whatever doc type was specified based on values provided.
Example:
Line 1 is:
PDF, 123456789, 987654, C:\Mypath
This would result in the search looking through the repository for any document with the field value for "Case Number" being equal to 123456789 or a field value for "Review Number" being equal to 987654. It then takes the found document and exports it as a PDF to C:\MyPath.
Environments
-------------
My sandbox environment:
-----------------------
Windows 7 Pro x64 SP1 VM Virtual Machine
4 GB Ram
80 GB HD
LF Client 9.1.x
LF Server 9.1.x
SQL 2012 Full
etc.
Clients Environment
-------------------
Workstation
----------------
Windows 7 Pro x64 SP1
4 GB Ram
500 GB HD
LF Client 9.1.x
etc.
Server
---------
Windows 2008 Standard x64
16 GB Ram
500 GB HD space
LF Server 9.1.x
etc.
SQL Server
----------------
Windows 2008 Standard x64
16 GB Ram
500 GB HD space
SQL 2008 R2
Verification
---------------
User account is a Named User
SDK Runtimes are installed on client server where the program is being run from.
Troubleshooting:
-----------------------
It is working perfectly in my sandbox running VB NET Studio 2013.using the debug process. The folders are being created correctly, the correct documents are exporting properly into the correct folders, etc.
Complied and ran the setup and application and it also is working perfectly in my sandbox. The folders are being created correctly, the correct documents are exporting properly into the correct folders, etc..
When installed and tested in the live environment, I'm not getting any errors, the folders DO create properly, but they remain empty. I am using the same documents, the same data file, etc.
Misc.
----
There is a template that has 2 fields one called "Case Number" and the other called "Review Number". The template name doesn't matter as I am only concerned with the fields.
Variables:
Currentrow(0) ' Document type to extract as
Currentrow(1) ' Case Number
Currentrow(2) ' Review Number
Currentrow(3) ' Output Path
The process that should be occurring is:
1. Application reads the .txt file, row by row
2. Depending on whether currentrow (0) (the current doc type to export) is set as PDF or TIF, the same process will be run except for the different requirements for a TIF vs a PDF.
3. The chosen path will search the repository and return the results that equal the currentrow(1) (Case Number) and the currentrow(2) (Review Number).
4. Based on the currentrow(0) a file with the proper type is exported to a path supplied by Currentrow(3) (The path).
5. Everything repeats until there are no more rows of data.
6. Application notifies user of completion and closes down all sessions and activities.
Code is attached as is the txt file used.
A review of my code and processes would be appreciated and any info on what I' missing as well.
Regards,
' Run the search. lfSearch.Run() ' Get the results... searchResults = lfSearch.GetResultListing(settings) ' If there are any results then step through them... If searchResults.RowCount > 0 Then ' Search iterations to get the documents matching the criteria. For i As Integer = 0 To 1 'searchResults.RowCount ' The path and file name to create based on the search. filePathAndName = currentrow(3) & "\" & searchResults.GetDatumAsString(1, SystemColumn.Name) & ".pdf" ' Check to see if the direcotry exists. If not then create it. VerifyDirectory(currentrow(3)) ' If a result is found then verify it matches the criteria for that ' row in the lfexport.txt file. If currentrow(1) = searchResults.GetDatumAsString(1, "Case Number") Or currentrow(2) = searchResults.GetDatumAsString(1, "Review Number") Then ' Set up variables for export process. Dim docInfo As DocumentInfo Dim docexporter As New DocumentExporter ' Set up variable for this iteration / loop. docInfo = Document.GetDocumentInfo(searchResults.GetDatum(1, SystemColumn.Id), mySession) ' Checking to be sure the PDF has pages and text. If docInfo.AllPages.GetTotalPageCount > 0 Then ' Setting up the export. Document namne, PDF options (I want the text) docexporter.ExportPdf(docInfo, docInfo.AllPages, PdfExportOptions.IncludeText, filePathAndName) End If End If Next End If 'Cleanup... listing = Nothing lfSearch = Nothing settings = Nothing searchResults = Nothing mySession.LogOut() mySession = Nothing
The above code is for the PDF export
' Run the search... lfSearch.Run() ' Get the results... searchResults = lfSearch.GetResultListing(settings) ' If there are any results then step through them... If searchResults.RowCount > 0 Then For i As Integer = 0 To 1 ' searchResults.RowCount ' Setting the path and document name variables. filePathAndName = currentrow(3) & "\" & searchResults.GetDatumAsString(1, SystemColumn.Name) & ".tif" ' Check to see if the direcotry exists. If not then create it. VerifyDirectory(currentrow(3)) ' If a result is found then verify it matches the criteria for that ' row in the lfexport.txt file. If currentrow(1) = searchResults.GetDatumAsString(1, "Case Number") Or currentrow(2) = searchResults.GetDatumAsString(1, "Review Number") Then Dim docInfo As DocumentInfo Dim docexporter As New DocumentExporter ' Export Configuration settings for a tif docexporter.PageFormat = DocumentPageFormat.Tiff docexporter.IncludeAnnotations = True docexporter.BlackoutRedactions = True ' Set up variable for this iteration / loop. docInfo = Document.GetDocumentInfo(searchResults.GetDatum(1, SystemColumn.Id), mySession) ' Checking to be sure the Tif has pages and text. If docInfo.AllPages.GetTotalPageCount > 0 Then ' Setting up the export. docexporter.ExportPages(docInfo, docInfo.AllPages, filePathAndName) End If End If Next End If
The above is for TIFF export
Private Sub VerifyDirectory(ByVal folderPath As String) If Not Directory.Exists(folderPath) Then Directory.CreateDirectory(folderPath) End If End Sub
The above is used for creating the folder if it doesn't exist