Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Opening another qvw-file with specific sheet

Hello everyone,

I am working on this issue since two days so far and maybe someone out of the community shared the same issue so far.

The problem so far:

The goal was to integrate one application (B)  into another (A). But due to performance issues we suggested to some kind of fake integration by outsource one application (B) and open it by clicking on a sheet of application A. Application B shares the same sheet order than Application A and gives therefore the user the feeling to be within the same application but technically he is working with two, which gives us a great performance boost and the freedom of not having all dimensions in the current selection boss.

The solution so far:

Since QlikView unfortunately does not support the Sheet Action "Open QlikView Document" I had to use some kind of trick, by pressing via macro a button when entering the sheet, that performs the Action "Open QlikView Document", which works great on Client&Server.

But it will always open on the last saved sheet/one specific sheet, which is fine if we come from application A to B, but the way back it should actually open the sheet I am clicking on. Application A has 7 sheets and if i click on "Country", it should open this sheet and not only one fixed sheet.

tl;dr

I am looking for a solution to open another .qvw-file with a specific sheet.

Thanks so far,

David

Tags (1)
9 Replies
Not applicable

Re: Opening another qvw-file with specific sheet

Hi David,

Can you please elaborate your requirement... I would have use the binary statement for the purpose of integrating one qvw into another..

Or if you want open a diiferent qvw then we can rather make use of button and on it's click event we can open another qv application.. Hope this gives you an idea

Regards

Gaurav

Not applicable

Re: Opening another qvw-file with specific sheet

Hi Gaurav,

thanks for your input.

The requirement is to have two applications with the same sheet structure. Application A has 8 sheets, but on of this sheet (e.g. "Special") should be outsourced into another application due to its complexity and data input. Application B has therefore one one real sheet, but the other 7 sheets will be displayed to ensure consistency. If the users clicks in Application A on Sheet "Special", Application B should be opened and this sheet be activated. If I click however in Application B on any of the other sheets, Application A should be opened again and it should jump to the selected sheet.

I was able to find a solution by myself.

Beside the "Click a button"-Macro to evade the Sheet Actions Issue I am using the Transfer State functionality.

I created an Inline Load with all possible sheets in both applications. If the user clicks on a specific sheet from Application B, he will also select the SheetID of this specific sheet. After that Application A will be opened, the Sheet ID passed and a macro started which will Activate the selected SheetID.

Usally it would be easier to just use an OnOpenDocument-Trigger to jump to the correct sheet, but unfortunately the passing of the selection state happens after this action and the correct sheet wont be activated. A macro however happens to be after the passing of the selection states.

Sorry if this problem sounds more complicated than it actually is, but QlikView gave me no choice.

Not applicable

Re: Opening another qvw-file with specific sheet

I'm building a similar solution and this looked like a feasible solution. Did you need to run the macro in system access mode to get it working properly? Did you have the macro in the source or the target document?

Best regards,

Henry Backman

Not applicable

Re: Opening another qvw-file with specific sheet

Hi Henry,

Safe Mode is enough for this kind of macro. In fact I had to use the "Press" macro in both applications, since this way should work two-way.

But the Main Application uses additionally the following macro.

sub Jump

On Error Resume Next

Sheet = ActiveDocument.Fields("Sheet").GetSelectedValues.Item(0).text

ActiveDocument.GetSheetByID(Sheet).Activate

ActiveDocument.Fields ("Sheet").Select ""

err.clear

end sub

So far the solution works as expected and the users does not see much of a difference.

Kind regards,

David

Not applicable

Re: Opening another qvw-file with specific sheet

Thanks David!

Hmm, yes, I think I mostly understand how your solution works. I had slightly different plan where I would have a sort of menu document where the user could click one of the buttons and then correct document and sheet would open. So I wouldn't have the same set of sheets in every document.

How do you start the macro on the target document? You are using the ActiveDocument in the macro, so I guess that macro is run on the target document after the document change has finished, or how does it work? Even if I put the execute macro action after the document change, it still runs it so that the ActiveDocument references to the source document, not the target one. The reason why I was asking about the macro security was that I thought I had to use GetObject() to be able to manipulate the target document.

Not applicable

Re: Opening another qvw-file with specific sheet

The Jump macro is used in target Document and will be executed by an OpenDocument trigger. This happens after the document has been opened and the state been transfered.

Not applicable

Re: Opening another qvw-file with specific sheet

If I remember correctly, the OpenDocument trigger does not fire in AJAX environment, so that's a problem for us. Oh well, have to think of a different solution, it seems that there's no nice way to achieve this kind of main menu document.

Not applicable

Re: Opening another qvw-file with specific sheet

On AJAX you should be able to transfer some variables/sheet selection within the url:

http://community.qlik.com/thread/53743

My solution was based on the fact that this is not possible via ie plugin.

Not applicable

Re: Opening another qvw-file with specific sheet

Yes, that was what I first investigated but I couldn't figure out how to transfer the complete selection state to another document. You can pass selections in the URL but they need to be in visible listboxes in the target document, so that doesn't really help.