Переглянути джерело

Reports Seem to be better now with "large files"

pull/8/head
Daniel Covington 6 місяці тому
джерело
коміт
b8fd726333
3 змінених файлів з 80 додано та 11 видалено
  1. +3
    -0
      CiCd/deploy.vbs
  2. +28
    -1
      Data/Proofs.rep
  3. +49
    -10
      ImportService/TrackingDataImport.vbs

+ 3
- 0
CiCd/deploy.vbs Переглянути файл

@@ -77,6 +77,9 @@ Sub CloneRepo
objFile.WriteLine("Data/arrow ne.jpg")
objFile.WriteLine("Data/Label_Report.rep")
objFile.WriteLine("Data/png-transparent-arrow-arrow-angle-triangle-black-thumbnail.jpg")
objFile.WriteLine("Data/purple_envelope_sample_Page_1.jpg")
objFile.WriteLine("Data/purple_envelope_sample_Page_2.jpg")
objFile.WriteLine("Data/Proofs.rep")
objFile.WriteLine("dist/")
objFile.WriteLine("MVC/")
objFile.WriteLine("Dependancies/")


+ 28
- 1
Data/Proofs.rep Переглянути файл

@@ -40,7 +40,8 @@ object TRpReport
'tboundIMBDigits, KitLabels.InBoundIMBDigits, KitLabels.OutboundI' +
'MBPNG,'#13#10#9#9#9' KitLabels.INBOUNDIMBPNG, KitLabels.SetNumber'#13#10#9#9#9' FR' +
'OM InkjetRecords'#13#10#9#9#9' LEFT JOIN [KitLabels] ON InkjetRecords.Kit' +
'LabelID = KitLabels.ID'#13#10#9#9#9' WHERE InkjetRecords.KitID = PBKITID'
'LabelID = KitLabels.ID'#13#10#9#9#9' WHERE InkjetRecords.KitID = PBKITID ' +
'AND InkjetRecords.ID >= PBMIN and InkjetRecords.ID <= PBMAX '
end
item
Alias = 'JURISDICTION'
@@ -92,6 +93,32 @@ object TRpReport
Search = ''
ErrorMessage = ''
Validation = ''
end
item
Name = 'PBMIN'
AllowNulls = False
Value = 139075
ParamType = rpParamInteger
Datasets.Strings = (
'KITLABELS')
Description = ''
Hint = ''
Search = ''
ErrorMessage = ''
Validation = ''
end
item
Name = 'PBMAX'
AllowNulls = False
Value = 140314
ParamType = rpParamInteger
Datasets.Strings = (
'KITLABELS')
Description = ''
Hint = ''
Search = ''
ErrorMessage = ''
Validation = ''
end>
StreamFormat = rpStreamText
ReportAction = []


+ 49
- 10
ImportService/TrackingDataImport.vbs Переглянути файл

