Posted 24 January 2024, 3:37 am EST - Updated 24 January 2024, 11:43 pm EST
Hi! In the code snippet below, I’m using SaveById method to make an api call to “ar/reports/{id}/content?type=rpx” in order to save a report to AppData folder.
const designer = (window as any).GrapeCity.ActiveReports.Designer.apiOf(InstanceID);
designer.documents.saveById(documentId, props.mode).then((res: any) => {
console.log(res);
});
This uses a custom UpdateReport method which saves the report and returns the filename:
public string UpdateReport(string id, GrapeCity.ActiveReports.SectionReport report)
{
var reportHelper = new ReportHelper(_context, _jsonSerializerOptions);
switch (id)
{
case "ExternallyViewable.rpx":
reportHelper.UpdateHeader(Web.Models.Data.Enum.ReportHeaderEditMode.ExternallyViewable, report);
break;
case "RemittanceAdvice.rpx":
reportHelper.UpdateHeader(Web.Models.Data.Enum.ReportHeaderEditMode.RemittanceAdvice, report);
break;
case "Export.rpx":
return SaveReport(id, report, true);
default: throw new ArgumentOutOfRangeException("Unknown section report ID (" + id + ")");
}
return "dummy text";
}
I can see in the browser dev tools that the response is the filename of the newly created file returned by the UpdateReport method as I would expect (it can be seen in the attached Screenshot1):
However, I noticed that the response actually received in the “then” hook is different (as shown in Screenshot2).
I need to retrieve that filename in order to use it in a different API call to trigger a download. This functionality was working before, so has the method SaveById or the Active Reports APIs changed recently? How would I be able to retrieve that filename from the response?