export a URL field to Excel, skips the URL leaving only the text

Hi,

I have an issue, in one Dashboard using a table view, one field is defined as Hyperlink, and when exporting it the link behind the scene is dropped, the column in Excel is just a text field formatted as a link (an underscored blue text).
In the Dashboard I took the text field corresponding to the caption I want to show, set it as Hyperlink, then defined the address using another field containing the corresponding URL. Online, it works like a charm, but when exporting, be it using the Share -> Excel or a button with a script set on the click event, I don’t get a real URL in Excel but just blue text.

The script I tried is this one:

// Get the export service.
var exportService = this.getService(‘ExportService’);

// Get the view service.
var viewService = this.getService(‘ViewService’);

// Create the export request.
var exportRequest =
new dundas.export.ExportRequest(
{
isLegacyExport: false,
// Export Excel
providerId: dundas.constants.STANDARD_EXCEL_EXPORT_PROVIDER_ID,
viewId: this.parentView.id,
viewData: this.getService(“CanvasService”).canvas.viewModel.businessObject.control
});

// Get the perform export promise.
var exportPromise =
exportService.performExport(exportRequest);

// Setup a loading dialog.
viewService.showLoadingRestCall(exportPromise);

exportPromise.done(
function(exportId)
{
// Get the Url for the export file.
var exportFileUrl =
exportService.getExportResultUrl(exportId);

  	// Force the browser to download the file.  
  	window.location.replace(exportFileUrl);
}

);
// end of script

Is it me or the exportation doesn’t export the Hyperlinks as Hyperlinks but just as text??

Thanks in advance,
Olivier

Hey Olivier,

With Version 8, we introduced functionality to export Hyperlinks to Excel as clickable links. There are a few conditions that need to be met for the link to be exported. The first is that the URL needs to be properly formatted (http:// or https://) and the second is that the URL is coming from your data source. Building the link our directly in the Table won’t satisfy the two conditions. If you’re using a Data Cube, you’ll be able to add a Calculated Element transform to build the URL.

Thanks,
Mark

Hi Mark,

The hyperlink is taken directly from the table in the query (and looks like “https://www.mydomain.int/Publications%20Container/PublicationName”), because the URL is stored in the table, and returned as a field [PublicationUrl]. I have also a text field [Publication] containing the name corresponding to the link. And the query filters out the rows having no valid URL in the corresponding field.

In the Dashboard I have declared the text field containing the name [Publication] as Hyperlink, and assigned to it the value of the field containing the URL [PublicationUrl], as shown below. I’m using a flat table view.


The hyperlink works fine when clicked in the Dashboard, it redirects to the corresponding publication. BUT when exporting, be it thru the Share->Excel or using the button with the script behind, I don’t get an hyperlink in Excel, but just the text field value ([Publication]) even if it has the look and feel of an hyperlink.
I may have done something wrong, but I don’t see what prevents me from having the hyperlink exported as an hyperlink.
I’m working on the Dundas version 8.0.1.1002.

Olivier

Speaking to our dev team, we only support hyperlinks on the URL text field itself. The text itself has to be a URL.

That said, you can do something like this: Setting up the Hyperlink on your URL field and also setting the Column width to 0.

image

This way, your table will still look and feel the same in Dundas…

image

…but your URL’s and valid hyperlinks are present in the export.

image

Hi Christian,

Thank you for your answer.
So if I understand well what you are telling me, there is no way to have an hyperlink exported as it’s shown in the Dashboard (< a href=“myURL”>the text shown to the end-user< /a >), if it’s defined on a text field adding the URL in the hyperlink address.

If I set the hyperlink type on the URL directly, even if I put custom text for presenting it to the end-user in a more understandable way in the Dashboard, when it’s exported it’s the full URL that shows up, which, for the end-user, is a bit disturbing.

From the end-user point of view something that works as the HTML < a > tag would be the best. Be it by defining a URL on a text field set as Hyperlink, or setting custom text on a URL field set as Hyperlink.

A new feature for the next version?

After discussing this with the dev team, we actually have plans to implement keywords in the upcoming minor release of Dundas - version 8.0.2. With keyword support, you will be able to achieve your original use case of having the hyperlink apply to a column that doesn’t have the actual URL text.

We actually created a bug report as keywords weren’t working as expected for hyperlinks in our prerelease - issue 88425 is the ticket and the fix for it will be included in the next minor release.