Questions asked by nvhuonghttps://answers.axonivy.com/questions/asked-by/145/nvhuong/?type=rssQuestions asked by <a href="/users/145/nvhuong" >nvhuong</a>enSat, 22 Oct 2016 11:06:36 -0400Ivy.wf().documents() - How to update an existing document with new content?https://answers.axonivy.com/questions/2128/ivy-wf-documents-how-to-update-an-existing-document-with-new-content<p>I got an error when trying to update the content for an existing document that's managed by <code>Ivy.wf().documents()</code>. This api doesn't have the method <code>update</code> so I just tried with following code:</p> <p><code>ivy.wf.documents().add("newfolder\\hello.pdf").write().withContentFrom(new File("sourcefolder\\file2.pdf", false));</code></p> <p>The message looks like: </p> <p><code>IOException: File newfolder\hello.pdf already exists PersistencyException: Cannot create file 'D:\work\AxonIvyDesigner6.3.0\files\application\newfolder\hello.pdf' for document 'newfolder\hello.pdf'</code></p> <p>Yeah! it's correct! But, I want to update this existing file with new content.</p> <p>I already tried to use method <code>delete</code> first:</p> <p><code>ivy.wf.documents().delete(new ch.ivyteam.ivy.workflow.document.Path("newfolder\\hello.pdf"));</code></p> <p>Or, trying to delete the physical file; but it did not work.</p> <p>Thanks for your checking!</p>nvhuongSat, 22 Oct 2016 11:06:36 -0400https://answers.axonivy.com/questions/2128/ivy-wf-documents-how-to-update-an-existing-document-with-new-contentdocumentivyHow to ignore the file path in birt.properties even when "designRepository" is defined?https://answers.axonivy.com/questions/1094/how-to-ignore-the-file-path-in-birt-properties-even-when-designrepository-is-defined<p>In my module, I use element "Create report with database" on Axon.ivy 5.1. I don't use "designRepository" in birt.properties so that I can define my own absolutely path. Like this:</p> <ol> <li> <p>Disable the configuration in birt.properties: </p> <p>"#designRepository=C:/MyReportRepo/"</p> </li> <li> <p>declare the path to report design files (.rptdesign) in my code: </p> <p>in.templateFilename = "E:/_vision/CONFIG/myReportDesign"</p> </li> </ol> <p>I am facing a problem when I've tried to integrate my module with another one which needs to define "designRepository" in birt.properties. It means that the another module needs to activate the configuration, like this:</p> <pre><code>designRepository=C:/MyReportRepo/ </code></pre> <p>In this case, I got an exception:</p> <pre><code>EngineException: The design file C:/MyReportRepo//E:/_vision/CONFIG/myReportDesign.rptdesign can not be found. </code></pre> <p>Until now, I've tried to find the way to get and modify the defined path. I mean I would try to ignore this "C:/MyReportRepo//" when it is activated, so that hope both mentioned modules can work. </p> <p>I also try using element "Create dynamic report" instead but the demo doesn't work. I referenced this link: <a href="https://guidelines.soreco.ch/projects/guides/wiki/BIRT">https://guidelines.soreco.ch/projects/guides/wiki/BIRT</a> </p> <p>Any help will be greatly appreciated!</p>nvhuongWed, 17 Dec 2014 11:37:19 -0500https://answers.axonivy.com/questions/1094/how-to-ignore-the-file-path-in-birt-properties-even-when-designrepository-is-definedbirt