תכנות

4.6k נושאים 37.8k פוסטים

קטגוריות משנה


  • 22 נושאים
    137 פוסטים

    שלום לכולם
    התבקשתי רבות מחברים פיתרון לבעיה הידועה לבצע מיזוג דואר, אך לשמור קובץ PDF נפרד לכל רשומה, עם שם מותאם אישית.

    אפרט כאן במדריך שלב אחר שלב איך לבצע זאת, תהיו איתי עד הסוף מקווה שתהנו...

    נתחיל...

    שלב א:

    ראשית בקובץ ה- Excel של רשימת הנמענים, הוסיפו לטבלת הנתונים ארבעה עמודות בשמות כדלהלן (חשוב שהשמות יהיו מדויקים ללא רווחים מיותרים - לתשומת ליבכם):

    DocFolderPath

    DocFileName

    PdfFolderPath

    PdfFileName

    שלב ב:
    צרו שתי תיקיות נפרדות, אחד לקבצי הפלט בפורמט docx, ואחד לקבצי הקלט בפורמט pdf, העתיקו את נתיב התיקייה של קבצי ה- docx והדביקו אותם עבור כל רשומה בשדה שיצרתם בשם DocFolderPath, לאחמ"כ חזרו על הפעולה והפעם העתיקו את נתיב התיקייה של קובצי ה- PDF והדביקו בשדה PdfFolderPath.
    בשדה DocFileName כתבו את השם של הקובץ עבור הרשומה - ניתן להשתמש בנוסחאות, כמו"כ בשדה PdfFileName כתבו את שם הקובץ כנ"ל.

    שלב ג:
    פתחו את קובץ ה- word והשלימו את פעולת המיזוג כרגיל, עצבו את המסמך כרצונכם.

    שלב ד:
    פתחו את לשונית מפתחים בקובץ ה- word פתחו את עורך הקוד הוסיפו מודל חדש מצו"ב צילום מסך:
    3eb2538f-9ab1-41eb-a1df-452212916da6-image.png

    הדביקו את הקוד הבא:

    Sub MailMergeToPdfBasic() ' Mark the start of the Subroutine (i.e. Macro) and name it "MailMergeToPdf" ' Macro created by Imnoss Ltd ' Please share freely while retaining attribution ' Last Updated 2021-05-03 Dim masterDoc As Document, singleDoc As Document, lastRecordNum As Long ' Create variables ("Post-it Notes") for later use Set masterDoc = ActiveDocument ' Identify the ActiveDocument (foremost doc when Macro run) as "masterDoc" masterDoc.MailMerge.DataSource.ActiveRecord = wdLastRecord ' jump to the last active record (active = ticked in edit recipients) lastRecordNum = masterDoc.MailMerge.DataSource.ActiveRecord ' retrieve the record number of the last active record so we know when to stop masterDoc.MailMerge.DataSource.ActiveRecord = wdFirstRecord ' jump to the first active record (active = ticked in edit recipients) Do While lastRecordNum > 0 ' create a loop, lastRecordNum is used to end the loop by setting to zero (see below) masterDoc.MailMerge.Destination = wdSendToNewDocument ' Identify that we are creating a word docx (and no e.g. an email) masterDoc.MailMerge.DataSource.FirstRecord = masterDoc.MailMerge.DataSource.ActiveRecord ' Limit the selection to just one document by setting the start ... masterDoc.MailMerge.DataSource.LastRecord = masterDoc.MailMerge.DataSource.ActiveRecord ' ... and end points to the active record masterDoc.MailMerge.Execute False ' run the MailMerge based on the above settings (i.e. for one record) Set singleDoc = ActiveDocument ' Identify the ActiveDocument (foremost doc after running the MailMerge) as "singleDoc" singleDoc.SaveAs2 _ FileName:=masterDoc.MailMerge.DataSource.DataFields("DocFolderPath").Value & Application.PathSeparator & _ masterDoc.MailMerge.DataSource.DataFields("DocFileName").Value & ".docx", _ FileFormat:=wdFormatXMLDocument ' Save "singleDoc" as a word docx with the details provided in the DocFolderPath and DocFileName fields in the MailMerge data singleDoc.ExportAsFixedFormat _ OutputFileName:=masterDoc.MailMerge.DataSource.DataFields("PdfFolderPath").Value & Application.PathSeparator & _ masterDoc.MailMerge.DataSource.DataFields("PdfFileName").Value & ".pdf", _ ExportFormat:=wdExportFormatPDF ' Export "singleDoc" as a PDF with the details provided in the PdfFolderPath and PdfFileName fields in the MailMerge data singleDoc.Close False ' Close "singleDoc", the variable "singleDoc" can now be used for the next record when created If masterDoc.MailMerge.DataSource.ActiveRecord >= lastRecordNum Then ' test if we have just created a document for the last record lastRecordNum = 0 ' if so we set lastRecordNum to zero to indicate that the loop should end Else masterDoc.MailMerge.DataSource.ActiveRecord = wdNextRecord ' otherwise go to the next active record End If Loop ' loop back to the Do start End Sub ' Mark the end of the Subroutine

    שלב ה וסיום:
    סגרו את עורך הקוד.
    לחצו על כפתור פקודות מאקרו שבכרטיסיית מפתחים, בחרו את המאקרו בשם MailMergeToPdfBasic ולחצו הפעל מצו"ב צילום מסך
    3890ce69-c0e9-4f30-89ce-3e97b7de750b-image.png

    כעת שבו בנחת והמתינו עד ליצירת כל הקבצים, להנאתכם תפתחו את תיקיות הפלט שיצרתם וגלו שהיא מלאה קבצים קובץ לכל רשומה בשם המתאים שהגדרתם לה.

    מקור

  • ארכיון האתר הקודם והחביב קוד-613

    1k נושאים
    10k פוסטים

    @אבי אמר בשוב, צילומי הצ'קים בבנקים:

    התעסקתי לאחרונה עם סורקים של חברת MAGTEK, הם ידידותיים ונוחים להתממשקות, אבל כמדומני שהבנקים בישראל מוכנים לקבל סריקות רק מסורקים של חברת PANINI

    @אבי איך יוצרים אתך קשר?

  • 31 נושאים
    133 פוסטים

    יש כמה נוסחאות חדשות שממש משנות את כללי המשחק בגוגל שיטס:

    CHOOSECOLS לבחירת עמודות ממערך CHOOSEROWS לבחירת שורות ממערך WRAPROWS להמרת מערך חד ממדי לרב ממדי - פריסה לשורות WRAPCOLS כנ"ל - פריסה לעמודות HSTACK ו VSTACK - הפעולה של {} אך בלי סוגריים - לא משמעותי לכאורה

    והעולה על כולנה, סוף סוף:

    LET - ליצירת משתנים.

    כל אלו מצטרפות לפונקציות שנוספו מוקדם יותר -
    https://blog.sheetgo.com/google-sheets-formulas/10-new-google-sheets-functions/

    וכלול בתוכם - LAMBDA, MAP (חלקי - לא עובד לקנן ב MAP ודומיו מערכים אחרים), פונקציות בעלות שם, וכו' ע"ש בקישור.

  • חיבור קובץ PHP לMYSQL נכשל

    7
    0 הצבעות
    7 פוסטים
    66 צפיות

    יפה
    הכנסתי 3306 והצליח לטוען את המסד (יש בעיות אחרות אבל אני מקווה שאסתדר...)

    https://stackoverflow.com/questions/27113648/not-able-to-connect-to-mysql-php-xampp
    מכאן הבנתי שצריך להכניס את הפורט של אפאצ'י
    (לאחרונה כתבת שכשיש סטייק לא צריך תחומים, אז טעית...)

  • 0 הצבעות
    8 פוסטים
    61 צפיות

    @dovid אמר בתחליף לעורך NANO לעריכת קבצים בשרת אובונטו:

    @yossiz
    א. אפשר עם Cloud9 ששורש העץ יהיה / ולא ~/.
    ב. לפתוח ודאי שאפשר ולכן אני חושב שבעת השמירה הוא ידרוש הרשאות, זה אכן מעניין לבדוק.
    (אצלי אני רוט תמיד ולא צריך sudo, אכן אנטי בסט פרקטיקס...).

    זה בדיוק היה השאלה שלי.
    בIDE שלי PHPSTORM וודאי שיש טרמינל ושרת קבצים מרוחק, הבעיה היא שהשרת קבצים מרוחקים הינו ללא sudo וכאן אני נתקע

  • מספר שרתי אינטרנט בשרת אחד

    12
    0 הצבעות
    12 פוסטים
    149 צפיות

    ב"ה הסתדרתי עם הכל, כולל עצירת האפאצ'י ומעבר הכל לnginx.
    להלן ההגדרות המלאות למי שזה יכול לעזור

    # Implement upstream connection to PHP-FPM # "phpfpm" here is a name for this upstream connection, which you can customize # I create a custom upstream connection per vhost, to better segregate PHP processes by vhost # To do the same, you need a unique upstream name, and a unique filename for your php5-fpm.sock file upstream phpfpm { server unix:/var/run/php/php7.2-fpm.sock; #avoid sockets for nginx-fpm on Linux, they are good for BSD #server 127.0.0.1:9000; } server { # Listening on port 80 without an IP address is only recommended if you are not running multiple v-hosts # Bind to the public IP bound to your domain listen 80; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/mydomainname.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/mydomainname.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot # Specify this vhost's domain name server_name mydomainname.com; root /var/www/public_html; index index.php index.html index.htm; # Specify log locations for current site access_log /var/www/mydomainname.com/log/access.log; error_log /var/www/mydomainname.com/log/error.log warn; # Typically I create a restrictions.conf file that I then include across all of my vhosts #include conf.d/restrictions.conf; # I've included the content of my restrictions.conf in-line for this example # BEGIN restrictions.conf # Disable logging for favicon location = /favicon.ico { log_not_found off; access_log off; } # Disable logging for robots.txt location = /robots.txt { allow all; log_not_found off; access_log off; } # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). location ~ /\. { deny all; access_log off; log_not_found off; } # END restrictions.conf # Typically I create a yiiframework.conf file that I then include across all of my yii vhosts #include conf.d/yiiframework.conf; # I've included the content of my yiiframework.conf in-line for this example # BEGIN yiiframework.conf # Block access to protected, framework, and nbproject (artifact from Netbeans) location ~ /(protected|framework|nbproject) { deny all; access_log off; log_not_found off; } # Block access to theme-folder views directories location ~ /themes/\w+/views { deny all; access_log off; log_not_found off; } # Attempt the uri, uri+/, then fall back to yii's index.php with args included # Note: old examples use IF statements, which nginx considers evil, this approach is more widely supported location / { #root /var/www/public_html/yii/frontend/web; try_files $uri $uri/ /yii/frontend/web/index.php$is_args$args; } # END yiiframework.conf location = / { #rewrite /yii/frontend/web/index.php last; try_files $uri /yii/frontend/web/index.php/ /yii/frontend/web/index.php; } # Tell browser to cache image files for 24 hours, do not log missing images # I typically keep this after the yii rules, so that there is no conflict with content served by Yii location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff2|ttf|woff)$ { root /var/www/public_html/yii/frontend/web; #expires 24h; log_not_found off; } # Block for processing PHP files # Specifically matches URIs ending in .php location ~ \.php$ { try_files $uri =404; # Fix for server variables that behave differently under nginx/php-fpm than typically expected fastcgi_split_path_info ^(.+\.php)(/.+)$; # Include the standard fastcgi_params file included with nginx include fastcgi_params; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_index index.php; # Override the SCRIPT_FILENAME variable set by fastcgi_params fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # Pass to upstream PHP-FPM; This must match whatever you name your upstream connection fastcgi_pass phpfpm; } } server { listen 80; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/api.mydomainname.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/api.mydomainname.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot #root /var/www/sub.test.com; #index index.html index.htm index.nginx-debian.html; server_name api.mydomainname.com www.api.mydomainname.com; location / { proxy_pass http://127.0.0.1:8080; #proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # the next 3 lines are for cocket protocol nedded both for web ui and mobile app proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }

    תודה לעוזרים

  • יצירת שדה מפתח ראשי

    1
    0 הצבעות
    1 פוסטים
    30 צפיות
    אין תגובות
  • פתיחת כתובת הgw בדפדפן באמצעות cmd

    הועבר
    2
    0 הצבעות
    2 פוסטים
    171 צפיות

    בינתיים ענה לי מישהו בsuper user

    For /F "tokens=13 delims= " %X in ('ipconfig ^| find "Default Gateway"') do start http://%X
  • רוחב עמודה רבוע ב https://datatables.net

    3
    0 הצבעות
    3 פוסטים
    31 צפיות

    משום מה פשוט לא עובד.
    אולי בגלל שיש שם הרבה טקסט?

  • קיצור דרך בויזואל סטודיו

    10
    0 הצבעות
    10 פוסטים
    79 צפיות

    @WWW אמר בקיצור דרך בויזואל סטודיו:

    קודם כל, כל לחיצה מוסיף עוד //,

    אני מבין למה עשו את זה
    כי אם יש לך בלוק של הרבה שורות קוד כאשר באמצע יש כמה הערות, ואתה רוצה להפוך את כל הבלוק להערה, אם לא היו מוסיפים עוד //, אי אפשר אח"כ לחזור למצב הקודם כי אין הבחנה בין מה שהיה כבר הערה לשורות קוד.

  • דרוש מתכנת בוורדפרס וכדו'

    2
    0 הצבעות
    2 פוסטים
    44 צפיות

    בגדול אני יכול.
    אפשר להתכתב במייל.

  • למה זה לא מצליח - JS

    15
    0 הצבעות
    15 פוסטים
    106 צפיות

    @yossiz אמר בלמה זה לא מצליח - JS:

    למה לא נכון להשתמש ב-this?
    https://stackoverflow.com/questions/17665489/using-this-inside-an-event-handler

    לא הכרתי, תודה רבה

  • AWS S3

    15
    0 הצבעות
    15 פוסטים
    201 צפיות

    חלק מהבעיה שלי היתה שה-SDK שלהם נתמך רק בדוט נט 3.5 או 4.5
    ומשתמשים אצלנו ב-2.0 ...

  • שליחת נוטיפיקציות ios

    הועבר
    1
    0 הצבעות
    1 פוסטים
    87 צפיות
    אין תגובות
  • 0 הצבעות
    7 פוסטים
    98 צפיות

    קוד ל PHP

    function ValidateID($str) { //Convert to string, in case numeric input $IDnum = strval($str); //validate correct input if(! ctype_digit($IDnum)) // is it all digits return "שגיאת קלט"; if((strlen($IDnum)>9) || (strlen($IDnum)<5)) return "שגיאת קלט"; //If the input length less then 9 and bigger then 5 add leading 0 while(strlen($IDnum)<9) { $IDnum = '0'.$IDnum ; } $mone = 0; //Validate the ID number for($i=0; $i<9; $i++) { $char = mb_substr($IDnum, $i, 1); $incNum = intval($char); $incNum*=($i%2)+1; if($incNum > 9) $incNum-=9; $mone+= $incNum; } if($mone%10==0) return "נכון"; else return "לא נכון"; }
  • התחלת תהליך לאחר סיום תהליך

    6
    0 הצבעות
    6 פוסטים
    137 צפיות

    זה עדין לא עבד. נסיתי בדרך אחרת.

    let mistames = $w("#dataset4").getCurrentItem()._id; let scum = $w('#input15').value let hazmana = [] await $w("#repeater99").forEachItem(($item, itemData, index) => { let id = itemData._id let muzar = itemData.muzar let camut = Number($item('#input4').value) let mehir = Number(itemData.mehir) let sac2 = mehir * camut let toInsert2 = { "lakoh": mistames, "muzarim": id, "camut": camut, "title": muzar, "sach": sac2 }; wixData.insert("sal", toInsert2) .then((results) => { let item = results let id2 = item._id console.log(id2); hazmana.push(id2) }) .catch((err) => { console.log(err); }); }) console.log(" hazmana: " + hazmana); let toInsert = { "lakoh": mistames, "mehir": scum, "hazmana": ($w("#dataset3").getTotalCount()) + 1001, "muzarim": hazmana, }; await wixData.insert("hazmanot", toInsert) .then((results) => { // $w("#dataset3").refresh() // let item = results; // let idhazmana = results.id $w('#group1').show() }) .catch((err) => { console.log(err); });

    אלא שעדין hazmana מודפס לי ריק.
    כלומר לא נכנסים בסוף המוצרים שבסל, להזמנה. האובייקט hazmana נשאר ריק.

  • דרוש תוסף חדש

    הועבר
    8
  • ריענון מחדש של חלק מתהליך NODEJS

    5
    0 הצבעות
    5 פוסטים
    48 צפיות

    @yossiz כן. שמה זה אוטומטי לפי שינוי בקבצים.

  • עזרה בניסוח פקודה בלינוקס

    3
    0 הצבעות
    3 פוסטים
    33 צפיות

    מצאתי
    פשוט היה צריך להוסיף סוגריים

    [[ `arch` = *'64'* ]] && echo yes || echo no
  • מה ההבדל בין הפצות לינוקס?

    8
    0 הצבעות
    8 פוסטים
    221 צפיות

    @yossiz נכון
    אבל להסביר את ההבדלים בכזו זריזות זה גאונות...
    ואני מכיר את לינוקס ומלחמת ההפצות כבר 18 שנה בערך....

  • בעיה בהרצת פורום nodebb, עם Mongo

    5
    0 הצבעות
    5 פוסטים
    47 צפיות

    @מנצפך אמר בבעיה בהרצת פורום nodebb, עם Mongo:

    Process: 26064 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exite

    אני רואה שאתה מריץ בJS רק את mongod וזה עובד לך תקין.
    ומצד שני בשגיאה רואים שהפקודה שהסרביס מנסה להריץ היא

    ExecStart=/usr/bin/mongod --config /etc/mongod.conf

    תנסה לשנות את פקודת ההרצה ל

    ExecStart=/usr/bin/mongod

    ותבדוק אם זה עובד
    עוד משהו,
    תבדוק, אולי בכלל הבעייה שאצלך mongod בכלל נמצא במקום אחר ולא ב /usr/bin

  • אחסון שרת VPS בארץ

    3
    0 הצבעות
    3 פוסטים
    50 צפיות

    תלוי במה ואיפה.
    יש דברים שיש לישראל ייתרון מובהק.
    (אישית יש לי שרתים בארץ ובחו"ל - בארץ בעיקר בגלל דרישות רגולוטריות)

    מבחינת עלויות המחירים בארץ פי עשרות אחוזים מחו"ל.

    בארץ אני ממליץ מאד על אינטרהוסט. אני מאד מרוצה מהם.
    יש להם שירות ממש טוב.

  • סינון קבוצתי ב'תכונות' של ווקומרס

    1
    0 הצבעות
    1 פוסטים
    25 צפיות
    אין תגובות
בא תתחבר לדף היומי!