Encontrar

问题
· 八月 29, 2024

Create PDF and transfer it via REST

Hello, I want to create PDF from HTML source. I found pandoc. I installed pandoc on IRIS container image. I created Interoperability production. I have setup REST service to receive HTML file in request body. I call pandoc command pandoc -o output.pdf input.html  from a BPL process. I copy output.pdf file stream into response body. I save the response at the source. I get a file named output.pdf but it does not load in Acrobat. I suspect I am doing something wrong with headers (accept-encoding?) or maybe do I need to base64 encode the pdf file to transfer it via REST?

7 Comments
讨论 (7)2
登录或注册以继续
文章
· 八月 29, 2024 阅读大约需 2 分钟

第十一章 创建和使用策略 - 在运行时指定策略

第十一章 创建和使用策略 - 在运行时指定策略

在运行时指定策略

对于 IRIS Web 客户端,可以指定运行时要使用的策略;这将覆盖任何策略配置类。要在运行时指定策略,请设置 Web 客户端实例的 PolicyConfiguration 属性。该值必须具有以下形式:

Configuration class name:Configuration name

其中,配置类名称是策略配置类的完整包和类名,如本主题前面所述,配置名称是该类中策略的 <configuration> 元素的 name 属性的值

抑制不支持的策略的编译错误

默认情况下,当编译配置类时,如果配置包含 IRIS 不支持的任何策略表达式, IRIS 会发出错误。要避免此类错误,请在配置类中包含以下内容:

讨论 (0)1
登录或注册以继续
公告
· 八月 29, 2024

[Video] Setting Up Your Generative AI Development Environment

Hi, Community!

Ready to create a retrieval-augmented generation (RAG) architecture for your next GenAI application? See how to get started:

Setting Up Your Generative AI Development Environment

In this interview, InterSystems Sales Engineer @Elijah Cotterrell offers insights about:

  • Considerations for choosing an IDE
  • Which Python libraries are useful in development
  • How to instantiate a basic interaction with a large language model
1 Comment
讨论 (1)1
登录或注册以继续
文章
· 八月 29, 2024 阅读大约需 1 分钟

How to programmatically read a CSV file line by line

InterSystems FAQ rubric

This can be achieved by using the CSV() procedure of the %SQL.Util.Procedures class.
Below is an example of usage code. (Assuming that the file test.csv is in c:\temp.)

 Set rowtype="Name VARCHAR(50),UID VARCHAR(50), PHONE VARCHAR(50)"
 Set filename="c:\temp\test.csv"
 Set result=##class(%SQL.Statement).%ExecDirect(,"call %SQL_Util.CSV(,?,?)",.rowtype,.filename)
 Set rset =result.%NextResult()
 
 // To display all results, use do rset.%Display()
 While rset.%Next() {
     Write "Name:",rset.%GetData(1)," UID:",rset.%GetData(2)," PHONE:",rset.%GetData(3),!
     }

 Set rset="",result=""
 Quit

By executing the above, you can access each row and field as a result set. Example execution:

USER>do ^CSV
Name    UID     PHONE
aaa     0001    080-1111-1111
bbb     0003    090-2222-2222
ccc     0009    050-3333-3333
ddd     0010    0120-17-1972
4 Rows(s) Affected

Please also see the class reference for the %SQL.Util.Procedures class.
Class reference:%SQL.Util.Procedures.CSV()

8 Comments
讨论 (8)4
登录或注册以继续
文章
· 八月 29, 2024 阅读大约需 1 分钟

Snapshot com máximo de 250 linhas

Se você encontrou o problema de que nem todas as linhas do seu resultado estão retornando no seu snapshot, você está no lugar certo.

Ao usar snapshots, existe uma informação não trivial de que eles têm um máximo de linhas que vem por padrão como 250.

Para mudar isso é muito simples. Ao invés de enviar o snapshot como referência direto no seu método de execução de query ou procedure, vamos inicializá-lo antes e definir um valor na propriedade MaxRowsToGet.

Set resultSet = ##class(%ListOfObjects).%New()
Set snapshot = ##class(EnsLib.SQL.Snapshot).%New()
Set snapshot.MaxRowsToGet = 10000
Do resultSet.Insert(snapshot)

Set status = ..Adapter.ExecuteParmArray(.rs, .out, query, "o", .parameters)


Pronto! Agora é só pegar o primeiro resultado do seu resultSet com GetAt(1) e percorrer o snapshot.

 

Gostou da dica? Qual dica mais você conhece? Deixe nos comentários!

讨论 (0)1
登录或注册以继续