
bartekd
Active Members-
Posts
156 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by bartekd
-
Thanks allot Taietel for your suggestion, but it still shows that the report is longer than it is, and it has pages at the end that makes it corrupt. See this example, and let me know if you get the same thing. Or if there is anything else I can add, let me know. The issue for this example is on the 3rd page after I added it to the function itself. #include "MPDF_UDF.au3" #include <array.au3> ;====================================================================1st report Local $SySlogall[4][21] $SySlogall[1][0] = "Aug 28" $SySlogall[1][1] = "08" $SySlogall[1][2] = "28" $SySlogall[1][3] = "2011" $SySlogall[1][4] = "12:12:12" $SySlogall[1][5] = "asdf.asdf.com" $SySlogall[1][6] = "Security" $SySlogall[1][7] = "Security" $SySlogall[1][8] = "Account Management" $SySlogall[1][9] = "test" $SySlogall[1][10] = "630" $SySlogall[1][11] = "User Account Deleted" $SySlogall[1][12] = "test" $SySlogall[1][13] = "domain" $SySlogall[1][14] = "{S-123123123123123}" $SySlogall[1][15] = "creator" $SySlogall[1][16] = "Domain" $SySlogall[1][17] = "" $SySlogall[1][18] = "-" $SySlogall[1][19] = "camp" $SySlogall[1][20] = "Domain" $SySlogall[2][0] = "Aug 28" $SySlogall[2][1] = "08" $SySlogall[2][2] = "28" $SySlogall[2][3] = "2011" $SySlogall[2][4] = "12:12:12" $SySlogall[2][5] = "asdf.asdf.com" $SySlogall[2][6] = "Security" $SySlogall[2][7] = "Security" $SySlogall[2][8] = "Account Management" $SySlogall[2][9] = "test" $SySlogall[2][10] = "630" $SySlogall[2][11] = "User Account Deleted" $SySlogall[2][12] = "test" $SySlogall[2][13] = "domain" $SySlogall[2][14] = "{S-123123123123123}" $SySlogall[2][15] = "creator" $SySlogall[2][16] = "Domain" $SySlogall[2][17] = "" $SySlogall[2][18] = "-" $SySlogall[2][19] = "camp" $SySlogall[2][20] = "Domain" $SySlogall[3][0] = "Aug 28" $SySlogall[3][1] = "08" $SySlogall[3][2] = "28" $SySlogall[3][3] = "2011" $SySlogall[3][4] = "12:12:12" $SySlogall[3][5] = "asdf.asdf.com" $SySlogall[3][6] = "Security" $SySlogall[3][7] = "Security" $SySlogall[3][8] = "Account Management" $SySlogall[3][9] = "test" $SySlogall[3][10] = "630" $SySlogall[3][11] = "User Account Deleted" $SySlogall[3][12] = "test" $SySlogall[3][13] = "domain" $SySlogall[3][14] = "{S-123123123123123}" $SySlogall[3][15] = "creator" $SySlogall[3][16] = "Domain" $SySlogall[3][17] = "" $SySlogall[3][18] = "-" $SySlogall[3][19] = "camp" $SySlogall[3][20] = "Domain" _ArrayDisplay($SySlogall) ;================================================================== Creating the main array that it runs off of Local $SyslogArray[10][10] $SyslogArray[0][0] = "Type" $SyslogArray[0][1] = "Date" $SyslogArray[0][2] = "Time" $SyslogArray[0][3] = "Event" $SyslogArray[0][4] = "Source" $SyslogArray[0][5] = "Domain\User" $SyslogArray[0][6] = "Description" $SyslogArray[0][7] = "Computer" $SyslogArray[0][8] = "Category" ;=================================================================== Array end ;set the properties for the pdf _SetTitle("Gemma Communications Deletion report") _SetSubject("Gemma Deletes") _SetKeywords("Deletes, Report, Gemma, TD, Rogers") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_Portrait) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Example_mixed.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("GemmaLogo", @ScriptDir & "\Images\Gemma.JPG") ;fonts: ;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES) _LoadFontTT("_Arial", $PDF_FONT_ARIAL) _LoadFontTT("_TimesT", $PDF_FONT_TIMES) _LoadFontTT("_Calibri", $PDF_FONT_CALIBRI) _LoadFontTT("_Garamond", $PDF_FONT_GARAMOND) ;=== create objects that are used in multiple pages === ;create a header on all pages, except the first: _StartObject("Antet", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE) _InsertImage("GemmaLogo", 0.5, 27, 4, 2) _SetColourFill(0x323232) _SetTextHorizontalScaling(50) _DrawText(5.2, 28.6, StringUpper("Gemma Communications Deletion Report"), "_Garamond", 15, $PDF_ALIGN_LEFT) _DrawText(5.2, 27.9, "Ran on ======> " & @MON & "/" & @MDAY & "/" & @YEAR, "_Garamond", 15, $PDF_ALIGN_LEFT) _SetTextHorizontalScaling(80) _SetTextHorizontalScaling(100) _SetColourFill(0) _EndObject() For $a = 1 to UBound($SySlogall)-1 _BeginPage() ;========================================================================= First deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 21.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 22, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Second deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 16,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 16.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Third deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 10.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 11, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Forth deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 5.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf _EndPage() next ;then, finally, write the buffer to disk _ClosePDFFile() MsgBox(1,"test","Hit ok to run the next report") ;==================================================================== 2nd report Local $SySlogall[4][21] $SySlogall[1][0] = "Aug 28" $SySlogall[1][1] = "08" $SySlogall[1][2] = "28" $SySlogall[1][3] = "2011" $SySlogall[1][4] = "12:12:12" $SySlogall[1][5] = "asdf.asdf.com" $SySlogall[1][6] = "Security" $SySlogall[1][7] = "Security" $SySlogall[1][8] = "Account Management" $SySlogall[1][9] = "test" $SySlogall[1][10] = "630" $SySlogall[1][11] = "User Account Deleted" $SySlogall[1][12] = "test" $SySlogall[1][13] = "domain" $SySlogall[1][14] = "{S-123123123123123}" $SySlogall[1][15] = "creator" $SySlogall[1][16] = "Domain" $SySlogall[1][17] = "" $SySlogall[1][18] = "-" $SySlogall[1][19] = "camp" $SySlogall[1][20] = "Domain" $SySlogall[2][0] = "Aug 28" $SySlogall[2][1] = "08" $SySlogall[2][2] = "28" $SySlogall[2][3] = "2011" $SySlogall[2][4] = "12:12:12" $SySlogall[2][5] = "asdf.asdf.com" $SySlogall[2][6] = "Security" $SySlogall[2][7] = "Security" $SySlogall[2][8] = "Account Management" $SySlogall[2][9] = "test" $SySlogall[2][10] = "630" $SySlogall[2][11] = "User Account Deleted" $SySlogall[2][12] = "test" $SySlogall[2][13] = "domain" $SySlogall[2][14] = "{S-123123123123123}" $SySlogall[2][15] = "creator" $SySlogall[2][16] = "Domain" $SySlogall[2][17] = "" $SySlogall[2][18] = "-" $SySlogall[2][19] = "camp" $SySlogall[2][20] = "Domain" $SySlogall[3][0] = "Aug 28" $SySlogall[3][1] = "08" $SySlogall[3][2] = "28" $SySlogall[3][3] = "2011" $SySlogall[3][4] = "12:12:12" $SySlogall[3][5] = "asdf.asdf.com" $SySlogall[3][6] = "Security" $SySlogall[3][7] = "Security" $SySlogall[3][8] = "Account Management" $SySlogall[3][9] = "test" $SySlogall[3][10] = "630" $SySlogall[3][11] = "User Account Deleted" $SySlogall[3][12] = "test" $SySlogall[3][13] = "domain" $SySlogall[3][14] = "{S-123123123123123}" $SySlogall[3][15] = "creator" $SySlogall[3][16] = "Domain" $SySlogall[3][17] = "" $SySlogall[3][18] = "-" $SySlogall[3][19] = "camp" $SySlogall[3][20] = "Domain" _ArrayDisplay($SySlogall) ;================================================================== Creating the main array that it runs off of Local $SyslogArray[10][10] $SyslogArray[0][0] = "Type" $SyslogArray[0][1] = "Date" $SyslogArray[0][2] = "Time" $SyslogArray[0][3] = "Event" $SyslogArray[0][4] = "Source" $SyslogArray[0][5] = "Domain\User" $SyslogArray[0][6] = "Description" $SyslogArray[0][7] = "Computer" $SyslogArray[0][8] = "Category" ;=================================================================== Array end ;set the properties for the pdf _SetTitle("Gemma Communications Deletion report") _SetSubject("Gemma Deletes") _SetKeywords("Deletes, Report, Gemma, TD, Rogers") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_Portrait) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Example_mixed.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("GemmaLogo", @ScriptDir & "\Images\Gemma.JPG") ;fonts: ;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES) _LoadFontTT("_Arial", $PDF_FONT_ARIAL) _LoadFontTT("_TimesT", $PDF_FONT_TIMES) _LoadFontTT("_Calibri", $PDF_FONT_CALIBRI) _LoadFontTT("_Garamond", $PDF_FONT_GARAMOND) ;=== create objects that are used in multiple pages === ;create a header on all pages, except the first: _StartObject("Antet", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE) _InsertImage("GemmaLogo", 0.5, 27, 4, 2) _SetColourFill(0x323232) _SetTextHorizontalScaling(50) _DrawText(5.2, 28.6, StringUpper("Gemma Communications Deletion Report"), "_Garamond", 15, $PDF_ALIGN_LEFT) _DrawText(5.2, 27.9, "Ran on ======> " & @MON & "/" & @MDAY & "/" & @YEAR, "_Garamond", 15, $PDF_ALIGN_LEFT) _SetTextHorizontalScaling(80) _SetTextHorizontalScaling(100) _SetColourFill(0) _EndObject() For $a = 1 to UBound($SySlogall)-1 _BeginPage() ;========================================================================= First deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 21.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 22, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Second deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 16,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 16.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Third deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 10.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 11, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Forth deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 5.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf _EndPage() next ;then, finally, write the buffer to disk _ClosePDFFile() MsgBox(1,"test","Hit ok to run the next report") ;==================================================================== 3rd report Local $SySlogall[12][21] $SySlogall[1][0] = "Aug 28" $SySlogall[1][1] = "08" $SySlogall[1][2] = "28" $SySlogall[1][3] = "2011" $SySlogall[1][4] = "12:12:12" $SySlogall[1][5] = "asdf.asdf.com" $SySlogall[1][6] = "Security" $SySlogall[1][7] = "Security" $SySlogall[1][8] = "Account Management" $SySlogall[1][9] = "test" $SySlogall[1][10] = "630" $SySlogall[1][11] = "User Account Deleted" $SySlogall[1][12] = "test" $SySlogall[1][13] = "domain" $SySlogall[1][14] = "{S-123123123123123}" $SySlogall[1][15] = "creator" $SySlogall[1][16] = "Domain" $SySlogall[1][17] = "" $SySlogall[1][18] = "-" $SySlogall[1][19] = "camp" $SySlogall[1][20] = "Domain" $SySlogall[2][0] = "Aug 28" $SySlogall[2][1] = "08" $SySlogall[2][2] = "28" $SySlogall[2][3] = "2011" $SySlogall[2][4] = "12:12:12" $SySlogall[2][5] = "asdf.asdf.com" $SySlogall[2][6] = "Security" $SySlogall[2][7] = "Security" $SySlogall[2][8] = "Account Management" $SySlogall[2][9] = "test" $SySlogall[2][10] = "630" $SySlogall[2][11] = "User Account Deleted" $SySlogall[2][12] = "test" $SySlogall[2][13] = "domain" $SySlogall[2][14] = "{S-123123123123123}" $SySlogall[2][15] = "creator" $SySlogall[2][16] = "Domain" $SySlogall[2][17] = "" $SySlogall[2][18] = "-" $SySlogall[2][19] = "camp" $SySlogall[2][20] = "Domain" $SySlogall[3][0] = "Aug 28" $SySlogall[3][1] = "08" $SySlogall[3][2] = "28" $SySlogall[3][3] = "2011" $SySlogall[3][4] = "12:12:12" $SySlogall[3][5] = "asdf.asdf.com" $SySlogall[3][6] = "Security" $SySlogall[3][7] = "Security" $SySlogall[3][8] = "Account Management" $SySlogall[3][9] = "test" $SySlogall[3][10] = "630" $SySlogall[3][11] = "User Account Deleted" $SySlogall[3][12] = "test" $SySlogall[3][13] = "domain" $SySlogall[3][14] = "{S-123123123123123}" $SySlogall[3][15] = "creator" $SySlogall[3][16] = "Domain" $SySlogall[3][17] = "" $SySlogall[3][18] = "-" $SySlogall[3][19] = "camp" $SySlogall[3][20] = "Domain" _ArrayDisplay($SySlogall) ;================================================================== Creating the main array that it runs off of Local $SyslogArray[10][10] $SyslogArray[0][0] = "Type" $SyslogArray[0][1] = "Date" $SyslogArray[0][2] = "Time" $SyslogArray[0][3] = "Event" $SyslogArray[0][4] = "Source" $SyslogArray[0][5] = "Domain\User" $SyslogArray[0][6] = "Description" $SyslogArray[0][7] = "Computer" $SyslogArray[0][8] = "Category" ;=================================================================== Array end ;set the properties for the pdf _SetTitle("Gemma Communications Deletion report") _SetSubject("Gemma Deletes") _SetKeywords("Deletes, Report, Gemma, TD, Rogers") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_Portrait) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Example_mixed.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("GemmaLogo", @ScriptDir & "\Images\Gemma.JPG") ;fonts: ;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES) _LoadFontTT("_Arial", $PDF_FONT_ARIAL) _LoadFontTT("_TimesT", $PDF_FONT_TIMES) _LoadFontTT("_Calibri", $PDF_FONT_CALIBRI) _LoadFontTT("_Garamond", $PDF_FONT_GARAMOND) ;=== create objects that are used in multiple pages === ;create a header on all pages, except the first: _StartObject("Antet", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE) _InsertImage("GemmaLogo", 0.5, 27, 4, 2) _SetColourFill(0x323232) _SetTextHorizontalScaling(50) _DrawText(5.2, 28.6, StringUpper("Gemma Communications Deletion Report"), "_Garamond", 15, $PDF_ALIGN_LEFT) _DrawText(5.2, 27.9, "Ran on ======> " & @MON & "/" & @MDAY & "/" & @YEAR, "_Garamond", 15, $PDF_ALIGN_LEFT) _SetTextHorizontalScaling(80) _SetTextHorizontalScaling(100) _SetColourFill(0) _EndObject() For $a = 1 to UBound($SySlogall)-1 _BeginPage() ;========================================================================= First deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 21.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 22, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Second deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 16,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 16.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Third deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 10.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 11, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Forth deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 5.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf _EndPage() next ;then, finally, write the buffer to disk _ClosePDFFile() Func _InsertTable1($iX, $iY, $iW=0, $iH=0, $iCols=0, $iRows=0,$lTxtColor = 0x000000, $lBorderColor = 0xdddddd) Local $iPgW = 22.5;21 Local $iPgH = 10;29.7 If $iW = 0 Then $iW = $iPgW - $iX-2 If $iH = 0 Then $iH = $iPgH - $iY -2 _SetColourStroke($lBorderColor) _Draw_Rectangle($iX, $iY, $iW, $iH, $PDF_STYLE_STROKED, 0, 0xfefefe, 0.01) _SetColourStroke(0) $iColW = $iW/$iCols Local $iRowH = $iH/$iRows Local $lRGB For $i = 0 To $iRows-1 For $j = 0 To $iCols-1 If $j = "0" Then $iColW = 1.2 $icolw2 = 0 ELSEIf $j = "1" Then $iColW = 1.4 $icolw2 = 1.2 ElseIf $j = "2" Then $iColW = 1.3 $icolw2 = 2.6 ElseIf $j = "3" Then $iColW = 1 $icolw2 = 3.9 ElseIf $j = "4" Then $iColW = 1.5 $icolw2 = 4.9 ElseIf $j = "5" Then $iColW = 3 $icolw2 = 6.4 ElseIf $j = "6" Then $iColW = 4 $icolw2 = 9.4 ElseIf $j = "7" Then $iColW = 3.5 $icolw2 = 13.4 ElseIf $j = "8" Then $iColW = 3.35 $icolw2 = 16.9 Else $iColW = 2.08 EndIf ;~ $iColW = $iW/$iCols ConsoleWrite($iColW & @CRLF) If $i=0 Then ; if is the first row then colour it $lRGB = 0xefefef _SetTextHorizontalScaling(100) Else $lRGB = 0xfefefe _SetTextHorizontalScaling(60) EndIf _SetColourStroke($lBorderColor) If not $SyslogArray[$i][$j] = "" Then; If the field is blank, don't draw a box. If $j = "6" Then _Draw_Rectangle($iX+$iColW2, $iY+$iH-($i+1)*$iRowH, 10.85, $iRowH, $PDF_STYLE_STROKED, 0, $lRGB, 0.01) Else _Draw_Rectangle($iX+$iColW2, $iY+$iH-($i+1)*$iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lRGB, 0.01) EndIf endif _SetColourStroke(0) Local $sText = "Row "&$i&": Col "&$j If $SyslogArray[$i][$j] = "" Then $SyslogArray[$i][$j] = "" EndIf Local $sText = $SyslogArray[$i][$j] Local $sLength = Round(_GetTextLength($sText, "_Calibri", 10),1) $lScale = Ceiling(0.75*$iColW * 100/ $sLength) _SetColourFill($lTxtColor) _DrawText($iX+$iColW2+$iColW/10, $iY+$iH-($i+1)*$iRowH + ($iRowH-10/_GetUnit())/2, $sText, "_TimesT", 10, $PDF_ALIGN_LEFT, 0) _SetTextHorizontalScaling(100) _SetColourFill(0) Next Next EndFunc
-
I have below what my script kindof looks like. Let me know if it is too long, or if something that is there that doesn't make sense. #include "MPDF_UDF.au3" #include <array.au3> ;====================================================================1st report Local $SySlogall[10][21] $SySlogall[1][0] = "Aug 28" $SySlogall[1][1] = "08" $SySlogall[1][2] = "28" $SySlogall[1][3] = "2011" $SySlogall[1][4] = "12:12:12" $SySlogall[1][5] = "asdf.asdf.com" $SySlogall[1][6] = "Security" $SySlogall[1][7] = "Security" $SySlogall[1][8] = "Account Management" $SySlogall[1][9] = "test" $SySlogall[1][10] = "630" $SySlogall[1][11] = "User Account Deleted" $SySlogall[1][12] = "test" $SySlogall[1][13] = "domain" $SySlogall[1][14] = "{S-123123123123123}" $SySlogall[1][15] = "creator" $SySlogall[1][16] = "Domain" $SySlogall[1][17] = "" $SySlogall[1][18] = "-" $SySlogall[1][19] = "camp" $SySlogall[1][20] = "Domain" $SySlogall[2][0] = "Aug 28" $SySlogall[2][1] = "08" $SySlogall[2][2] = "28" $SySlogall[2][3] = "2011" $SySlogall[2][4] = "12:12:12" $SySlogall[2][5] = "asdf.asdf.com" $SySlogall[2][6] = "Security" $SySlogall[2][7] = "Security" $SySlogall[2][8] = "Account Management" $SySlogall[2][9] = "test" $SySlogall[2][10] = "630" $SySlogall[2][11] = "User Account Deleted" $SySlogall[2][12] = "test" $SySlogall[2][13] = "domain" $SySlogall[2][14] = "{S-123123123123123}" $SySlogall[2][15] = "creator" $SySlogall[2][16] = "Domain" $SySlogall[2][17] = "" $SySlogall[2][18] = "-" $SySlogall[2][19] = "camp" $SySlogall[2][20] = "Domain" $SySlogall[3][0] = "Aug 28" $SySlogall[3][1] = "08" $SySlogall[3][2] = "28" $SySlogall[3][3] = "2011" $SySlogall[3][4] = "12:12:12" $SySlogall[3][5] = "asdf.asdf.com" $SySlogall[3][6] = "Security" $SySlogall[3][7] = "Security" $SySlogall[3][8] = "Account Management" $SySlogall[3][9] = "test" $SySlogall[3][10] = "630" $SySlogall[3][11] = "User Account Deleted" $SySlogall[3][12] = "test" $SySlogall[3][13] = "domain" $SySlogall[3][14] = "{S-123123123123123}" $SySlogall[3][15] = "creator" $SySlogall[3][16] = "Domain" $SySlogall[3][17] = "" $SySlogall[3][18] = "-" $SySlogall[3][19] = "camp" $SySlogall[3][20] = "Domain" _ArrayDisplay($SySlogall) ;================================================================== Creating the main array that it runs off of Local $SyslogArray[10][10] $SyslogArray[0][0] = "Type" $SyslogArray[0][1] = "Date" $SyslogArray[0][2] = "Time" $SyslogArray[0][3] = "Event" $SyslogArray[0][4] = "Source" $SyslogArray[0][5] = "Domain\User" $SyslogArray[0][6] = "Description" $SyslogArray[0][7] = "Computer" $SyslogArray[0][8] = "Category" ;=================================================================== Array end ;set the properties for the pdf _SetTitle("Gemma Communications Deletion report") _SetSubject("Gemma Deletes") _SetKeywords("Deletes, Report, Gemma, TD, Rogers") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_Portrait) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Example_mixed.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("GemmaLogo", @ScriptDir & "\Images\Gemma.JPG") ;fonts: ;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES) _LoadFontTT("_Arial", $PDF_FONT_ARIAL) _LoadFontTT("_TimesT", $PDF_FONT_TIMES) _LoadFontTT("_Calibri", $PDF_FONT_CALIBRI) _LoadFontTT("_Garamond", $PDF_FONT_GARAMOND) ;=== create objects that are used in multiple pages === ;create a header on all pages, except the first: _StartObject("Antet", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE) _InsertImage("GemmaLogo", 0.5, 27, 4, 2) _SetColourFill(0x323232) _SetTextHorizontalScaling(50) _DrawText(5.2, 28.6, StringUpper("Gemma Communications Deletion Report"), "_Garamond", 15, $PDF_ALIGN_LEFT) _DrawText(5.2, 27.9, "Ran on ======> " & @MON & "/" & @MDAY & "/" & @YEAR, "_Garamond", 15, $PDF_ALIGN_LEFT) _SetTextHorizontalScaling(80) _SetTextHorizontalScaling(100) _SetColourFill(0) _EndObject() For $a = 1 to UBound($SySlogall)-1 _BeginPage() ;========================================================================= First deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 21.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 22, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Second deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 16,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 16.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Third deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 10.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 11, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Forth deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 5.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf _EndPage() next ;then, finally, write the buffer to disk _ClosePDFFile() MsgBox(1,"test","Hit ok to run the next report") ;==================================================================== 2nd report Local $SySlogall[10][21] $SySlogall[1][0] = "Aug 28" $SySlogall[1][1] = "08" $SySlogall[1][2] = "28" $SySlogall[1][3] = "2011" $SySlogall[1][4] = "12:12:12" $SySlogall[1][5] = "asdf.asdf.com" $SySlogall[1][6] = "Security" $SySlogall[1][7] = "Security" $SySlogall[1][8] = "Account Management" $SySlogall[1][9] = "test" $SySlogall[1][10] = "630" $SySlogall[1][11] = "User Account Deleted" $SySlogall[1][12] = "test" $SySlogall[1][13] = "domain" $SySlogall[1][14] = "{S-123123123123123}" $SySlogall[1][15] = "creator" $SySlogall[1][16] = "Domain" $SySlogall[1][17] = "" $SySlogall[1][18] = "-" $SySlogall[1][19] = "camp" $SySlogall[1][20] = "Domain" $SySlogall[2][0] = "Aug 28" $SySlogall[2][1] = "08" $SySlogall[2][2] = "28" $SySlogall[2][3] = "2011" $SySlogall[2][4] = "12:12:12" $SySlogall[2][5] = "asdf.asdf.com" $SySlogall[2][6] = "Security" $SySlogall[2][7] = "Security" $SySlogall[2][8] = "Account Management" $SySlogall[2][9] = "test" $SySlogall[2][10] = "630" $SySlogall[2][11] = "User Account Deleted" $SySlogall[2][12] = "test" $SySlogall[2][13] = "domain" $SySlogall[2][14] = "{S-123123123123123}" $SySlogall[2][15] = "creator" $SySlogall[2][16] = "Domain" $SySlogall[2][17] = "" $SySlogall[2][18] = "-" $SySlogall[2][19] = "camp" $SySlogall[2][20] = "Domain" $SySlogall[3][0] = "Aug 28" $SySlogall[3][1] = "08" $SySlogall[3][2] = "28" $SySlogall[3][3] = "2011" $SySlogall[3][4] = "12:12:12" $SySlogall[3][5] = "asdf.asdf.com" $SySlogall[3][6] = "Security" $SySlogall[3][7] = "Security" $SySlogall[3][8] = "Account Management" $SySlogall[3][9] = "test" $SySlogall[3][10] = "630" $SySlogall[3][11] = "User Account Deleted" $SySlogall[3][12] = "test" $SySlogall[3][13] = "domain" $SySlogall[3][14] = "{S-123123123123123}" $SySlogall[3][15] = "creator" $SySlogall[3][16] = "Domain" $SySlogall[3][17] = "" $SySlogall[3][18] = "-" $SySlogall[3][19] = "camp" $SySlogall[3][20] = "Domain" _ArrayDisplay($SySlogall) ;================================================================== Creating the main array that it runs off of Local $SyslogArray[10][10] $SyslogArray[0][0] = "Type" $SyslogArray[0][1] = "Date" $SyslogArray[0][2] = "Time" $SyslogArray[0][3] = "Event" $SyslogArray[0][4] = "Source" $SyslogArray[0][5] = "Domain\User" $SyslogArray[0][6] = "Description" $SyslogArray[0][7] = "Computer" $SyslogArray[0][8] = "Category" ;=================================================================== Array end ;set the properties for the pdf _SetTitle("Gemma Communications Deletion report") _SetSubject("Gemma Deletes") _SetKeywords("Deletes, Report, Gemma, TD, Rogers") _OpenAfter(True);open after generation _SetUnit($PDF_UNIT_CM) _SetPaperSize("A4") _SetZoomMode($PDF_ZOOM_CUSTOM,90) _SetOrientation($PDF_ORIENTATION_Portrait) _SetLayoutMode($PDF_LAYOUT_CONTINOUS) ;initialize the pdf _InitPDF(@ScriptDir & "\Example_mixed.pdf") ;=== load resources used in pdf === ;images: _LoadResImage("GemmaLogo", @ScriptDir & "\Images\Gemma.JPG") ;fonts: ;_LoadFontStandard("_Times", $PDF_FONT_STD_TIMES) _LoadFontTT("_Arial", $PDF_FONT_ARIAL) _LoadFontTT("_TimesT", $PDF_FONT_TIMES) _LoadFontTT("_Calibri", $PDF_FONT_CALIBRI) _LoadFontTT("_Garamond", $PDF_FONT_GARAMOND) ;=== create objects that are used in multiple pages === ;create a header on all pages, except the first: _StartObject("Antet", $PDF_OBJECT_ALLPAGES);NOTFIRSTPAGE) _InsertImage("GemmaLogo", 0.5, 27, 4, 2) _SetColourFill(0x323232) _SetTextHorizontalScaling(50) _DrawText(5.2, 28.6, StringUpper("Gemma Communications Deletion Report"), "_Garamond", 15, $PDF_ALIGN_LEFT) _DrawText(5.2, 27.9, "Ran on ======> " & @MON & "/" & @MDAY & "/" & @YEAR, "_Garamond", 15, $PDF_ALIGN_LEFT) _SetTextHorizontalScaling(80) _SetTextHorizontalScaling(100) _SetColourFill(0) _EndObject() For $a = 1 to UBound($SySlogall)-1 _BeginPage() ;========================================================================= First deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 21.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 22, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Second deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 16,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 16.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Third deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 10.5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 11, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) $a = $a + 1 If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf ;========================================================================= Forth deletion on the page $SyslogArray[1][0] = "Termination" $SyslogArray[1][1] = $SySlogall[$a][1] & "/" & $SySlogall[$a][2] & "/" & $SySlogall[$a][3] $SyslogArray[1][2] = $SySlogall[$a][4] $SyslogArray[1][3] = $SySlogall[$a][10] $SyslogArray[1][4] = $SySlogall[$a][6] $SyslogArray[1][5] = $SySlogall[$a][13] & "\" & $SySlogall[$a][12] $SyslogArray[1][7] = $SySlogall[$a][5] $SyslogArray[1][6] = $SySlogall[$a][11] $SyslogArray[2][6] = " Campaign: " & $SySlogall[$a][19] & " (" & $SySlogall[$a][20] & ")" $SyslogArray[3][6] = " Target Account Name: " & $SySlogall[$a][12] $SyslogArray[4][6] = " Target Domain: " & $SySlogall[$a][13] $SyslogArray[5][6] = " Target Account ID: %" & $SySlogall[$a][14] $SyslogArray[6][6] = " Caller User Name: " & $SySlogall[$a][15] $SyslogArray[7][6] = " Caller Domain: " & $SySlogall[$a][16] $SyslogArray[8][6] = " TermDate: " & $SySlogall[$a][0] $SyslogArray[9][6] = " Privileges: -" $SyslogArray[1][8] = $SySlogall[$a][8] _InsertTable1(0.25, 5,0,5,9,10);table with 8x5 cells, 2cm from the left,8cm from bottom, width/height auto _DrawText(0.4, 5.5, $a, "_Garamond", 15, $PDF_ALIGN_LEFT) If $a > ubound($SySlogall)-1 then _EndPage() ExitLoop EndIf _EndPage() next ;then, finally, write the buffer to disk _ClosePDFFile() Func _InsertTable1($iX, $iY, $iW=0, $iH=0, $iCols=0, $iRows=0,$lTxtColor = 0x000000, $lBorderColor = 0xdddddd) Local $iPgW = 22.5;21 Local $iPgH = 10;29.7 If $iW = 0 Then $iW = $iPgW - $iX-2 If $iH = 0 Then $iH = $iPgH - $iY -2 _SetColourStroke($lBorderColor) _Draw_Rectangle($iX, $iY, $iW, $iH, $PDF_STYLE_STROKED, 0, 0xfefefe, 0.01) _SetColourStroke(0) $iColW = $iW/$iCols Local $iRowH = $iH/$iRows Local $lRGB For $i = 0 To $iRows-1 For $j = 0 To $iCols-1 If $j = "0" Then $iColW = 1.2 $icolw2 = 0 ELSEIf $j = "1" Then $iColW = 1.4 $icolw2 = 1.2 ElseIf $j = "2" Then $iColW = 1.3 $icolw2 = 2.6 ElseIf $j = "3" Then $iColW = 1 $icolw2 = 3.9 ElseIf $j = "4" Then $iColW = 1.5 $icolw2 = 4.9 ElseIf $j = "5" Then $iColW = 3 $icolw2 = 6.4 ElseIf $j = "6" Then $iColW = 4 $icolw2 = 9.4 ElseIf $j = "7" Then $iColW = 3.5 $icolw2 = 13.4 ElseIf $j = "8" Then $iColW = 3.35 $icolw2 = 16.9 Else $iColW = 2.08 EndIf ;~ $iColW = $iW/$iCols ConsoleWrite($iColW & @CRLF) If $i=0 Then ; if is the first row then colour it $lRGB = 0xefefef _SetTextHorizontalScaling(100) Else $lRGB = 0xfefefe _SetTextHorizontalScaling(60) EndIf _SetColourStroke($lBorderColor) If not $SyslogArray[$i][$j] = "" Then; If the field is blank, don't draw a box. If $j = "6" Then _Draw_Rectangle($iX+$iColW2, $iY+$iH-($i+1)*$iRowH, 10.85, $iRowH, $PDF_STYLE_STROKED, 0, $lRGB, 0.01) Else _Draw_Rectangle($iX+$iColW2, $iY+$iH-($i+1)*$iRowH, $iColW, $iRowH, $PDF_STYLE_STROKED, 0, $lRGB, 0.01) EndIf endif _SetColourStroke(0) Local $sText = "Row "&$i&": Col "&$j If $SyslogArray[$i][$j] = "" Then $SyslogArray[$i][$j] = "" EndIf Local $sText = $SyslogArray[$i][$j] Local $sLength = Round(_GetTextLength($sText, "_Calibri", 10),1) $lScale = Ceiling(0.75*$iColW * 100/ $sLength) _SetColourFill($lTxtColor) _DrawText($iX+$iColW2+$iColW/10, $iY+$iH-($i+1)*$iRowH + ($iRowH-10/_GetUnit())/2, $sText, "_TimesT", 10, $PDF_ALIGN_LEFT, 0) _SetTextHorizontalScaling(100) _SetColourFill(0) Next Next EndFunc
-
Hello all, Is there a way that I can clear the buffer for this script? What I have is a gui that I have that launches a report based on what I tell it to look for (in the gui). But if I run a report that has 5 pages, it runs fine. But if I run a report that has 4 pages right after, it will leave the 5th page of the last report. Hope I am explaining it right. Let me know if you have any questions.
-
Here is my example script that I just tested, and gave me the page cannot be displayed. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister () $oIE = _IECreateEmbedded () GUICreate("Embedded Web control Test", 640, 580, _ (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _ $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360) $GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30) $GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30) $GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30) $GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30) GUISetState() ;Show GUI _IENavigate ($oIE, "http://toronto8.MyCompanyName.com/exchange/") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $GUI_Button_Home _IENavigate ($oIE, "http://toronto8.MyCompanyName.com/exchange/") Case $msg = $GUI_Button_Back _IEAction ($oIE, "back") Case $msg = $GUI_Button_Forward _IEAction ($oIE, "forward") Case $msg = $GUI_Button_Stop _IEAction ($oIE, "stop") EndSelect WEnd GUIDelete() Exit
-
Hmm, doesn't seem to work either. Any other ideas?
-
ya, thats what I thought. If other pages work, then so should this one. I have multiple webpages that work fine (both internal web pages, and external web pages) and they all work fine. but as soon as I try web outlook, it says "Page cannot be dispalyed". Its hard to post my script because it is many thousand lines. but here is the couple lines that are important. $oIEDashboard = _IECreateEmbedded() $WebPageDashboard = GUICtrlCreateObj($oIEDashboard, 5, 85, 880, 605) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) _IENavigate($oIEDashboard, "http://toronto8.MyCompanyName.com/exchange/") But, if I type http://toronto8.MyCompanyName.com/exchange/ Into my internet explorer, it asks for a username and password, then works.
-
I have a gui that I have allot of things in. I am trying to embed the web version of outlook in the gui using ie.au3. I am not trying to open a webpage through outlook, if that is what you mean.
-
I had another thought. Could it be because it is asking for a username and password when I use internet explorer? Is there anything I can do to push my username and password to the gui and see if that is it?
-
Hello All, I am trying to open an embedded page (Microsoft web outlook) and it is saying "Page Cannot be displayed". When I try through internet explorer, it opens fine (first asking for your username and password). Has anyone had any luck with embedding microsoft web outlook into their gui?
-
simple DateTimeInZone($zone) function?
bartekd replied to somdcomputerguy's topic in AutoIt General Help and Support
that works like a charm. Thanks very much for your help. -
simple DateTimeInZone($zone) function?
bartekd replied to tobject's topic in AutoIt General Help and Support
I know that this is an old post, but can someone help me out? I am trying to get this script to work, but I think google changed their page, and it is no longer working right. Here is the code that I see when I pull the source of the page. Can someone help with the stringregexp part? <td style="font-size: medium;"><b>22:27</b> Sunday (EDT) - <b>Time</b> in <b>Toronto, ON, Canada</b></td> I want to extract the time only. -
Lan PC's screenshot?
bartekd replied to richietheprogrammer's topic in AutoIt General Help and Support
Did you figure it out? It saves to c:\Screenshots\ First it creates the directory if it doesn't exist. If it does exist, then it just saves to that folder. -
Lan PC's screenshot?
bartekd replied to richietheprogrammer's topic in AutoIt General Help and Support
I have done this before. Its kinda tricky to setup, but you can do it. This is how I did it. First I created the program to take the screenshot. I found a function on these forums to take a screenshot. All you need is the DLL in the same directory as the exe (After you compile this script). Here is the screenshot script that I have modified a bit. instead of pointing it to the C drive, you can even point it to a share on a server. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=camera2.ico #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $h_DllCaptDLL = DllOpen("captdll.dll");Open it only once at the beginning and close it once at the end. Not every time the while loops. FileCopy(@ScriptDir & "\captdll.dll","C:\windows\system32\captdll.dll",1) ;~ #NoTrayIcon $Count = 0 ;=========================================================================================C Drive DirCreate("C:\Screenshots\") Global $FileName = ("C:\Screenshots\"& @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName) For $count1 = 0 to 30 If FileExists($FileName & "-" & $Count1 & ".jpeg") Then $count = $Count+1 EndIf Next $msg = "" $msg2 = "Local C Drive " $Window = "Program Manager" ;Executes the fuctions created below. Print_Window() Terminate() ;Function that prints the screen Func Print_Window () $Size = WinGetPos($Window) DllCall($h_DllCaptDLL, "int:cdecl", "CaptureRegion", "str", $FileName & "-" & $Count & ".jpeg", "int", $Size[0], "int", $Size[1], "int", $Size[2], "int", $Size[3], "int", 1000) EndFunc ;Fucntion that exists Func Terminate () Exit EndFunc ;Fuction that closes the dll file after the above function closes the sctipt Func OnAutoItExit() DllClose($h_DllCaptDLL);closing the dll now that the script is exiting. TrayTip ( $msg & " Screenshot Taken","Screenshot saved to " & $msg2 & @CRLF& @CRLF & @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName & "-" & $Count & ".jpeg", 1 ) sleep(3500) ;~ MsgBox(1,$msg & " Screenshot Taken","Screenshot saved to " & $msg2 & @CRLF& @CRLF & @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName & "-" & $Count & ".jpeg",15) EndFunc Then you need to download psexec. You can launch the exe that you have compiled (Above) remotely on the remote computer. This will create a screenshot on that computer, and save it to a network drive. RunWait("cmd /c " & "psexec \\" & "**StationName**" & " -u **DomainName**\" & "**Username**" & ' -p ' & "**Password**" & " -i -c \\**ServerName**\C$\Screenshot.exe", "") Hope that can get you started. -
_AD -> Use specific domain controller
bartekd replied to bartekd's topic in AutoIt General Help and Support
thanks again water. You have been a great help. -
_AD -> Use specific domain controller
bartekd replied to bartekd's topic in AutoIt General Help and Support
I think I have got it to work. I changed this Global $iValue = _AD_DeleteObject($sObject, _AD_GetObjectClass(_AD_FQDNToSamAccountName($sObject))) to this Global $iValue = _AD_DeleteObject($sObject, "user") Just going to check everything, and make sure the change was made on the right domain controller. -
_AD -> Use specific domain controller
bartekd replied to bartekd's topic in AutoIt General Help and Support
I did that, and I still get the same reply. To make sure that I have the right settings, I ran this on the domain controller, and got the output. _AD_Open() ClipPut("$sAD_DNSDomain: " & $sAD_DNSDomain & @CRLF & "$sAD_HostServer: " & $sAD_HostServer & @CRLF & "$sAD_Configuration: " & $sAD_Configuration & @CRLF) _AD_Close() -
_AD -> Use specific domain controller
bartekd replied to bartekd's topic in AutoIt General Help and Support
Thanks again Water. I receive the below message after I try it this way. This is the error code (-2147352567) -
_AD -> Use specific domain controller
bartekd replied to bartekd's topic in AutoIt General Help and Support
Thanks Hannes123, Thats one of the reasons. I know that once you make the change to one of the DCs, it will replicate, but Every server keeps event logs of what was done on that server (and the event logs only stay on the server that you made the change on). We use these event logs to run reports. We need to run reports for certain user deletions, and I thought it would be easier to just delete the users that I need off of the one domain controller if I will need a report for them. The other reason is yes, there are multiple sites at my location. So if I want to reset a password for a user in another site, I reset it on my computer, which uses the domain controller I am currently connected to. if I reset it, the user in the other location will have to wait until all the info replicates over before they can log in. hope that all makes sense. If possible, I would like to not input the username and password. something like this, but it doesn't want to work. $SDNSDomain = "DC=**domain name**,DC=com" $SHostServer = "dOMAIN CONTROLLER.DOMAINNAME.com" $SConfiguration = "CN=dOMAIN CONTROLLER,CN=Sites,CN=Configuration,DC=dOMAIN NAME,DC=com" _AD_Open($SDNSDomain, $SHostServer, $SConfiguration) -
Hello All, Using the active directory UDF's that someone has created, am I able to make a change on a specific domain controller? At my work, there are a couple different domain controllers, so I believe it connects to the one that I am currently connected to. What I would like is to connect to a specific server every time. I have looked, and tried, and can't seem to get it to work. I believe it is with this statement that it needs to be done. Please let me know. Here is the code that I am using to test how it works. Let me know if there is anything else that is needed. #AutoIt3Wrapper_AU3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_AU3Check_Stop_OnWarning=Y ; ***************************************************************************** ; Example 1 ; Deletes an AD object. ; ***************************************************************************** #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; Open Connection to the Active Directory $SUserId = "UserName" $SPassword = "Password" $SDNSDomain = "DC=**domain name**,DC=com" $SHostServer = "dOMAIN CONTROLLER.DOMAINNAME.com" $SConfiguration = "CN=dOMAIN CONTROLLER,CN=Sites,CN=Configuration,DC=dOMAIN NAME,DC=com" _AD_Open($SUserId, $SPassword, $SDNSDomain, $SHostServer, $SConfiguration) ;~ _AD_Open() Global $iReply = MsgBox(308, "Active Directory Functions - Example 1", "This script deletes an AD object." & @CRLF & @CRLF & _ "Are you sure you want to change the Active Directory?") If $iReply <> 6 Then Exit ; Enter object to delete #region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Active Directory Functions - Example 1", 814, 124) GUICtrlCreateLabel("Object to delete (FQDN or sAMAcccountName):", 8, 10, 231, 17) Global $IObject = GUICtrlCreateInput("", 241, 8, 559, 21) Global $BOK = GUICtrlCreateButton("Delete object", 8, 72, 130, 33) Global $BCancel = GUICtrlCreateButton("Cancel", 728, 72, 73, 33, BitOR($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 Global $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $BCancel Exit Case $BOK Global $sObject = GUICtrlRead($IObject) ExitLoop EndSwitch WEnd ; Delete object Global $iValue = _AD_DeleteObject($sObject, _AD_GetObjectClass(_AD_FQDNToSamAccountName($sObject))) If $iValue = 1 Then MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sObject & "' successfully deleted") ElseIf @error = 1 Then MsgBox(64, "Active Directory Functions - Example 1", "Object '" & $sObject & "' does not exist") Else MsgBox(64, "Active Directory Functions - Example 1", "Return code '" & @error & "' from Active Directory") EndIf ; Close Connection to the Active Directory _AD_Close()
-
Remove embeded Excel, and add new one
bartekd replied to bartekd's topic in AutoIt General Help and Support
thanks Melba23, i will keep this in mind next time. Juvigy, that seems to have worked. Thanks for your help. -
Remove embeded Excel, and add new one
bartekd replied to bartekd's topic in AutoIt General Help and Support
Anybody have any ideas? Please -
Hello All, I have a gui with tabs in it. I am trying to have one of the tabs have a excel spreadsheet in it. But what I am trying to figure out is how to remove the embeded object (so that I can add a new one to replace it). I tried both of these, but they both don't remove it. $oExcelDoc.Close (0) ; Close the excel workbook - Save prompt will not open OR _ExcelBookClose($oExcelDoc) Here is my part of script.... $Spreadsheets = GUICtrlCreateTabItem("Spreadsheets"); end tabitem definition $FileName = 'C:\test1.xls' if not FileExists($FileName) then Msgbox (0,"Excel File Test","Can't run this test, because it requires an excel file in "& $FileName) ;~ Exit endif $oExcelDoc = ObjGet($FileName) ; Get an excel Object from an existing filename if IsObj($oExcelDoc) then ;~ GUICreate ( "Embedded ActiveX Test", 640, 580, (@DesktopWidth-640)/2, (@DesktopHeight-580)/2 ) $GUI_ActiveX = GUICtrlCreateObj( $oExcelDoc, 15, 50 , 870 , 640 ) With $oExcelDoc .CommandBars("Full Screen").Visible = False .CommandBars("Standard").Enabled = False .CommandBars("Formatting").Enabled = False .CommandBars("Control Toolbox").Enabled = False .CommandBars("Drawing").Enabled = False .CommandBars("Forms").Enabled = False .CommandBars("Worksheet Menu Bar").Enabled = False .Application.DisplayFormulaBar = False EndWith EndIf ;~ $oExcelDoc.Close (0) ; Close the excel workbook - Save prompt will not open ;_ExcelBookClose($oExcelDoc)
-
Nice thanks All. Can't believe it was so simple.
-
NIce, I think that may have been it. I probably have an old version of SCITE4autoit Thanks for your help. Anyone know where to get some good icons?
-
I tried the full compile, using F7, didn't work. I tried the full path, and the same path where the file is located, both didn't work. #AutoIt3Wrapper_icon=icon.ico And I tried #AutoIt3Wrapper_icon=C:\icons\icon.ico