Unable to convert XLS file to DRL file - drools

We are trying to convert XLS file to DRL file using Drool.net in C#. It is throwing error java.lang.RuntimeException: 'Script template is null - check for missing script definition.'. I am using basic sample template, but this error is kept on coming.
Sample rules table
Sample code
Please help us to resolve this issue.
Sample tried code
We are expecting this code to return text in DRL format.

Related

Read excel file in a directory using pyspark

`Hi ,
I am trying to read excel file in a directory using pyspark but i am getting fielnotfound error
`env_path='dbfs:/mnt'
raw='dev/raw/work1'
path=env_path+raw
file_path=path+'/'
objects = dbutils.fs.ls(file_path)
for file_name in objects:
`if file_name.isFile():
sample_df=spark.read.format("com.crealytics.spark.excel").option("header", "false").load(objects+file_name) `
I am trying this code to read my excel file but getting file not found error .can someone help me with this?`
I think in load you are not passing the proper path. So you are getting the error file not found error.
Try this you will get the output.
objects = dbutils.fs.ls(path)
for file_name in objects:
if file_name.isFile():
if file_name[0].endswith("xlsx"): #optional
sample_df=spark.read.format("com.crealytics.spark.excel").option("header", "true").load(file_name[0])

Form-fill XFA PDF with PDFBox

I'm trying to fill an XFA form using the example file using PdfBox 2 or 3 from:
https://issues.apache.org/jira/secure/attachment/12964530/XFAFormFiller.java
I'm not so used to PDFBox so not sure how to correct it.
I get compile errors. Basically how can I make it compile with latest PDFBox? Are my corrections below correct?
Line 107 I tried to fix with
Set<COSDictionary> objectsToWrite = new HashSet<>();
Line 121 I tried to fix with
COSWriter writer = new COSWriter(fos, new RandomAccessReadBuffer(baos.toByteArray()), objectsToWrite);
Line 128 I tried to fix with:
objectsToWrite.add(dataSetsStream);
What format should the XML input file be? Can someone give an example?
I get a corrupt PDF out with my corrections and feeding it the XML generated from dataSetsStream.
The file I feed:
<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
><xfa:data
><mycompany
>
.....
><mycompany
></dd:dataDescription
></xfa:datasets
>
Any help is appreciated.

SpreadsheetGear - Save Specific Workbook Sheet to CSV

I am opening an existing Excel file using SpreadsheetGear, using the following code:
SpreadsheetGear.IWorkbook xlBook = SpreadsheetGear.Factory.GetWorkbook(fileName, System.Globalization.CultureInfo.CurrentCulture);
xlBook.SaveAs(fileNameCSV, SpreadsheetGear.FileFormat.CSV);
This works, but the saved CSV file contains the wrong sheet.
Can anyone help with a code snippet on how to open an Excel file in SpreadsheetGear, then save only a SPECIFIC sheet to a CSV file.
Please note I am working with SpreadsheetGear and want a solution for that library. Thanks!
The IWorksheet interface includes a SaveAs(...) method for just this purpose:
using SpreadsheetGear;
using System.Globalization;
...
IWorkbook xlBook = Factory.GetWorkbook(fileName, CultureInfo.CurrentCulture);
xlBook.Worksheets["My Sheet"].SaveAs(fileNameCSV, FileFormat.CSV);
I'll also mention that there is also an IRange.SaveAs(...) method if you want to save just a particular range to CSV / UnicodeText (tab-delimited).

An error in executing a .gap file in GAP software

I am trying to load two .gap files but I receive the following error message. What could be the reason?
Thanks a lot in advance.
Error in executing .gap files
I have already read F1.gap file. I don't understand why it says F1 must be readable to load the F2.gap file.
Please help me to solve this problem.

Parsing USS XML file in Cobol?

I am using the Cobol XML Parser to parse an xml document that originated from the HFS (USS) file system through batch JCL.
My problem is that the XML Parser is returning "XML DOCUMENT ERROR 0000000317" which seems to be an encoding issue.
Does anyone know how to get past this?
Thanks
You will need to ensure that the encoding tag on the XML declaration is valid and agrees with what the actual document is. You will also need to make sure that the LPAR you are running on has the proper code page conversions defined in Unicode Conversion Services for z/OS.