<%[ // The code for this report is written in JavaScript (or JScript) as a sample template. // Like all the reports, you are welcome to modify the code to suit your needs. oDoc = ReportGenerator.Document; strTitle = Util.FirstNonEmpty(oDoc.Title, oDoc.Name); ]%> Comments found in @[Report.WriteText(strTitle);]@

@[Report.WriteText(strTitle);]@ Comments:

This report contains all the comments found in the document @[Report.WriteText(oDoc.Name);]@. This report gives you the opportunity to proof read the comments (notes) from that file.

<%[ var ichStartTable, ichStartCell, ichStartComments, ichStartObject; var AllObjArr = [,], strObjEval, strDefObj; ichStartTable = Report.BufferLength; // Remember the start of the table to determine if there are any comments AllObjArr = [ ["Individuals","Individuals"],["Families","Families"],["PedigreeLinks","Pedigree Links"],["Twins","Twins"],["Places","Places"],["EmotionalRelationships","Emotional Relations"],["SocialRelationships","Social Relations"],["SocialEntities","Social Entities"],["Pictures","Pictures"],["SourcesAndCitations","Sources & Citations"],["Labels","Labels"],["Shapes","Shapes"],["Bookmarks","Bookmarks"] ]; // Main loop to write the comments of all Objects for (i = 0; i < AllObjArr.length; i++) { strObjEval = AllObjArr[i][0]+".Count"; cObjCount = eval(strObjEval); if( (cObjCount > 0) ) { Report.WriteFormattedBr("{0}", AllObjArr[i][1]); // write the object.title even if no comments ichStartObject = Report.BufferLength; // Remember the position for (iObjCount = 0; iObjCount < cObjCount; iObjCount++) { if (i == 0) { oObjCount = Individuals(iObjCount); WriteCommentsForObject(oObjCount); Report.WriteT3Br("Birth Comment: ", oObjCount.Birth.Comment); Report.WriteT3Br("Birth Place Comment: ", oObjCount.Birth.Place.Comment); Report.WriteT3Br("Birth Source Comment: ", oObjCount.Birth.Source.Comment); Report.WriteT3Br("Baptism Place Comment: ", oObjCount.Birth.Baptism.Place.Comment); Report.WriteT3Br("Baptism Source Comment: ", oObjCount.Birth.Baptism.Source.Comment); Report.WriteT3Br("Death Comment: ", oObjCount.Death.Comment); Report.WriteT3Br("Death Place Comment: ", oObjCount.Death.Place.Comment); Report.WriteT3Br("Death Source Comment: ", oObjCount.Death.Source.Comment); Report.WriteT3Br("Funeral Place Comment: ", oObjCount.Death.Funerals.Place.Comment); Report.WriteT3Br("Funeral Source Comment: ", oObjCount.Death.Funerals.Source.Comment); Report.WriteT3Br("Disposition Place Comment: ", oObjCount.Death.Disposition.Place.Comment); Report.WriteT3Br("Disposition Source Comment: ", oObjCount.Death.Disposition.Source.Comment); // Display the comments for the occupations, education records, contacts and pictures WriteCommentsForCollection("Occupation Comment: ", oObjCount.Occupations); WriteCommentsForCollection("Education Comment: ", oObjCount.Educations); WriteCommentsForCollection("Contact Comment: ", oObjCount.Contacts); WriteCommentsForCollection("Picture Comment: ", oObjCount.Pictures); } // end if if (i == 1) { oObjCount = Families(iObjCount); WriteCommentsForObject(oObjCount); oCollectionUnions = oObjCount.Unions.ToGenoCollection; cUnions = oCollectionUnions.Count; for (iUnion = 0; iUnion < cUnions; iUnion++) { oUnion = oCollectionUnions(iUnion); Report.WriteT3Br("Marriage Comment: ", oUnion.Comment); Report.WriteT3Br("Marriage Place Comment: ", oUnion.Place.Comment); Report.WriteT3Br("Marriage Source Comment: ", oUnion.Source.Comment); Report.WriteT3Br("Divorce Place Comment: ", oUnion.Divorce.Place.Comment); Report.WriteT3Br("Divorce Source Comment: ", oUnion.Divorce.Source.Comment); } // for WriteCommentsForCollection("Picture Comment: ", oObjCount.Pictures); } // end if if( (i > 1) ) { strDefObj = AllObjArr[i][0]+"("+iObjCount+")"; oObjCount = eval(strDefObj); WriteCommentsForOtherObjects(AllObjArr[i][0], oObjCount); } // end if WriteEndOfCell(); } // end for if (Report.BufferLength == ichStartObject) { Report.Write("No comments found"); } // end if Report.Write("
"); } // end if } // end for // We are done looping through all the objects, so check if we have an empty table if (Report.BufferLength == ichStartTable) { ]%> No comments found! <%[ } else { // Remove the last 18 characters of HTML code "
" written to the buffer ichEnd = Report.BufferLength; Report.BufferRemoveAt(ichEnd - 18, ichEnd); } // end if ]%>
<%[ function WriteCommentsForObject(oObject) { ichStartCell = Report.BufferLength; // Remember the position of the begining of the cell, so we can remove data if no comment is found Report.WriteFormattedBr("- {&t} (id={}) :", oObject, oObject.id); ichStartComments = Report.BufferLength; Report.WriteT3Br("General Comment: ", oObject.Comment); } // end WriteCommentsForObject() function WriteCommentsForCollection(strNameCollection, collection) { if ( (collection.Count > 0) ) { // Transform the collection into a GenoPro collection for further data access var oCollection = collection.ToGenoCollection; var iElement, cElements = oCollection.Count; for (iElement = 0; iElement < cElements; iElement++) { Report.WriteT3Br(strNameCollection, oCollection(iElement).Comment); } // end for } // end if } // end WriteCommentsForCollection() function WriteCommentsForOtherObjects(strNameObject, oObject) { ichStartCell = Report.BufferLength; // Remember the position of the begining of the cell, so we can remove data if no comment is found switch (strNameObject) { case (strNameObject = "PedigreeLinks"): Report.WriteFormattedBr("- Individual: {&t} (id={&t}) ", oObject.Individual, oObject.Individual.ID); break; case (strNameObject = "Twins"): Report.WriteFormattedBr("- Family: {&t} (id={&t}) ", oObject.Family, oObject.ID); break; case (strNameObject = "Places"): Report.WriteFormattedBr("- {&t} (id={&t}) :", oObject.Name, oObject.ID); break; case (strNameObject = "EmotionalRelationships"): Report.WriteFormattedBr("- {&t} - {&t} (id 1-2: {&t}-{&t}) : {&t}", oObject.Entity1, oObject.Entity2, oObject.Entity1.ID, oObject.Entity2.ID, oObject.EmotionalLink); break; case (strNameObject = "SocialRelationships"): Report.WriteFormattedBr("- {&t} - {&t} (id 1-2: {&t}-{&t}) : {&t}", oObject.Entity1, oObject.Entity2, oObject.Entity1.ID, oObject.Entity2.ID, oObject.Connection); break; case (strNameObject = "Pictures"): Report.WriteFormattedBr("- {&t} (id={&t}) :", oObject.Name, oObject.ID); break; case (strNameObject = "SourcesAndCitations"): Report.WriteFormattedBr("- {&t} (id={&t}) :", oObject.Title, oObject.ID); break; case (strNameObject = "SocialEntities"): Report.WriteFormattedBr("- {&t} (id={&t}) :", oObject.Text, oObject.ID); break; case (strNameObject = "Labels"): Report.WriteFormattedBr("- {&t}:", oObject.Text); break; case (strNameObject = "Shapes"): Report.WriteFormattedBr("- (GenoMap: {0} - Coord. x,y: {1}):", oObject.Position.GenoMap, oObject.Position.Points); break; case (strNameObject = "Bookmarks"): Report.WriteFormattedBr("- {&t} (id={&t}) :", oObject.Name, oObject.ID); break; } // end switch ichStartComments = Report.BufferLength; Report.WriteT3Br("Comment: ", oObject.Comment); } // end WriteCommentsForOtherObjects() function WriteEndOfCell() { if (Report.BufferLength == ichStartComments) { // No comments found for this object, so remove its name from the buffer Report.BufferLength = ichStartCell; } // end if } // end WriteEndOfCell() ]%>