nhass | Posts: 23

Reporting

0 votes
Silanis I’m a developer for Mendota Insurance. We’re still in the development phase using your eSignLive product in your sand box environment. I have some questions around the reporting. We were told the portal has just a small overview of what’s happening and to submit a post to the forum for custom reporting needs. First off when we create a package we append three custom attributes. We were thinking we could filter and search by those attributes in the portal, but cannot. So do you have any example code you can provide where we can search for packages based on those attributes (one or more)? Does your API provide pre-canned type resultsets that we can just call; something like a method that would return us all packages created during a timeframe which aren’t completed yet? Or packages which meet one of our custom attributes and are expired. Any code around reporting would be very helpful. We are .Net (3.5) shop using C# We’re using Silanis.ESL v2.0.50727 Regards Nathan Hass

mwilliams | Posts: 957

Reply to: Reporting

0 votes
Hi Nathan, We can definitely do that with the .NET SDK. Can you give me an example of what the attributes you pass might be so I can create an example that makes more sense?

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael For reference purposes each of our Document Packages will have 1 or 2 signers. Here are the custom attributes we plan on adding to each document package:
DocumentPackageAttributes attributes = new DocumentPackageAttributes();
attributes.Append("PolicyNumber", policyNumber);
attributes.Append("AgentCode", agentCode);
attributes.Append("TransType", transType);
So from a reporting / query standpoint we would be looking to do something like: Get a list of all Document Packages where the PolicyNumber equals some value. This may also include a data range (using the package create date for the compare). Get a list of all Document Packages where the AgentCode equals some value. We will may want to filter this further by saying where one of the signer’s status is not complete (or some other status). This may also include a data range. Get a list of all Document Packages where the TransType equals some value. Again this may also include a data range. In terms of columns returned we would like to see our custom attributes, package name, associated signers, the status of each signer or the overall status of the package (i.e. complete or pending). Since we are a .Net shop we would most likely be binding the results to some sort of data-bound control like a grid view. My hunch is that we would first need to get a list of data and most likely have to call separate API functions to get the columns we want like associated signers / status. Thanks Nathan

mwilliams | Posts: 957

Reply to: Reporting

0 votes
Just wanted to let you know I haven't forgotten about you. :) I'll be working on this in the morning and should have you something, soon!

mwilliams | Posts: 957

Reply to: Reporting

