0

enter image description hereI would like to automate the column total using spreadtab in the table but couldn't do. Please help.

    \documentclass[12pt,a4paper,landscape]{article}
    \usepackage[left=0.75in,right=0.75in,top=0.5in,bottom=0.5in]{geometry}
    \usepackage{array} 
    \usepackage{multirow} 
    \usepackage{marvosym}
    \usepackage{graphicx} 
    \usepackage{xcolor}
    \usepackage[T1]{fontenc}
    \usepackage{lmodern}
    \usepackage{url}
    \usepackage{array}
    \usepackage{hyperref}
    \usepackage{spreadtab}

    \begin{document}
    \begin{form}
    \def\arraystretch{1.5}{
    \begin{spreadtab}{{tabular}{|>{\centering\arraybackslash}p{1.0cm}|p{4.8cm}|p{7.3cm}|>{\centering\arraybackslash}p{2.5cm}|>{\centering\arraybackslash}p{2.5cm}|>{\centering\arraybackslash}p{2.5cm}|>{\centering\arraybackslash}p{2.5cm}|}} \cline{4-7}
    \multicolumn{3}{c|}{} & \multicolumn{2}{|c|}{\textbf{Group \#1}} & \multicolumn{2}{|c|}{\textbf{Group \#2}} \\ \cline{4-7}
    \multicolumn{3}{c|}{} & \textbf{Student 1} & \textbf{Student 2} & \textbf{Student 1} & \textbf{Student 2} \\ \hline  
   \textbf{S.No.} & \multicolumn{1}{c|}{\textbf{Criteria}} & \multicolumn{1}{c|}{\textbf{Sub-Criteria}} & \ChoiceMenu[print,height=0.2cm,width=2.4cm,combo,default=,name=group1name1]{}{17MST1001   , 17MST1002 , 17MST1003 , 17MST1004 , 17MST1005 , 17MST1006 , 17MST1008,    17MST1009,  17MST1010,  17MST1011,  17MST1012,  17MST1013,  17MST1014,  17MST1015,  17MST1017,  17MST1018,  17MST1019,  17MST1020,  17MST1021,  17MST1022,  17MST1023,  17MST1024,  17MST1025,  17MST1026,  17MST1027,  17MST1028,  17MST1029,  17MST1030,  17MST1031,  17MST1032,  17MST1033,  17MST1034,  17MST1035,  17MST1036,  17MST1037,  17MST1038,  17MST1039,  17MST1040,  17MST1041,  17MST1042,  17MST1043,  17MST1044,  17MST1045,  17MST1046,  17MST1047,  17MST1048,  17MST1049,  17MST1050,  17MST1051,  17MST1052,  17MST1053,  17MST1054} & \ChoiceMenu[print,height=0.2cm,width=2.4cm,combo,default=,name=group1name2]{}{17MST1001    , 17MST1002 , 17MST1003 , 17MST1004 , 17MST1005 , 17MST1006 , 17MST1008,    17MST1009,  17MST1010,  17MST1011,  17MST1012,  17MST1013,  17MST1014,  17MST1015,  17MST1017,  17MST1018,  17MST1019,  17MST1020,  17MST1021,  17MST1022,  17MST1023,  17MST1024,  17MST1025,  17MST1026,  17MST1027,  17MST1028,  17MST1029,  17MST1030,  17MST1031,  17MST1032,  17MST1033,  17MST1034,  17MST1035,  17MST1036,  17MST1037,  17MST1038,  17MST1039,  17MST1040,  17MST1041,  17MST1042,  17MST1043,  17MST1044,  17MST1045,  17MST1046,  17MST1047,  17MST1048,  17MST1049,  17MST1050,  17MST1051,  17MST1052,  17MST1053,  17MST1054} & \ChoiceMenu[print,height=0.2cm,width=2.4cm,combo,default=,name=group2name1]{}{17MST1001    , 17MST1002 , 17MST1003 , 17MST1004 , 17MST1005 , 17MST1006 , 17MST1008,    17MST1009,  17MST1010,  17MST1011,  17MST1012,  17MST1013,  17MST1014,  17MST1015,  17MST1017,  17MST1018,  17MST1019,  17MST1020,  17MST1021,  17MST1022,  17MST1023,  17MST1024,  17MST1025,  17MST1026,  17MST1027,  17MST1028,  17MST1029,  17MST1030,  17MST1031,  17MST1032,  17MST1033,  17MST1034,  17MST1035,  17MST1036,  17MST1037,  17MST1038,  17MST1039,  17MST1040,  17MST1041,  17MST1042,  17MST1043,  17MST1044,  17MST1045,  17MST1046,  17MST1047,  17MST1048,  17MST1049,  17MST1050,  17MST1051,  17MST1052,  17MST1053,  17MST1054} & \ChoiceMenu[print,height=0.2cm,width=2.4cm,combo,default=,name=group2name2]{}{17MST1001    , 17MST1002 , 17MST1003 , 17MST1004 , 17MST1005 , 17MST1006 , 17MST1008,    17MST1009,  17MST1010,  17MST1011,  17MST1012,  17MST1013,  17MST1014,  17MST1015,  17MST1017,  17MST1018,  17MST1019,  17MST1020,  17MST1021,  17MST1022,  17MST1023,  17MST1024,  17MST1025,  17MST1026,  17MST1027,  17MST1028,  17MST1029,  17MST1030,  17MST1031,  17MST1032,  17MST1033,  17MST1034,  17MST1035,  17MST1036,  17MST1037,  17MST1038,  17MST1039,  17MST1040,  17MST1041,  17MST1042,  17MST1043,  17MST1044,  17MST1045,  17MST1046,  17MST1047,  17MST1048,  17MST1049,  17MST1050,  17MST1051,  17MST1052,  17MST1053,  17MST1054} \\ \hline  
    1. & \multirow{2}{*}{Presentation (30\%)} & Oral Presentation Skill (15\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box1]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \cline{1-1} \cline{3-7}
    2. &  & Visual Aid used (15\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box2]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \hline 
    3. & \multirow{2}{*}{Work  Accomplished (40\%)} & Quality of Work Done (20\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box3]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \cline{1-1} \cline{3-7}
   4. &  & Completion of Work (20\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box4]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \hline 
   5. & \multicolumn{2}{l|}{Asnwering the Queries (10\%)} & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box5]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \hline 
   6. & \multirow{2}{*}{Documentation (20\%)} & Content of the Report (10\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box6]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \cline{1-1} \cline{3-7}
   7. &  & Report Preparation (Formatting) (10\%) & \ChoiceMenu[print,height=0.2cm,width=1.5cm,combo,default=,name=box7]{}{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10} & & & \\ \hline 
  & \multicolumn{2}{r|}{\textbf{Grand Total} (Out of 70)} & sum(d4:d10) & & & \\ \hline
    & \multicolumn{2}{r|}{\textbf{Percentage}} & & & & \\ \hline
    \end{spreadtab}}
    \end{form}
    \end{document}
  • 1
    It won't work. spreadtab calculates the values when the pdf is created, but the values from the form are only known at use. You need another form field and javascript to update it. See e.g. the eforms manual, eformman.pdf. – Ulrike Fischer Aug 19 '17 at 12:31
  • Thank You @UlrikeFischer . I am aware of this but was little desperate to find if there is any other way exist. – Ramesh Kannan Aug 19 '17 at 14:01
  • @UlrikeFischer When I save this form, for every save I give, it produces new file (i.e, asking to save it new .pdfs), is there anyway that we can update all the saves in the single pdfs. – Ramesh Kannan Aug 19 '17 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.