@@ -47,21 +47,56 @@ Dim WorkingDirectory:WorkingDirectory = Replace(WScript.ScriptFullName,WScript.S

WScript.Quit
Function CreateProofForJurisdiction(KitID)
Dim Qpdf:Set Qpdf = WScript.CreateObject("DebenuPDFLibraryAX1013.PDFLibrary")
Dim Result:Result = Qpdf.UnlockKey("j564z3wi9i66k93cp3r798b3y")
If oConn.State = 0 Then:oConn.Open(ConnectionString):End If
Dim Rs:set Rs = oConn.Execute("SELECT MIN(ID) as [MIN],MAX(ID) as [MAX] FROM InkjetRecords WHERE KitID = " & KitID &";")
Dim MIN:MIN = Rs("MIN").Value
Dim MAX:MAX = Rs("MAX").Value
Dim RecordCount:RecordCount = (MAX - MIN) + 1
Rs.Close
Dim KitRs:set KitRs = oConn.Execute("Select * From [Kit] Where [ID] =" & KitID & ";")
Dim JurisdictionRs:set JurisdictionRs = oConn.Execute("SELECt * FROM [Jurisdiction] WHERE JCode='" & KitRs("Jcode").Value & "';")
Dim ProofFileName:ProofFileName = objFSO.GetBaseName(KitRs("Filename")) & "-PROOF.PDF"
If Not objFSO.FolderExists(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value) Then:objFSO.CreateFolder(ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value):End If
Dim reportManager:set reportManager = CreateObject("ReportMan.ReportManX")
reportManager.Preview = False
reportManager.ShowProgress = False
reportManager.ShowPrintDialog = False
reportManager.filename = PurpleEnvelopeProofReport
reportManager.SetDatabaseConnectionString "WEBDATA",ConnectionString
reportManager.SetParamValue "PBKITID",KitID
reportManager.SetParamValue "PBJCODE",KitRs("Jcode").Value
reportManager.SaveToPDF ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ProofFileName,1
oConn.Execute("UPDATE KIT SET [Status] ='Ready For Inkjet Export',[ExportedToSnailWorks] =#" & Now() & "# WHERE [ID] =" & KitID & ";")
With reportManager
.Preview = False
.ShowProgress = False
.ShowPrintDialog = False
.filename = PurpleEnvelopeProofReport
.SetDatabaseConnectionString "WEBDATA",ConnectionString
.SetParamValue "PBKITID",KitID
.SetParamValue "PBJCODE",KitRs("Jcode").Value
Dim MAXRECORDS:MAXRECORDS = 3750
If RecordCount > MAXRECORDS Then
Dim i
For i = 0 To RecordCount / MAXRECORDS

Dim newMin:If MIN + (i * MAXRECORDS) > MIN Then:newMin = MIN + (i * MAXRECORDS) + 1:Else newMin = MIN:End If
Dim newMax:If MIN + (i * MAXRECORDS) + MAXRECORDS > MAX Then:newMax = MAX:Else newMax = MIN + (i * MAXRECORDS) + MAXRECORDS:End If
.SetParamValue "PBMIN",newMin
.SetParamValue "PBMAX",newMax
.SaveToPDF ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "\Part_" & i & "_" & ProofFileName,1
Result = Qpdf.AddToFileList("Proofs",ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "\Part_" & i & "_" & ProofFileName)
Next
Result = Qpdf.MergeFileListFast("Proofs",ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ProofFileName)
Dim test
For test = 1 To Qpdf.FileListCount("Proofs")
'objFSO.DeleteFile Qpdf.FileListItem("Proofs",test),1
WshShell.Run "cmd.exe /c DEL /F /Q """ & Qpdf.FileListItem("Proofs",test) & """" ,0,True
'debug.WriteLine "cmd.exe /c DEL /F /Q """ & Qpdf.FileListItem("Proofs",test) & """"
'debug.WriteLine Qpdf.FileListItem("Proofs",test)
Next
Else
.SetParamValue "PBMIN",MIN
.SetParamValue "PBMAX",MAX
.SaveToPDF ExportDirectory & KitRs("JobNumber").Value & "-" & JurisdictionRs("Name").value & "/" & ProofFileName,1
End If
End With
oConn.Execute("UPDATE KIT SET [Status] ='Ready For Inkjet Export' WHERE [ID] =" & KitID & ";")
If KitRs.State = 1 Then:KitRs.Close:End If
If JurisdictionRs.State = 1 Then:JurisdictionRs.Close:End If
If oConn.State = 1 Then:oConn.Close:End If
@@ -462,7 +497,7 @@ Function PadString(inputString, size)
Dim paddedString
Dim inputLength
Dim i
If IsNull(inputString) Then:inputString = ""
' Get the length of the input string
inputLength = Len(inputString)

@@ -484,6 +519,10 @@ Function PadString(inputString, size)
PadString = paddedString
End Function

Function CleanNull(StringToClean)
If IsNull(StringToClean) Then:CleanNull = "":End If
End Function

Public Sub Assign(ByRef var, ByVal val)
If IsObject(val) Then
Set var = val


Завантаження…
Відмінити
Зберегти

Powered by TurnKey Linux.