Start a new topic
Answered

Exporting reports, graphs and grids through API

Is there a way to export a certain report on a certain item using the API? Let's say in pdf format?


This is useful for many usecases. Including saving our safety documentation and release manage it with the corresponding code, or exporting reports to Confluence.




Best Answer


Hi Ali,


There is no support for exporting Reports, Grids, Graphs, Charts or XML:s defined in the script language using the SystemWeaverClientAPI.


The subject has been raised before but there is no plan to implement such functionality in the near future.


Best regards,

Fredrik




Answer


Hi Ali,


There is no support for exporting Reports, Grids, Graphs, Charts or XML:s defined in the script language using the SystemWeaverClientAPI.


The subject has been raised before but there is no plan to implement such functionality in the near future.


Best regards,

Fredrik



how can we go about a situation like that then?


e.g. I have a Generic Requirements Container and I would like to list all Requirements contained in it (in the explorer we can use REQ GRID). 

However, the requirments container might contain several requirements containers containing requirements (so this probably needs to be done recursively).


And another thing: I would like to list the HandleStrings of all the versions of a given item. how can i do that?


BR,

Benedikt

Hi Benedikt,


I apologize but I am having trouble understanding your question(s). Can you please clarify? 


About listing all HandleStrings of an Item, can you please describe what you are trying to achieve? There are ways to list HandleStrings for all versions but from my experience there may be a better solution to the problem as a whole.


Best regards,

Fredrik

Hi Fredrik,


thanks for your answer. Are QUERIES what you had in mind when you said there might be a better solution? because that's what I found to be maybe more applicable when i browsed through the forum.


So this is what i want to do in a more general way:

There is a requirments container (SID: 2SE8) with a certain SystemWeaver ID containing all our requirements (SID: 2CSR or 2SE34) (grouped in sub-containers)

I would like to get all the "System Weaver IDs" of those requirements as a list.

Also, I would like to get a list of all System Weaver IDs of all the versions of those requirements.


I dont want to do any operation on the items, so just the SystemWeaver ID lists are enough.


thanks in advance,

Ben


PS if there's a way to communicate with you more directly to solve this problem I'm all ears. A Skype session or something would be perfect.

Here is a small example that hopefully will get you going. Notice that there is no checks for duplicates or any exception handling.

private List<IswItem> Foo(IswBroker broker)
        {
            List<IswItem> result = new List<IswItem>();
            foreach(IswItem container in broker.Q.GetItemsOfType_2("CONTSID", true, false))
            {
                List<IswItem> tempResult = new List<IswItem>();
                FindItemsRecursive(container, ref tempResult);
                result.AddRange(tempResult);
            }
            return result;
        }
        private void FindItemsRecursive(IswItem current, ref List<IswItem> result)
        {
            if (current.IsSID("REQSID"))
                result.Add(current);

            string[] partSidsToFollow = { "ASID", "ANOTHER" };
            foreach (string partSid in partSidsToFollow)
            {
                foreach(IswItem item in current.GetPartItems(partSid))
                {
                   FindItemsRecursive(item, ref result);
                }
            }
        }

 


Login to post a comment