However, you can use the TESTIMPORTCONTENT web service call to do a "test-run" of the import first, which returns any problems in the "ImportIssues" object in the result.

Don't forget, when using both the IMPORTCONTENT and TESTIMPORTCONTENT web service calls, you may need to set values in the "ImportOptions" object in the request to set up the right options for the import.

Please let us know the results of your TESTIMPORTCONTENT call, also, if there is nothing helpful in the results from that web service call then we'll have to see your code and server logs to trouble-shoot this issue any further.

regards,
Dave

Hi Team,

We have just exported a Yellowfin report through Yellowfin application and trying to import with the webservice method. But we are getting some error message.

We did not modified anything in the exported xml file. When trying with the 'TESTIMPORTCONTENT' webservice method, we came to know the error message as below:
ImportIssues[0] --> ImportIssuesElement[1]:
messageKey: error.reports.import.category?
renderedMessage: Category has not been selected.

We also tried with the ws_admin_import.jsp file which is got from Yellowfin forum and facing the same issue when importing.

We like to know,
1) What this error message is indicating?
2) How can we resolve the issue if we got any error while importing based on importIssues array values?

Attached the report xml file what we tried. Please help us on this issue.

Note: This report is created based on embeddedView report design.

Regards,
Chan.N.

Hi Chandra,

From the error you're getting, looks like you're not specifying the report category to import into.

The easiest way to confirm this is to perform an import from the UI, any parameters that you must choose (e.g. data source, category etc..) must be set in the import call.

You can always export the category and sub-category along with the report, so you won't be forced to choose one when importing.

The alternative is to add the following import options;

[code]
AddOption(options, idx, "CATEGORY", "MYCATEGORY"); // tell Yellowfin to use the category with code "MYCATEGORY" for this report

AddOption(options, idx, "SUBCATEGORY", "MYSUBCATEGORY"); // tell Yellowfin to use the sub category with code "MYSUBCATEGORY" for this report

[/code]

Hope this helps and please let us know how it all goes.

Regards,
David

Hi David,

Thank you for your support.

Yes, as you said, we tried with Yellowfin UI to import the same report and its asking us to selected the Datasource and the category details.

Through webservice(using ws_admin_import.jsp) methods, when trying to import the report, we are getting the below issues:

Issues:

ReportName: EmbeddedViewReport
0) Data Source has not been selected.
1) Category has not been selected.

I like to notify one thing here. Here the report is designed based on EmbeddedView functionality. Hence when exporting this report from Yellowfin UI, there is no option to export datasource and category. The xml file will come with Datasource ID and Category ID's.

Please validate this from your end also.

We are facing problem with EmbeddedView report only. A report which is created based on a separate view is imported successfully.

Regards,
Chandrakumar.N.

Additional to the above information:

It is regarding setting ImportOPtions for a category.

We are accessing Yellowfin webservices through JAVA code only. The ImportOption object is having set methods like below:

But in your suggestion, you have mentioned 'options' as first parameter.
What it is and how to set this through jave method?

We have tried with the above ImportOPtion object settings and still we are facing the same problem. Also as mentioned in the webservice reference document(Appendix: ImportOption Codes) tried as below but its also not working.

Because of this auto-import issue, we are not able to migrate most of our reports. This is a most critical issue for us. Please help us on this.

Note: The EmbeddedView report xml is having 'CategoryId' and 'SourceId' as a separate tag. But while importing its not considering that.

Regards,
Chandrakumar.N.

Hi Chandrakumar,

Sorry I'm a little confused as to what an embedded view is?
Are you able to clarify this.

I guess this lies at the heart of your issue, so understanding this should identify why it's not working.

Thanks,
David

Hi David,

Yes. This is the main requirement for us and it will give more usability us.

Let come to the point.

Here embedded view means, a report is not created based on an existing view. User will give SQL query and Yellowfcan create report automatically.

You can create this kind of report by following below steps.

1) Log in into Yellowfin and click Create button.
2) Choose Report option.
3) From 'Create Using' dropdown choose 'FreeHand SQL' option.
4) Select any data source.
5) In the new page, give any valid SQL query and Save it.
6) Now go to 'Data' option and there table report will create automatically.
7) Now you can save this report.

