Skip to main content

Hello,

We are building a report which works when it is started as a ‘Start Table Report’, but not when used with a ‘Generate Report’ task. 

We want to store the document we generate in our database, along with the record that it should be attached to. For that reason we need to be able to access the file_data, file_name, and file_path in the process/system flow. 

We are generating the report, and then using the ‘Write_file’ action to store the generated report in our file system. From here I want to use the ‘Add row’ action to add the document to our database.

Generating the report works, but when I go to open the PDF I get the following error:
 

 

It is saying that the colorspace is not valid in the PDF. 

We are using the windows gui to generate the report. We have used DevExpress to build the report.

Any idea how to fix this?

Hi Niels,

Can you try a browser such as Chrome or another PDF viewer to see if that fixes it?


Hi Niels,

Can you try a browser such as Chrome or another PDF viewer to see if that fixes it?

Tried it with Chrome and Firefox. Both display a blank document. 


Can you share the Process flow design? And you say you use it with the Windows GUI, is that correct?


Can you share the Process flow design? And you say you use it with the Windows GUI, is that correct?

 

Yes, we are indeed using the windows gui for this. We have set it up as a system flow. 


As system flow, this should do the job just fine. As long as the input parameters for the Generate report actions are set up correctly and the output File data is pass to the Write file action, I don’t see why it wouldn't work.

Does the Indicium log say anything? Maybe the Write file did not succeed. Lastly, which encoding are you using? With ANSI Latin1, I think it should work just fine. If you change anything after reading this reply, you may need to resync to IAM to place the changes of the model in IAM so the system flow uses these values.


As system flow, this should do the job just fine. As long as the input parameters for the Generate report actions are set up correctly and the output File data is pass to the Write file action, I don’t see why it wouldn't work.

Does the Indicium log say anything? Maybe the Write file did not succeed. Lastly, which encoding are you using? With ANSI Latin1, I think it should work just fine. If you change anything after reading this reply, you may need to resync to IAM to place the changes of the model in IAM so the system flow uses these values.

I am indeed using ANSI Latin1 for encoding. 

Input for the write_file action is as follows:

output of the generate report action is as follows:

 

All seems correct to me too. 


Looks pretty good, however with New file it may not have created a new file if the file is already there. Maybe Overwrite file is a better choice.

The file_data variable uses varbinary(max) I suppose? If that's also the case, we probably need to take a closer look at it. Can you create a ticket for it and attach a model.dat of the branch? Thanks!


Looks pretty good, however with New file it may not have created a new file if the file is already there. Maybe Overwrite file is a better choice.

The file_data variable uses varbinary(max) I suppose? If that's also the case, we probably need to take a closer look at it. Can you create a ticket for it and attach a model.dat of the branch? Thanks!

Hi, setting the file_data as varbinary(max) and converting it in my decision is what made it work. Thank you for your help!


Hello Mark, do you know how to add a row in a system flow? I tried to use the add_row action but that doesn't allow me to run the process flow as a system flow. 


Hi Niels,

That is correct, the Add row process action is a User action and cannot be used in a System flow.

To add a row, you can opt to use a Decision where you can use SQL code to insert a record into a table. The Decision requires a control procedure with code group Processes, and it being assigned to the correct process action.

Hope this helps!


Hi Niels,

That is correct, the Add row process action is a User action and cannot be used in a System flow.

To add a row, you can opt to use a Decision where you can use SQL code to insert a record into a table. The Decision requires a control procedure with code group Processes, and it being assigned to the correct process action.

Hope this helps!

Hi Mark, thank you for the assistance. I have done this, and am using a decision to add a row to my document table. This is done by storing the file_path (as a varbinary_max) in a process variable, and using that as input in my decision which inserts a row into the aforementioned table. The file path is, however, converted to a long string of Chinese characters. 

When I set the file_path variable as something different then a varbinary_max value, it doesn't generate the report at all. 

Do you have an idea of what is going on?


Hi Niels,

I'm unsure what you want to do with the file_path in the table. I guess you want to store the file data in a particular field so you could preview it in your application?

That would require two fields, one for the File name (varchar), one for the File data (varbinary). File name needs to use a domain with control FILE_UPLOAD and a storage location set to type Database. File data will then need to be the storage column for the File name.

In File name, you can write reportname]..extension] and in the File data column you place the varbinary data. That should do it.

 


Hi Niels,

I'm unsure what you want to do with the file_path in the table. I guess you want to store the file data in a particular field so you could preview it in your application?

That would require two fields, one for the File name (varchar), one for the File data (varbinary). File name needs to use a domain with control FILE_UPLOAD and a storage location set to type Database. File data will then need to be the storage column for the File name.

In File name, you can write reportname]..extension] and in the File data column you place the varbinary data. That should do it.

 

Thanks. Issue was fixed by making the table column have control file_upload, and the process variable file_path into a file_upload domain as well.