Hi,
can we do like below instead of creating reports n all.
Here I just passed my table data to writefile function.
but it showing error at writefile function like '2nd args cant be coresed to bytes, string'
any solution for this?
resultSet =system.dataset.toPyDataSet(event.source.parent.getComponent('Table').data)
if len(resultSet) > 0: # if the query returned anything...
filename = system.file.saveFile("LogBookReport1122.pdf")
data=system.dataset.toDataSet(resultSet)
if filename is not None:
system.file.writeFile(filename, data)
No. A Dataset object is not a PDF. It could be serialized into a bytestream and saved, but that would not be readable by anything else.
The only tool in Ignition to make PDF files is the report engine. There are numerous external tools that can make PDFs, some are even free, but all would require communications between Ignition and that external tool.
I use LibreOffice instead of MS Office. Among its other benefits (like being free), it has a command-line option to convert a document to PDF. I use it with LibreOffice Writer to automate updates to my user manuals in a few of my add-on modules. The command line looks like this:
lowriter --convert-to-pdf SomeDocument.odt
Which yields SomeDocument.pdf. Rather handy. I bet it works with LibreOffice Calc, too. I'm not sure what is possible via command line with MS Office.
But if there is, you can call such a command from Ignition with system.util.execute or use Java's ProcessBuilder tool.
FWIW, LibreOffice is pretty good at working directly with MS Office files, so might be able to handle this task for you.
Hi, Ignition Reporting tool is worked for me, not sure what was the exact issue but I just created one new report and tried with that and it worked.
Thank you so much.
I have one doubt regarding named query,
I want to write like statement in where condition,
If I passes hardcoded value it is working, like below
where F_NUMBER like '%OTS-MAT-0040-F01%' ## It is giving proper result
If I used parameter like this, It is not giving output, whats wrong here?
where F_NUMBER like '%'+:num+'%' # Not working
MSSQL database, or you can suggest me how to write it is report SQL Query.
anything will be ok for me.
finally I want to use that query for report only
In report as well If I pass hardcode value then it is working, If I pass ? (as parameter)
it's not working.
Hmmmm. What does F_NUMBER look like in the database? IE can you give an example of what kind of data is stored in there? And then what is something that you are using for :num to try and filter on?
If you test the named query and put in a value that you know exists in the column does it work? If you hardcode a value rather than using the num parameter does it work?