Пример #1
0
        public async Task <HttpResponseMessage> ToPlainExcel(QueryRequestTS request, CancellationToken token)
        {
            var queryRequest = request.ToQueryRequest();

            ResultTable queryResult = await DynamicQueryManager.Current.ExecuteQueryAsync(queryRequest, token);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

            var fileName = request.queryKey + TimeZoneManager.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

            return(FilesController.GetHttpReponseMessage(new MemoryStream(binaryFile), fileName));
        }
Пример #2
0
        public async Task <FileStreamResult> ToPlainExcel([Required, FromBody] QueryRequestTS request, CancellationToken token)
        {
            var queryRequest = request.ToQueryRequest();

            ResultTable queryResult = await QueryLogic.Queries.ExecuteQueryAsync(queryRequest, token);

            byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

            var fileName = request.queryKey + TimeZoneManager.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

            return(FilesController.GetFileStreamResult(new MemoryStream(binaryFile), fileName));
        }
Пример #3
0
    public async Task <FileStreamResult> ToPlainExcel([Required, FromBody] QueryRequestTS request, CancellationToken token)
    {
        ExcelPermission.PlainExcel.AssertAuthorized();

        var queryRequest = request.ToQueryRequest(SignumServer.JsonSerializerOptions);

        ResultTable queryResult = await QueryLogic.Queries.ExecuteQueryAsync(queryRequest, token);

        byte[] binaryFile = PlainExcelGenerator.WritePlainExcel(queryResult, QueryUtils.GetNiceName(queryRequest.QueryName));

        var fileName = request.queryKey + Clock.Now.ToString("yyyyMMdd-HHmmss") + ".xlsx";

        return(FilesController.GetFileStreamResult(new MemoryStream(binaryFile), fileName));
    }
Пример #4
0
    public async Task <ResultTable> ExecuteQuery([Required, FromBody] QueryRequestTS request, CancellationToken token)
    {
        var result = await QueryLogic.Queries.ExecuteQueryAsync(request.ToQueryRequest(SignumServer.JsonSerializerOptions), token);

        return(result);
    }