Sunday, August 24, 2008

Copying a Chart From One Report to Another

Sometimes you want to copy a sheet object from one QlikView report to another. You might have two reports; say one for the finance department and a separate report for the supply chain department that both load similar data from the database. If the supply chain analyst develops a really great chart for the supply chain report and the people in finance could use it then you could copy the chart from the supply chain report to the finance report. You could always just recreate the chart from scratch on the new report of course, but it is easy to copy the chart from one report to another using Windows clipboard. Here’s how it could be done using our example:
  • Open both reports

  • Make a back-up copy of the "finance report" (the one you are going to change) by doing a save-as under a different name

  • Now, go to the supply chain report that has the cool chart. You could use the Window menu to select the other report. Click on the chart so that the chart is selected (when the chart is selected the title bar at the top of the chart changes color).

  • Select Edit->Copy from the menu

  • Switch over to the report you are going to change, the "finance report" in this example. Make sure you are looking at the finance report and select the tab where you want the chart to appear

  • Select Edit->Paste from the menu and the cool chart will get pasted into the finance report. It will appear in approximately the same position on the sheet that it occupied on the original report.

  • Finish up by moving the chart to the position you want, make any required changes to chart properties (like data field names or title, etc.) and save the changed report

You can use this method to past a sheet object into several different reports or paste the same sheet object into multiple tabs on the same report. I use this method all the time when developing a new report with multiple tabs.

Another method that can be used to copy a chart within a single report is to click on the chart, select Properties, and then select Clone. A copy of the chart will appear just slightly offset from the original one. You can use your mouse to drag the cloned chart either to a new position on the same tab or drag it to one of the other tabs at the top of the report and, when you see the curved arrow appear, release the mouse button and the chart will now be on the other tab.

3 comments:

paulyeo11 said...

Hi Tim , Thank you for your effort for contributed so many nice code in your blog , i enjoy reading them.

By the way i try to copy the deskboard from QV sample program " finacnial control " , i am not able to copy the all the information to my doc , for example the legend for the chart , i try many diff methode it does not work.

in case you have a the solution , pls share with me.

pau yeo

-TB said...

Hi Pau Yeo,
If I'm looking at the right example, the legend information you are talking about is actually several text objects. If you right-click right on top of the legend text you are talking about and then select Properties you can see that these are small text objects that have a background color that matches the tab background color. It's a nice way to add extra information to help people understand a chart. You can copy these text objects too but you'll have to copy each of them separately using the copy-and-paste method.

I hope that helps. Good luck.

-Tim

Unknown said...

Hello Tim,

I'm creating (or trying to create) a macro that has to do the following:
1. execute a stored procedure which returns a list of qvw file names and their location.
2. open a qvw file (one at a time) - each qvw file has only one sheet.
3. select (activate) all objects contained in the sheet and copy them.
4. create a new qvw file.
5. create (add) a new sheet (for each qvw file open in the step 1) and paste the copied objects.
6. repeat step 2, but I will paste the copied objects in the same new qvw file, but in different sheets.

Basically, I'm stuck in step 3, 'cause I dont´t know how to copy and then paste the objects in a qvw file.
I hope you can help with this.
Thanks in advance.

Steve