0 votes
I haven't gotten it all working, just yet. I'm about there. I can tell you how you'll have to do it though. There is a function: eslClient.PackageService.GetUpdatedPackagesWithinDateRange that will allow you to pull your packages from a particular date range. The parameters you pass through this function are (status, page request, start date, end date), so you could pass something like:
eslClient.PackageService.GetUpdatedPackagesWithinDateRange(DocumentPackageStatus.COMPLETED, new PageRequest(1, 50), new DateTime(2016,1,1), DateTime.Now);
This would return you the first page of 50 completed packages (that's what the page request numbers mean - start at record 1 and have 50 on the page) between January 1st and today. You are also given the total number of packages that fall into this category so you can loop through the different pages. From there, you'd simply look at each package's attributes to see if it matches your search criteria from your application and add the values you want from that package to your list for display in your report. Feel free to give it a try. I'll post when I have a block of code that returns everything you're wanting. Also, let me know if you have any questions.

mwilliams | Posts: 957

Reply to: Reporting

0 votes
Found out where I had an issue. I was losing my API_Key passing it from one class to another and didn't realize it. Anyways, the following code gives me the attached result. You could add checks in your loops to only add rows that meet your search criteria or export all rows as a CSV and process it further from there.
          EslClient eslClient = new EslClient(apiKey, apiUrl);
            IList packageStatuses = new List();
            packageStatuses.Add(DocumentPackageStatus.ARCHIVED);
            packageStatuses.Add(DocumentPackageStatus.COMPLETED);
            packageStatuses.Add(DocumentPackageStatus.DECLINED);
            packageStatuses.Add(DocumentPackageStatus.OPTED_OUT);
            packageStatuses.Add(DocumentPackageStatus.EXPIRED);
            packageStatuses.Add(DocumentPackageStatus.SENT);
            var csv = new StringBuilder();
            csv.Append(string.Format("{0},{1},{2},{3},{4},{5},{6}{7}", "Policy Number", "Agent", "Transaction Type", "Package Name", "Signer", "Signer Status", "Package Status", Environment.NewLine));
            
            foreach (DocumentPackageStatus dpStatus in packageStatuses)
            {
                Page packages = eslClient.PackageService.GetUpdatedPackagesWithinDateRange(dpStatus, new PageRequest(1, 50), sdate, DateTime.Now);
                int i = 0;
                while (i  packages.TotalElements)
                {
                    foreach (DocumentPackage mypackage in packages)
                    {
                        foreach (Signer mysigner in mypackage.Signers)
                        {
                            if (mysigner.Email != "{SENDER_EMAIL}")
                            {
                                string pNumber = "No value";
                                if (mypackage.Attributes.Contents.Keys.Contains("PolicyNumber"))
                                {
                                    pNumber = mypackage.Attributes.Contents["PolicyNumber"].ToString();
                                }
                                string Agent = "No value";
                                if (mypackage.Attributes.Contents.Keys.Contains("AgentCode"))
                                {
                                    Agent = mypackage.Attributes.Contents["AgentCode"].ToString();
                                }
                                string TransType = "No value";
                                if (mypackage.Attributes.Contents.Keys.Contains("TransType"))
                                {
                                    TransType = mypackage.Attributes.Contents["TransType"].ToString();
                                }
                                string pName = mypackage.Name;
                                string email = mysigner.Email;
                               var sstatus = eslClient.GetSigningStatus(mypackage.Id, mysigner.Id, null);
                                var pstatus = dpStatus.GetName();
                                var newLine = string.Format("{0},{1},{2},{3},{4},{5},{6}{7}", pNumber, Agent, TransType, pName, email, sstatus, pstatus, Environment.NewLine);
                                csv.Append(newLine);
                            }
                        }
                        i++;
                    }
                    packages = eslClient.PackageService.GetUpdatedPackagesWithinDateRange(dpStatus, new PageRequest(i, 50), sdate, DateTime.Now);
                }
            }
            Debug.Write(csv);
This loops through all packages between two dates with all the different status types and gathers the appropriate data, then writes each line to a stringbuilder that you could write out to a CSV file, if you wanted. Attached is the result when written out to my console.

Attachments
nhass | Posts: 23

Reply to: Reporting

0 votes
Thanks, this points me in the right direction.

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael, I noticed there isn't a direct Document Package Status for like not completed or not signed. So in order for me to achieve that type of status do I need to look at the following status: SENT, OPTED_OUT, and DECLINED? We don't plan on setting an expiration date for our packages so I think I can ignore that one, and I'm assuming that only completed packages get moved to an archived status. Thanks, Nathan

mwilliams | Posts: 957

Reply to: Reporting

0 votes
Correct. Those are the three statuses where the document would not have been completed, if you're not going to deal with expired packages. You're also correct on the completed packages being the only ones that can be archived. If a package is opted out of or declined, that package returns to the drafts folder.

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael, Do you know the timeframe it takes for your system to move a completed package to the Archived folder? Like is it a couple days after it has been completed (signed by all parties)? Is this something that is configurable at the account level? Thanks Nathan

mwilliams | Posts: 957

Reply to: Reporting

0 votes
The system doesn't automatically archive them, at this time. This would have to be something you did on your own. You can archive a package with the .NET SDK using the following code: eslClient.PackageService.Archive(packageId);

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael, When supplying the date range are the dates inclusive or exclusive? So if I just want to look at a single date, say 3/1/16, do I provide 3/1/16 as both the start and end date? Thanks, Nathan

mwilliams | Posts: 957

Reply to: Reporting

0 votes
They are dateTime values, so if you simply create the date without specifying a time, you'll get midnight, every time. So, in that case, you'd include the start date, but not include the end date. I believe that's how it works, anyways.

mwilliams | Posts: 957

Reply to: Reporting

1 votes
I guess I should clarify then, that a single day would need to have 11:59:59 set as the time for the end date or you could probably just use the next day. So, in your example, you should only get one day with 3/1/16 and 3/2/16 as those dates would be March 1, 2016 12:00:00 am and March 2, 2016 12:00:00 am. Hope this helps.

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael In your example where would I find the Document Package Completed Date; the date which is set after all parties have completed their signing? Thanks, Nathan

nhass | Posts: 23

Reply to: Reporting

0 votes
Michael Just following up on my previous post. How do I ascertain the Package Completed Date; date which is set after all parties have completed their signing? Thanks, Nathan

mwilliams | Posts: 957

Reply to: Reporting

0 votes
Sorry for missing your previous post. The way I generally grab the completion date is to grab it from the auditService.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off