resource.not.found error but report is generated anyway

0

I have two problems that I'm hoping are related.  The first problem is that I'm getting a resource.no.found error when I request my report, but the report is downloaded (exported to pdf) anyway.  The second is that the reportCompleted() event is never firing.  Same report each time, different data.  Completely repeatable. (I have a bunch of messages printing to the console for debugging purposes).

Code:

function viewReport(id, url, token, reportURL) {

            var ReportParams = [ id ];
 
            console.log("viewReport: " + reportURL);
 
            visualize({
               server : url,
               auth : {
                  token : token
               }
            }, function(v) {
               var report = v.report({
                  resource : reportURL,
 
                  events : {
                     reportCompleted : function(status) {
                    console.log("ReportCompleted event: " + reportURL);
                        exportToPdf();
                     }
                  },
                  params : {
                     "aProjectId" : ReportParams
                  },
                  error: handleError
 
               });
 
              report.params({"aProjectId" : ReportParams })
                .run(function(){ console.log("Run report: " + reportURL);  })
                .fail(handleError);
 
              function handleError(err){
             console.log("Handle Error - url: " + url);
             alert(err);
              };
 
               function exportToPdf() {
 
              console.log("Export to pdf: " + reportURL);
 
              report.export({
                     outputFormat : "pdf"
                  }).done(function(link) {
                     window.open(link.href, "application/pdf");
                  }).fail(function(err) {
                     throw new Error("failed to download report");
                  });
               }
            });
         } ;
 
CSAngel's picture
Joined: Apr 29 2015 - 5:37pm
Last seen: 3 years 3 months ago

0 Answers:

No answers yet
Feedback