Skip to main content
Hi,

I need to create a specific report in a web app.

My report will show the following :

- Completed processes in a date range with a display of some of their values
- Active processes in a date range with display of some of their values

What API or web service, and also which method do I have to use to achieve that...

Thx...

PS: The KB web site is broken and I can't access reporting article so... maybe the answer is in it... but I don't know...
Hi Tanguy,

Please have a look at the following KB article:
http://kb.k2workflow.com/Articles/KB000021.aspx

What do you see on the KB site? Try to delete your old Cookies, Temporary Internet Files and Offline content. Try to access the KB site again.

Regards,
Ockert
It was cookies...

It works now... I will read this article and post again if I miss something..;
I can't get any data using the sample code...

What kind of data do I have to fill in the RptService.CreateSession method?

In the sample there was a user name (ie suzans) but the parameter is called serverName...

do I have to put only K2 server name or K2 server name plus port or anything else?
ok, I tried to put my username directly to make the sample work but know I get an exception


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Invalid column name 'UserName'. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at WorkSpaceService.FilterService.GetData(Int32 ReportID, Int32 TemplID, String UserName) --- End of inner exception stack trace --- 


Any Idea?
wwooowww....

I really tried to make something useful but in fact, I can't develop anything...

Why ?

I don't know if I'm alone but some webservices seem bugged (like filterservice.GetData method or filterservice.Find method).

So I really don't know how to do my report...

What I need to do:

Following Process Name, I want to display a table with each process instance and their status, some of their data fields and also the status of each activity.

It could look like this:

Process Folio ---- Start Date ---- Status ---- Delayed ---- Act1 ---- Act2 ---- Act3
custom folio ---- 01/02/2006 ---- completed ---- false ---- completed ---- active --- not initialized


If you know how to do it, please help me, it's really urgent for me
Are you still struggling with this or did you come right?

Regards,
Ockert
Well, following Coenraad advice, I created my own stored procedure to get data I need and I was able to produce a good report page (see attached image)
Hi TanguyALSY,
We are struggling to do the same, can you give more details of your solution?

-Madhu
Hi guys

I hope the following code will help. What is does is it returns a dataset for all process instances of a specific process... Then it uses that information to return the process data for each process instance in the dataset. This information is also returned by a dataset. OK, this is not a clear-cut working solution for all your questions, but I think it will give you an idea of what to do. Use the windows app in the KB article mentioned before for more clarity.

What you must do to get it working is the following:
Add the following app settings in your web.config file:
<appSettings>
<add key="K2Server" value="MyServer"/>
<add key="ProcessName" value="MyProcess"/>
<add key="ProcessFolder" value="MyFolder"/>
</appSettings>

Just change the above to the correct values, please. (If you don''t know, use the "Process OverView" report of the Windows app as mentioned before to get the correct data.

Then add a web reference to the K2.net reporting service (http://localhost/K2V3/WorkspaceService/FilterService.asmx would be default on the local machine) and call it K2FilterService.

Last - call the ReturnReportCompleteItems procedure... And look at the datasets returned.

I don't think this is the fastest solution, but it's (as far as I know) the only way to get to completed process instances without looking directly at the DB. I would suggest using this method rather than looking at the database.

Let me know if this helps.
Louis
Oops - it would help if the file was included... :oops:
Dear TanguyALSY,
Your solution is excellent.That's great!
Could you tell us your solution codes?
It's very helpful to us.Thank you!

I know that is pretty weird question but how can I get an attached file from one of my previous post in this thread?


This is a question for K2 people of course


Reply