This is the EmbeddedView report. (ie: View is not created separately.)
Hope it gives the better understanding to you.

Export the same report and try to import using yellowfin webservice method and let us know the result. We are facing problem here only.

Note: After this, read my above post and understand the issues.

Regards,
Chandrakumar.N.

Hi Chandra,

Thank you very much for the extra info, it has cleared things up.
Different terminology ;).

Ok I think the problem here is the the requirements for a Freehand SQL Report.
During the UI import, you manually choose these.

A Freehand SQL Report asks for Source, Category, Subcategory.

A good was to see what is required for an import is to view the HTML source on the import page (MIPreAdminImportValidate.i4). You will then see the options that are required for importing any content item, including Freehand SQL Reports.

You can see the SOURCE section in the HTML: The [code]0|SOURCE[/code] refers to webservice import options:
[code]
importoption.setItemIndex(0);
importoption.setOptionKey("SOURCE");
[/code]

You can see the values for the source in the dropdown list... [code]SOURCE[/code]
e.g.
[code]
importoption.setOptionValue("SOURCE54376")
[/code]
This will attach it to the give source.

For Category, see
[code]
0|CATEGORY in HTML:
[/code]

e.g
[code]
importoption.setItemIndex(0);
importoption.setOptionKey("CATEGORY");
importoption.setOptionValue("CATTUTORIAL");
[/code]
(CATTUTORIAL is in the source, all available categories would be visible here)

Thank you so much. The proposed solution resolved the issue on import.

Please clarify the below things for our further implementation:

1) To import the DataSource, we need DataSource ID. For this we have to export the particular DataSource as xml file using Yellowfin --> export functionality. Then only we can find its id. Is there any other way to know this?

Requirement:It will be good, if we have a webservice method to display the data source list to the user. So user can select their required datasource from the dropdown and can import using our application.

Same requirement is need for Category and Subcategory also.

Please let me know is already webservice method are available for these requirement. Provide your suggestion also to get the DataSource Id and category selection for end user.

2) We are setting some index value in importOpiton object. Whether this value will be always 0 or it will vary?
importoption.setItemIndex(0);

Regards,
Chandrakumar.N.

Hi David,

Is there any update on this?

Regards,
Chandrakumar.N.

Hi Chandra,

Sorry for the delays.

1)
You can actually use the Webservice GETCONTENT which will list all content, included data sources and report categories, with their respective ID.
However, you will then need to pull out the data from this result set, as the GETCONTENT will always just list all content

2)
The Index will always be 0 for the 1st item in the list.
E.g.
If you have a data source, view, report in your list.
Datasource will be 0, view will be 1, and report will be 2 .

Hope this clears up any confusion.

Thanks,
David

Hi David,

The proposed approach is fine when the xml is directly exported from Yellowfin application.

But in our case, we are generating Yellowfin report xml by custom functions. At that time we are setting some duplicate DataSource ID which is not the right one. So from this xml file, we can't get the correct DataSource ID using 'GETCONTENT' webservice method.

Hence it will be good, if we have a webservice method to retrieve the metadata for all available datasoruces from Yellowfin.

Please provide your thought on this.

Note: The reason for generating xml by custom is, we are having more than 1000 SQL queries and we need to create report for all of those. For this we are following this approach. Now we are trying to import all of this xml using Yellowfin 'IMPORTCONTENT' method which will automate import also.

Hi David,

I am facing another issue here.

I am able to import the report sucessfully when I have DataSource and Category in import options object.
Example:
importoption.setOptionKey("CATEGORY");
importoption.setOptionValue("CATTUTORIAL");

I have added my own category in Yellowfin and when I am using that for import functionality, the 'TESTIMPORTCONTENT' does not reported any issue. The 'IMPORTCONTENT' method is get failed and I got the error code as '-2'. Please validate this from your end and let me know the result.

I am used Category and Subcategory as 'HELLO'.

Please provide your suggestions as soon as possible.

Regards,
Chandrakumar.N.

Hi Chandrakumar,

I've been trying to reproduce this issue over here but so far have not been successful in doing so. Could you please email us your code so we can examine it and hopefully find out what is going wrong (please quote the subject of this forum post).