Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Partner
Partner

How to import document layout

Hi,

How can I import a document layout?

I'm using QV 11 SR1.

I opened a qvw and use menu file -> Export -> Export Document layout

- > QV created hundreds of xml files, one for each object and a few more.

Then, I created another qvw and tried to import that layout using menu file -> Import Diocument layout

There, even if I point at the right folder, QV doesn't recognize the files.

If I make it list all the files ( *.*) and choose any .xml, nothing happens

Any clues?

Any help will be appreciated.

Best Regards,

Erich

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: How to import document layout

Not a bug, but a matter of confusing menu options between versions.

QV9 introduced the Export Document Layout option to export the layout to a single xml file. This function of this menu option was changed in QV10 -- more on that later.

The Import Document Layout menu option in QV9/10/11 inputs a single xml file created by the QV9 Export Document Layout menu. This QV9 style file can also be created in QV10/11 with the macro API call:

ActiveDocument.ExportLayoutFile("myfile.xml")

So if QV11, that is the only way you can create an xml file that can be imported by the Import Document Layout menu option.

In QV10/11, the Export Document Layout menu option was changed to create a set of xml files. These are the same files as created by the documentname-prj folder automatic method. So when you use the Export option in those QV10/11, the parameter is a directory name and the output is a set of xml files, one for each sheet object and document properties etc. There is no menu option in QV10/11 to import those exported files.

In QV10/11, you use the -prj method to import a set of xml document files. For example:

1. Use Export Document Layout to export to a directoty named "myapp-prj"

2. Copy a qvw -- any qvw to the directory above the "myapp-prj" directory.

3. Rename the copied qvw "myapp.qvw". It must match the directory name minus the "-prj".

4. Open myapp.qvw and it will automatically populate from the contents of the myapp-prj directory below it.

So the Import Document Layout menu option only exists to load a QV9 style single xml file -- for backwards compatibility. There is no menu option to load the QV10/11 style multiple files. This multiple file style is only loaded automatically using the automatic "-prj" naming convention.

-Rob

View solution in original post

7 Replies
Partner
Partner

Re: How to import document layout

Anyone? Could it be a bug?

MVP & Luminary
MVP & Luminary

Re: How to import document layout

Not a bug, but a matter of confusing menu options between versions.

QV9 introduced the Export Document Layout option to export the layout to a single xml file. This function of this menu option was changed in QV10 -- more on that later.

The Import Document Layout menu option in QV9/10/11 inputs a single xml file created by the QV9 Export Document Layout menu. This QV9 style file can also be created in QV10/11 with the macro API call:

ActiveDocument.ExportLayoutFile("myfile.xml")

So if QV11, that is the only way you can create an xml file that can be imported by the Import Document Layout menu option.

In QV10/11, the Export Document Layout menu option was changed to create a set of xml files. These are the same files as created by the documentname-prj folder automatic method. So when you use the Export option in those QV10/11, the parameter is a directory name and the output is a set of xml files, one for each sheet object and document properties etc. There is no menu option in QV10/11 to import those exported files.

In QV10/11, you use the -prj method to import a set of xml document files. For example:

1. Use Export Document Layout to export to a directoty named "myapp-prj"

2. Copy a qvw -- any qvw to the directory above the "myapp-prj" directory.

3. Rename the copied qvw "myapp.qvw". It must match the directory name minus the "-prj".

4. Open myapp.qvw and it will automatically populate from the contents of the myapp-prj directory below it.

So the Import Document Layout menu option only exists to load a QV9 style single xml file -- for backwards compatibility. There is no menu option to load the QV10/11 style multiple files. This multiple file style is only loaded automatically using the automatic "-prj" naming convention.

-Rob

View solution in original post

Siva_Sankar
Honored Contributor

Re: How to import document layout

Rob,  Your suggestion helped a lot. One thing where I stuck here is, the variable values are not getting imported to the new file. Can you please help on this?  Thanks in Advance. Siva Sankar

MVP & Luminary
MVP & Luminary

Re: How to import document layout

The import process does not bring in the variable values. The import does not include "data" , and variable values are "data", so in my opinion this is correct behavior.

Others think the export/import should include variable values and this thread

http://community.qlik.com/message/235406#235406

says it's been accepted as a bug.

-Rob

Not applicable

Re: How to import document layout

Takes a little work, but it's pretty cool.  I think it's important to note that future changes to the qvw that are saved will automatically save to the -prj directory as exported layout information.  At least this is what is happening with 11.2 SR3.

Not applicable

Re: How to import document layout

Excellent trick Rob. I will immediately apply some personal projects. thanks

thomas_wang
Contributor

Re: How to import document layout

Hi Rob,

I was using Qlikview 11.20 SR5 and I just created a piece of VBScript like below.

SUB XXX

ActiveDocument.ExportLayoutFile("myfile.xml")

END SUB


Then I created a button with an action processing XXX and clicked it. However, it didn't seem work, and just show the VBScript again. I just want to know if there is a lack of anything.

Thanks!